From b3b5680956b22cf6d658787018928a669ccb45f9 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Thu, 14 Nov 2024 09:09:13 +0100 Subject: [PATCH] ci: run examples/bird-ospf --- .builds/examples.yml | 4 ++++ ci/examples | 24 +++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.builds/examples.yml b/.builds/examples.yml index 413db53..8162a4a 100644 --- a/.builds/examples.yml +++ b/.builds/examples.yml @@ -2,10 +2,14 @@ image: archlinux packages: + - bird - go - iproute2 tasks: - all: | + sudo useradd --system --user-group bird + sudo mkdir -p /run/bird + cd linux-network-namespace-labs make sudo ./ci/examples diff --git a/ci/examples b/ci/examples index 52a72ba..2379bdf 100755 --- a/ci/examples +++ b/ci/examples @@ -4,9 +4,20 @@ # Copyright (C) 2024 Simon Ruderich set -eu -set -x +wait_for_route() { + for x in $(seq 1 60); do + if ip -n "$1" route get "$2" 2> /dev/null; then + break + fi + sleep 1 + done +} + + +set -x + cd "$(dirname "$0")" examples="$(pwd)/../examples" @@ -21,3 +32,14 @@ ip netns exec r1 ping -c1 r2-loop ip netns exec r1 ping -c1 r3-loop ../../linux-network-namespace-labs down lab.conf test -z "$(ip netns)" + +cd "$examples/bird-ospf" +../../linux-network-namespace-labs up lab.conf +# Wait until OSPF is ready +wait_for_route r1 3fff::1 +wait_for_route r1 3fff::2 +ip netns exec r1 ping -c1 r1-loop +ip netns exec r1 ping -c1 r2-loop +ip netns exec r1 ping -c1 r3-loop +../../linux-network-namespace-labs down lab.conf +test -z "$(ip netns)" -- 2.45.2