From: Jonathan Rajotte Date: Mon, 3 May 2021 19:07:41 +0000 (-0400) Subject: tools: lava: some destructive tests are not part of the make test suite X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c1bede3c5fe828179c6f14dc7237aafab5067352;p=lttng-ci.git tools: lava: some destructive tests are not part of the make test suite It is always expected that the destructive tests are only conducted when the user is root. Signed-off-by: Jonathan Rajotte --- diff --git a/scripts/lttng-tools/build.sh b/scripts/lttng-tools/build.sh index caa48f5..017beb9 100755 --- a/scripts/lttng-tools/build.sh +++ b/scripts/lttng-tools/build.sh @@ -442,6 +442,15 @@ if [ "$RUN_TESTS" = "yes" ] && [ "$conf" != "no-ust" ]; then # Run 'unit_tests', 2.8 and up has a new test suite if vergte "$PACKAGE_VERSION" "2.8"; then + # It is implied that tests depending on LTTNG_ENABLE_DESTRUCTIVE_TESTS + # only run for the root user. Note that here `destructive` means that + # operations are performed at the host level (add user etc.) that + # effectively modify the host. Running those tests are acceptable on our + # CI and root jobs since we always run root tests against a `snapshot` + # of the host. + if [ "$(id -u)" == "0" ]; then + export LTTNG_ENABLE_DESTRUCTIVE_TESTS="will-break-my-system" + fi make --keep-going check || failed_tests=1 rsync -a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests/ "$TAPDIR" else diff --git a/scripts/system-tests/run-test-suites.sh b/scripts/system-tests/run-test-suites.sh index 44b6a90..e1612aa 100755 --- a/scripts/system-tests/run-test-suites.sh +++ b/scripts/system-tests/run-test-suites.sh @@ -82,6 +82,8 @@ if [[ "$lttng_version" == "master" ]]; then fi elif vergte "$lttng_version" "2.13"; then # All root regression are now part of the make check + # *destructive* tests are now part of the `make`-based test suites. + export LTTNG_ENABLE_DESTRUCTIVE_TESTS="will-break-my-system" make --keep-going check || failed_tests=1 else make --keep-going check || failed_tests=1