]> ruderich.org/simon Gitweb - linux-network-namespace-labs/linux-network-namespace-labs.git/commitdiff
ci: run examples/bird-ospf
authorSimon Ruderich <simon@ruderich.org>
Thu, 14 Nov 2024 08:09:13 +0000 (09:09 +0100)
committerSimon Ruderich <simon@ruderich.org>
Thu, 14 Nov 2024 08:09:13 +0000 (09:09 +0100)
.builds/examples.yml
ci/examples

index 413db53d80083d560d0b1a1dc8f13921d992d6ed..8162a4ab1cb71d3c638041cb306286f685f30a28 100644 (file)
@@ -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
index 52a72ba46d028b7f003e46e1a19eb08ed86de379..2379bdfbffcebdfc9649668dcbc449f8d71fa4fc 100755 (executable)
@@ -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)"