diff options
author | Joe Lawrence <joe.lawrence@redhat.com> | 2020-06-18 14:10:38 -0400 |
---|---|---|
committer | Petr Mladek <pmladek@suse.com> | 2020-06-19 10:46:42 +0200 |
commit | 2eeb0d457d13ed7b170e13cd99d15509d0dd832d (patch) | |
tree | 2b210a9706d67d8053ebf7c4d9a93449b0c2bbfe /tools/testing/selftests/livepatch/test-livepatch.sh | |
parent | 270f7806d3b91b9c71fa8fe66f7dcc2d6587694e (diff) |
selftests/livepatch: Don't clear dmesg when running tests
Inspired by commit f131d9edc29d ("selftests/lkdtm: Don't clear dmesg
when running tests"), keep a reference dmesg copy when beginning each
test. This way check_result() can compare against the initial copy
rather than relying upon an empty log.
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Reviewed-by: Yannick Cote <ycote@redhat.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20200618181040.21132-2-joe.lawrence@redhat.com
Diffstat (limited to 'tools/testing/selftests/livepatch/test-livepatch.sh')
-rwxr-xr-x | tools/testing/selftests/livepatch/test-livepatch.sh | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/tools/testing/selftests/livepatch/test-livepatch.sh b/tools/testing/selftests/livepatch/test-livepatch.sh index 493e3df415a1..5fe79ac34be1 100755 --- a/tools/testing/selftests/livepatch/test-livepatch.sh +++ b/tools/testing/selftests/livepatch/test-livepatch.sh @@ -10,13 +10,11 @@ MOD_REPLACE=test_klp_atomic_replace setup_config -# TEST: basic function patching # - load a livepatch that modifies the output from /proc/cmdline and # verify correct behavior # - unload the livepatch and make sure the patch was removed -echo -n "TEST: basic function patching ... " -dmesg -C +start_test "basic function patching" load_lp $MOD_LIVEPATCH @@ -47,15 +45,13 @@ livepatch: '$MOD_LIVEPATCH': unpatching complete % rmmod $MOD_LIVEPATCH" -# TEST: multiple livepatches # - load a livepatch that modifies the output from /proc/cmdline and # verify correct behavior # - load another livepatch and verify that both livepatches are active # - unload the second livepatch and verify that the first is still active # - unload the first livepatch and verify none are active -echo -n "TEST: multiple livepatches ... " -dmesg -C +start_test "multiple livepatches" load_lp $MOD_LIVEPATCH @@ -109,7 +105,6 @@ livepatch: '$MOD_LIVEPATCH': unpatching complete % rmmod $MOD_LIVEPATCH" -# TEST: atomic replace livepatch # - load a livepatch that modifies the output from /proc/cmdline and # verify correct behavior # - load an atomic replace livepatch and verify that only the second is active @@ -117,8 +112,7 @@ livepatch: '$MOD_LIVEPATCH': unpatching complete # is still active # - remove the atomic replace livepatch and verify that none are active -echo -n "TEST: atomic replace livepatch ... " -dmesg -C +start_test "atomic replace livepatch" load_lp $MOD_LIVEPATCH |