]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tracing/selftests: Run the ownership test twice
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 23 May 2024 16:45:41 +0000 (12:45 -0400)
committerShuah Khan <skhan@linuxfoundation.org>
Wed, 7 Aug 2024 20:51:16 +0000 (14:51 -0600)
A regression happened where running the ownership test passes on the first
iteration but fails running it a second time. This was caught and fixed,
but a later change brought it back. The regression was missed because the
automated tests only run the tests once per boot.

Change the ownership test to iterate through the tests twice, as this will
catch the regression with a single run.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc

index c45094d1e1d2db2e812f7a7480256f581b63b3b8..71e43a92352ad6473591d586309e7e5bb89d8d3e 100644 (file)
@@ -83,32 +83,38 @@ run_tests() {
        done
 }
 
-mount -o remount,"$new_options" .
+# Run the tests twice as leftovers can cause issues
+for loop in 1 2 ; do
 
-run_tests
+       echo "Running iteration $loop"
 
-mount -o remount,"$mount_options" .
+       mount -o remount,"$new_options" .
 
-for d in "." "events" "events/sched" "events/sched/sched_switch" "events/sched/sched_switch/enable" $canary; do
-       test "$d" $original_group
-done
+       run_tests
+
+       mount -o remount,"$mount_options" .
+
+       for d in "." "events" "events/sched" "events/sched/sched_switch" "events/sched/sched_switch/enable" $canary; do
+               test "$d" $original_group
+       done
 
 # check instances as well
 
-chgrp $other_group instances
+       chgrp $other_group instances
 
-instance="$(mktemp -u test-XXXXXX)"
+       instance="$(mktemp -u test-XXXXXX)"
 
-mkdir instances/$instance
+       mkdir instances/$instance
 
-cd instances/$instance
+       cd instances/$instance
 
-run_tests
+       run_tests
 
-cd ../..
+       cd ../..
 
-rmdir instances/$instance
+       rmdir instances/$instance
 
-chgrp $original_group instances
+       chgrp $original_group instances
+done
 
 exit 0