]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: fix the container ID check
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 26 Jan 2024 14:44:39 +0000 (15:44 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 26 Jan 2024 14:44:39 +0000 (15:44 +0100)
It never worked, but the fail was masked by missing set -e, see the
previous commit.

Also, throw env into the test container and dump the environment on
container start, to make potential failures easier to debug.

test/TEST-13-NSPAWN/test.sh
test/units/testsuite-13.nspawn.sh

index 28d845c94bd38dbdb7f1ced606d1150ba58f0060..6dfb5277183b63ce3017aeee6c4e7ac905aa29d0 100755 (executable)
@@ -22,6 +22,7 @@ test_append_files() {
     initdir="$container" setup_basic_dirs
     initdir="$container" image_install \
         bash \
+        env \
         cat \
         hostname \
         grep \
index 6647ac8b2768cbf679a9e17f112459dd7284be44..79ee239d8d738a3806c36872533344930e63e207 100755 (executable)
@@ -414,6 +414,8 @@ EOF
 #!/bin/bash
 set -ex
 
+env
+
 [[ "$1" == "foo bar" ]]
 [[ "$2" == "bar baz" ]]
 
@@ -421,7 +423,7 @@ set -ex
 [[ "$FOO" == bar ]]
 [[ "$BAZ" == "hello world" ]]
 [[ "$PWD" == /tmp ]]
-[[ "$(</etc/machine-id)" == f28f129b51874b1280a89421ec4b4ad4 ]]
+[[ "$container_uuid" == f28f129b-5187-4b12-80a8-9421ec4b4ad4 ]]
 [[ "$(ulimit -S -n)" -eq 1024 ]]
 [[ "$(ulimit -H -n)" -eq 2048 ]]
 [[ "$(ulimit -S -r)" -eq 8 ]]