tools: lava: some destructive tests are not part of the make test suite
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 3 May 2021 19:07:41 +0000 (15:07 -0400)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 3 May 2021 19:07:41 +0000 (15:07 -0400)
It is always expected that the destructive tests are only conducted when
the user is root.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
scripts/lttng-tools/build.sh
scripts/system-tests/run-test-suites.sh

index caa48f5c8f6476b901eb99eced5497100e9d0b2a..017beb9cb6126bf07618122eecf1f2737358a7ab 100755 (executable)
@@ -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
index 44b6a9014ed9ca1bb4a3fa82281cf454db6e34c7..e1612aa57ea0c5373bc1e4212cebf5df41c933df 100755 (executable)
@@ -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
This page took 0.026195 seconds and 4 git commands to generate.