1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-13 12:58:20 +03:00

test: fix the container ID check

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.

(cherry picked from commit 8ee32f688fa864a04c5c94fd9c3dbea00cffdc07)
This commit is contained in:
Frantisek Sumsal 2024-01-26 15:44:39 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent 422cb5b875
commit be905c0d81
2 changed files with 4 additions and 1 deletions

View File

@ -18,6 +18,7 @@ test_append_files() {
initdir="$container" setup_basic_dirs initdir="$container" setup_basic_dirs
initdir="$container" image_install \ initdir="$container" image_install \
bash \ bash \
env \
cat \ cat \
hostname \ hostname \
grep \ grep \

View File

@ -407,6 +407,8 @@ EOF
#!/bin/bash #!/bin/bash
set -ex set -ex
env
[[ "$1" == "foo bar" ]] [[ "$1" == "foo bar" ]]
[[ "$2" == "bar baz" ]] [[ "$2" == "bar baz" ]]
@ -414,7 +416,7 @@ set -ex
[[ "$FOO" == bar ]] [[ "$FOO" == bar ]]
[[ "$BAZ" == "hello world" ]] [[ "$BAZ" == "hello world" ]]
[[ "$PWD" == /tmp ]] [[ "$PWD" == /tmp ]]
[[ "$(</etc/machine-id)" == f28f129b51874b1280a89421ec4b4ad4 ]] [[ "$container_uuid" == f28f129b-5187-4b12-80a8-9421ec4b4ad4 ]]
[[ "$(ulimit -S -n)" -eq 1024 ]] [[ "$(ulimit -S -n)" -eq 1024 ]]
[[ "$(ulimit -H -n)" -eq 2048 ]] [[ "$(ulimit -H -n)" -eq 2048 ]]
[[ "$(ulimit -S -r)" -eq 8 ]] [[ "$(ulimit -S -r)" -eq 8 ]]