mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 18:23:32 +08:00
test: perform partial cleanup after each test is run
This causes the unprivileged-nspawn-root directory to be removed after running one test. The advantage is that we reduce the maximum disk-space use quite a bit (47*400 MB → about 18GB).
This commit is contained in:
parent
108d00a6b2
commit
693ad298e9
@ -6,7 +6,7 @@ if [ $# -gt 0 ]; then
|
|||||||
args="$@"
|
args="$@"
|
||||||
do_clean=0
|
do_clean=0
|
||||||
else
|
else
|
||||||
args="setup run"
|
args="setup run clean-again"
|
||||||
do_clean=1
|
do_clean=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1104,6 +1104,8 @@ setup_nspawn_root() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -rf "$TESTDIR/unprivileged-nspawn-root"
|
||||||
|
|
||||||
if [[ "$RUN_IN_UNPRIVILEGED_CONTAINER" = "yes" ]]; then
|
if [[ "$RUN_IN_UNPRIVILEGED_CONTAINER" = "yes" ]]; then
|
||||||
ddebug "cp -ar $initdir $TESTDIR/unprivileged-nspawn-root"
|
ddebug "cp -ar $initdir $TESTDIR/unprivileged-nspawn-root"
|
||||||
cp -ar $initdir $TESTDIR/unprivileged-nspawn-root
|
cp -ar $initdir $TESTDIR/unprivileged-nspawn-root
|
||||||
@ -1936,6 +1938,12 @@ test_cleanup() {
|
|||||||
_test_cleanup
|
_test_cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test_cleanup_again() {
|
||||||
|
[ -n "$TESTDIR" ] || return
|
||||||
|
rm -rf "$TESTDIR/unprivileged-nspawn-root"
|
||||||
|
umount_initdir
|
||||||
|
}
|
||||||
|
|
||||||
test_create_image() {
|
test_create_image() {
|
||||||
create_empty_image_rootdir
|
create_empty_image_rootdir
|
||||||
|
|
||||||
@ -2039,10 +2047,14 @@ do_test() {
|
|||||||
test_setup
|
test_setup
|
||||||
test_setup_cleanup
|
test_setup_cleanup
|
||||||
;;
|
;;
|
||||||
--clean|--clean-again)
|
--clean)
|
||||||
echo "TEST CLEANUP: $TEST_DESCRIPTION"
|
echo "TEST CLEANUP: $TEST_DESCRIPTION"
|
||||||
test_cleanup
|
test_cleanup
|
||||||
;;
|
;;
|
||||||
|
--clean-again)
|
||||||
|
echo "TEST CLEANUP AGAIN: $TEST_DESCRIPTION"
|
||||||
|
test_cleanup_again
|
||||||
|
;;
|
||||||
--all)
|
--all)
|
||||||
ret=0
|
ret=0
|
||||||
echo -n "TEST: $TEST_DESCRIPTION "
|
echo -n "TEST: $TEST_DESCRIPTION "
|
||||||
|
Loading…
Reference in New Issue
Block a user