Skip to content

Commit 052f395

Browse files
ryanbsullpmladek
authored andcommitted
selftests/livepatch: wait for atomic replace to occur
On some machines with a large number of CPUs there is a sizable delay between an atomic replace occurring and when sysfs updates accordingly. This fix uses 'loop_until' to wait for the atomic replace to unload all previous livepatches. Reported-by: CKI Project <[email protected]> Closes: https://datawarehouse.cki-project.org/kcidb/tests/redhat:1413102084-x86_64-kernel_upt_28 Signed-off-by: Ryan Sullivan <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Acked-by: Joe Lawrence <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
1 parent d2d721e commit 052f395

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tools/testing/selftests/livepatch/test-livepatch.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,8 @@ load_lp $MOD_REPLACE replace=1
139139
grep 'live patched' /proc/cmdline > /dev/kmsg
140140
grep 'live patched' /proc/meminfo > /dev/kmsg
141141

142-
mods=(/sys/kernel/livepatch/*)
143-
nmods=${#mods[@]}
144-
if [ "$nmods" -ne 1 ]; then
145-
die "Expecting only one moduled listed, found $nmods"
146-
fi
142+
loop_until 'mods=(/sys/kernel/livepatch/*); nmods=${#mods[@]}; [[ "$nmods" -eq 1 ]]' ||
143+
die "Expecting only one moduled listed, found $nmods"
147144

148145
# These modules were disabled by the atomic replace
149146
for mod in $MOD_LIVEPATCH3 $MOD_LIVEPATCH2 $MOD_LIVEPATCH1; do

0 commit comments

Comments
 (0)