From 450eedeb56be0ae480c350664523e7610efda899 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Wed, 13 Nov 2024 17:47:44 +0100 Subject: [PATCH] Add (sr.ht) CI to run examples --- .builds/examples.yml | 11 +++++++++++ ci/examples | 23 +++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 .builds/examples.yml create mode 100755 ci/examples diff --git a/.builds/examples.yml b/.builds/examples.yml new file mode 100644 index 0000000..413db53 --- /dev/null +++ b/.builds/examples.yml @@ -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 index 0000000..52a72ba --- /dev/null +++ b/ci/examples @@ -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)" -- 2.45.2