summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-10-18 20:59:24 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-10-18 20:59:24 +0200
commit40235c3c5eb7067a65f01f608834a76d0851cf19 (patch)
tree0ee9c692f34518f48cead18457e43e8ec392fff2
parentjob: add a comment that JOB_DONE also means skipped due to condition (#10453) (diff)
downloadsystemd-40235c3c5eb7067a65f01f608834a76d0851cf19.tar.xz
systemd-40235c3c5eb7067a65f01f608834a76d0851cf19.zip
tests: clean up again after running tests (#10446)
Currently, if I run the full "run-integration-tests.sh" script it will fail on my machine because it fills up /var/tmp whith just too much crap until the disk is full. Let's make sure that "run-integration-tests.sh" cleans up after every test. For that change the make targets to run from "clean setup run" to "clean setup run clean" — except that that doesn't work since make is smart enough to realize that the same target appears twice on the command line and will only execute it once. Let's fix that by defining another target "clean-again" which is just like "clean", but allows us to be added to the same command line a second time. Then, let's build with "clean setup run clean-again" and all is good. While we are at it, let's also add .PHONY where appropriate, after all these all are phony targets.
-rw-r--r--test/TEST-01-BASIC/Makefile7
-rw-r--r--test/TEST-13-NSPAWN-SMOKE/Makefile5
-rwxr-xr-xtest/run-integration-tests.sh2
3 files changed, 11 insertions, 3 deletions
diff --git a/test/TEST-01-BASIC/Makefile b/test/TEST-01-BASIC/Makefile
index 34d7cc6cdf..45e9bfc67c 100644
--- a/test/TEST-01-BASIC/Makefile
+++ b/test/TEST-01-BASIC/Makefile
@@ -1,4 +1,9 @@
BUILD_DIR=$(shell ../../tools/find-build-dir.sh)
-all setup clean run:
+all setup run:
@basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@
+
+clean clean-again:
+ @basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --clean
+
+.PHONY: all setup run clean clean-again
diff --git a/test/TEST-13-NSPAWN-SMOKE/Makefile b/test/TEST-13-NSPAWN-SMOKE/Makefile
index 7d74b1343a..e5e3350211 100644
--- a/test/TEST-13-NSPAWN-SMOKE/Makefile
+++ b/test/TEST-13-NSPAWN-SMOKE/Makefile
@@ -2,6 +2,9 @@ BUILD_DIR=$(shell ../../tools/find-build-dir.sh)
all setup run:
@basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@
-clean:
+
+clean clean-again:
@basedir=../.. TEST_BASE_DIR=../ ./test.sh --clean
@rm -f has-overflow
+
+.PHONY: all setup run clean clean-again
diff --git a/test/run-integration-tests.sh b/test/run-integration-tests.sh
index 94df346c28..0d2377128e 100755
--- a/test/run-integration-tests.sh
+++ b/test/run-integration-tests.sh
@@ -4,7 +4,7 @@ BUILD_DIR="$($(dirname "$0")/../tools/find-build-dir.sh)"
if [ $# -gt 0 ]; then
args="$@"
else
- args="clean setup run"
+ args="clean setup run clean-again"
fi
ninja -C "$BUILD_DIR"