]> ruderich.org/simon Gitweb - linux-network-namespace-labs/linux-network-namespace-labs.git/commitdiff
Add (sr.ht) CI to run examples
authorSimon Ruderich <simon@ruderich.org>
Wed, 13 Nov 2024 16:47:44 +0000 (17:47 +0100)
committerSimon Ruderich <simon@ruderich.org>
Wed, 13 Nov 2024 16:47:44 +0000 (17:47 +0100)
.builds/examples.yml [new file with mode: 0644]
ci/examples [new file with mode: 0755]

diff --git a/.builds/examples.yml b/.builds/examples.yml
new file mode 100644 (file)
index 0000000..413db53
--- /dev/null
@@ -0,0 +1,11 @@
+# Build manifest for build.sr.ht which runs build jobs in a VMs
+
+image: archlinux
+packages:
+  - go
+  - iproute2
+tasks:
+  - all: |
+      cd linux-network-namespace-labs
+      make
+      sudo ./ci/examples
diff --git a/ci/examples b/ci/examples
new file mode 100755 (executable)
index 0000000..52a72ba
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: GPL-3.0-or-later
+# Copyright (C) 2024  Simon Ruderich
+
+set -eu
+set -x
+
+
+cd "$(dirname "$0")"
+examples="$(pwd)/../examples"
+
+# No network namespaces (yet)
+test -z "$(ip netns)"
+
+
+cd "$examples/readme"
+../../linux-network-namespace-labs up lab.conf
+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)"