X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Fdestructive%2Fmetadata-regeneration;h=b81e7af32d22d1c1614f8c55409392d61e28711f;hb=HEAD;hp=7311b3002707c985040d1bd6a40d88f8b26ff85d;hpb=8d5a3312b34841f1ecba2605acad3eaca79fd5e4;p=lttng-tools.git diff --git a/tests/destructive/metadata-regeneration b/tests/destructive/metadata-regeneration index 7311b3002..dcae6bce0 100755 --- a/tests/destructive/metadata-regeneration +++ b/tests/destructive/metadata-regeneration @@ -189,12 +189,6 @@ function test_ust_streaming () rm -f "${file_sync_before_last}" } -if [ "$(id -u)" == "0" ]; then - isroot=1 -else - isroot=0 -fi - if ! destructive_tests_enabled ; then echo 'Please make sure that ntp is not running while executing this test' skip 0 "You need to set the LTTNG_ENABLE_DESTRUCTIVE_TESTS environment variable to \"will-break-my-system\" to run this test" $NUM_TESTS @@ -202,8 +196,9 @@ if ! destructive_tests_enabled ; then exit 0 fi -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || +check_skip_kernel_test $NUM_TESTS "Skipping all tests." || { + original_date=$(date) start_lttng_relayd "-o $TRACE_PATH" start_lttng_sessiond @@ -217,4 +212,11 @@ skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || stop_lttng_sessiond stop_lttng_relayd + + # This set of test sets the date in the past which causes + # `make` to panic when it sees files created in the "future" + # while running the "check" target. Obviously this doesn't set + # the correct date, but at least its close enough to allow the + # test suite to continue. + date --set "$original_date" }