Skip to content

Commit 53af1a4

Browse files
rostedtshuahkh
authored andcommitted
tracing/selftests: Run the ownership test twice
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) <[email protected]> Acked-by: Masami Hiramatsu (Google) <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 98f8fae commit 53af1a4

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -83,32 +83,38 @@ run_tests() {
8383
done
8484
}
8585

86-
mount -o remount,"$new_options" .
86+
# Run the tests twice as leftovers can cause issues
87+
for loop in 1 2 ; do
8788

88-
run_tests
89+
echo "Running iteration $loop"
8990

90-
mount -o remount,"$mount_options" .
91+
mount -o remount,"$new_options" .
9192

92-
for d in "." "events" "events/sched" "events/sched/sched_switch" "events/sched/sched_switch/enable" $canary; do
93-
test "$d" $original_group
94-
done
93+
run_tests
94+
95+
mount -o remount,"$mount_options" .
96+
97+
for d in "." "events" "events/sched" "events/sched/sched_switch" "events/sched/sched_switch/enable" $canary; do
98+
test "$d" $original_group
99+
done
95100

96101
# check instances as well
97102

98-
chgrp $other_group instances
103+
chgrp $other_group instances
99104

100-
instance="$(mktemp -u test-XXXXXX)"
105+
instance="$(mktemp -u test-XXXXXX)"
101106

102-
mkdir instances/$instance
107+
mkdir instances/$instance
103108

104-
cd instances/$instance
109+
cd instances/$instance
105110

106-
run_tests
111+
run_tests
107112

108-
cd ../..
113+
cd ../..
109114

110-
rmdir instances/$instance
115+
rmdir instances/$instance
111116

112-
chgrp $original_group instances
117+
chgrp $original_group instances
118+
done
113119

114120
exit 0

0 commit comments

Comments
 (0)