From 2cb7e0aaedad73b076ea18c6900b0e86c5760d79 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 15:00:47 +0200 Subject: Adding upstream version 247.3. Signed-off-by: Daniel Baumann --- test/test-network-generator-conversion.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 test/test-network-generator-conversion.sh (limited to 'test/test-network-generator-conversion.sh') diff --git a/test/test-network-generator-conversion.sh b/test/test-network-generator-conversion.sh new file mode 100755 index 0000000..50df69f --- /dev/null +++ b/test/test-network-generator-conversion.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -ex + +if [[ -n "$1" ]]; then + generator=$1 +elif [[ -x /usr/lib/systemd/systemd-network-generator ]]; then + generator=/usr/lib/systemd/systemd-network-generator +elif [[ -x /lib/systemd/systemd-network-generator ]]; then + generator=/lib/systemd/systemd-network-generator +else + exit 1 +fi + +src="$(dirname "$0")/testdata/test-network-generator-conversion" + +for f in "$src"/test-*.input; do + echo "*** Running $f" + + ( + out=$(mktemp --tmpdir --directory "test-network-generator-conversion.XXXXXXXXXX") + trap "rm -rf '$out'" EXIT INT QUIT PIPE + + $generator --root "$out" -- $(cat $f) + + if ! diff -u "$out"/run/systemd/network ${f%.input}.expected; then + echo "**** Unexpected output for $f" + exit 1 + fi + ) || exit 1 +done -- cgit v1.2.3