Re: [PATCH 1/3] selftests/livepatch: Don't clear dmesg when running tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/11/20 3:38 AM, Miroslav Benes wrote:
Hi,

On Wed, 10 Jun 2020, Joe Lawrence wrote:

diff --git a/tools/testing/selftests/livepatch/test-callbacks.sh b/tools/testing/selftests/livepatch/test-callbacks.sh
index 32b57ba07f4f..c3d949da5bb7 100755
--- a/tools/testing/selftests/livepatch/test-callbacks.sh
+++ b/tools/testing/selftests/livepatch/test-callbacks.sh
@@ -12,7 +12,7 @@ MOD_TARGET_BUSY=test_klp_callbacks_busy
  setup_config
-# TEST: target module before livepatch
+start_test "target module before livepatch"
  #
  # Test a combination of loading a kernel module and a livepatch that
  # patches a function in the first module.  Load the target module
@@ -28,9 +28,6 @@ setup_config
  #   unpatching transition starts.  klp_objects are reverted, post-patch
  #   callbacks execute and the transition completes.
-echo -n "TEST: target module before livepatch ... "
-dmesg -C
-

A nit, but I think it would be better to place start_test here below the
comment. The same for other occurrences in test-callbacks.sh.


The idea was to remove the duplicate # TEST: comment and then the same echo -n "TEST: ..." entries.

Would it still look okay if we move start_test to below the comment and omit that # TEST ... part? (This might be what you're suggesting, but I wanted to make sure.)

[...]

diff --git a/tools/testing/selftests/livepatch/test-state.sh b/tools/testing/selftests/livepatch/test-state.sh
index a08212708115..bf8db1613961 100755
--- a/tools/testing/selftests/livepatch/test-state.sh
+++ b/tools/testing/selftests/livepatch/test-state.sh
@@ -10,10 +10,7 @@ MOD_LIVEPATCH3=test_klp_state3
setup_config -# TEST: Loading and removing a module that modifies the system state
-
-echo -n "TEST: system state modification ... "
-dmesg -C
+start_test "Loading and removing a module that modifies the system state"

start_test should get the message from the original echo command and not
the comment above, I think...


Yup, good eye.

  load_lp $MOD_LIVEPATCH
  disable_lp $MOD_LIVEPATCH
@@ -41,10 +38,7 @@ livepatch: '$MOD_LIVEPATCH': unpatching complete
  % rmmod $MOD_LIVEPATCH"
-# TEST: Take over system state change by a cumulative patch
-
-echo -n "TEST: taking over system state modification ... "
-dmesg -C
+start_test "Take over system state change by a cumulative patch"
load_lp $MOD_LIVEPATCH
  load_lp $MOD_LIVEPATCH2
@@ -85,10 +79,7 @@ livepatch: '$MOD_LIVEPATCH2': unpatching complete
  % rmmod $MOD_LIVEPATCH2"
-# TEST: Take over system state change by a cumulative patch
-
-echo -n "TEST: compatible cumulative livepatches ... "
-dmesg -C
+start_test "Take over system state change by a cumulative patch"

...because now we have two "Take over system state change by a cumulative
patch" tests in the log.


Right, the start_test messages should be unique.  I'll fix those up for v2.

-- Joe




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux