diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-12-13 14:21:31 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-03-28 11:51:29 +0100 |
commit | ec43f6862eeafa1d737b60c8c812066f7cf1ff7a (patch) | |
tree | 8ffab03c293f46876e1d7b39491b34351b35479b /test/TEST-24-UNIT-TESTS | |
parent | test: wipe journal files after test (diff) | |
download | systemd-ec43f6862eeafa1d737b60c8c812066f7cf1ff7a.tar.xz systemd-ec43f6862eeafa1d737b60c8c812066f7cf1ff7a.zip |
test: run tests directly from the loopback device
Before, we'd copy the test tree into nspawn-root, and run the tests from there.
This is OK, and doesn't actually take much extra time. But it uses quite a lot
of extra disk space. So let's make things a bit more efficient by running
directly from the image file.
We still run the unprivileged nspawn tests from a copy. Once the kernel
implements fs shift, we can do away with that too.
Diffstat (limited to 'test/TEST-24-UNIT-TESTS')
-rwxr-xr-x | test/TEST-24-UNIT-TESTS/test.sh | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/TEST-24-UNIT-TESTS/test.sh b/test/TEST-24-UNIT-TESTS/test.sh index 5ce8d85433..2c70d42914 100755 --- a/test/TEST-24-UNIT-TESTS/test.sh +++ b/test/TEST-24-UNIT-TESTS/test.sh @@ -7,25 +7,25 @@ RUN_IN_UNPRIVILEGED_CONTAINER=yes check_result_nspawn() { local _ret=1 - [[ -e $TESTDIR/$1/testok ]] && _ret=0 - if [[ -s $TESTDIR/$1/failed ]]; then + [[ -e $1/testok ]] && _ret=0 + if [[ -s $1/failed ]]; then _ret=$(($_ret+1)) echo "=== Failed test log ===" - cat $TESTDIR/$1/failed + cat $1/failed else - if [[ -s $TESTDIR/$1/skipped ]]; then + if [[ -s $1/skipped ]]; then echo "=== Skipped test log ==" - cat $TESTDIR/$1/skipped + cat $1/skipped fi - if [[ -s $TESTDIR/$1/testok ]]; then + if [[ -s $1/testok ]]; then echo "=== Passed tests ===" - cat $TESTDIR/$1/testok + cat $1/testok fi fi - cp -a $TESTDIR/$1/var/log/journal $TESTDIR - rm -r $TESTDIR/$1/var/log/journal/* - [[ -n "$TIMED_OUT" ]] && _ret=$(($_ret+1)) + cp -a $1/var/log/journal $TESTDIR + rm -r $1/var/log/journal/* umount_initdir + [[ -n "$TIMED_OUT" ]] && _ret=$(($_ret+1)) return $_ret } |