From d76110ed24b2e7a20ba86dc3a4c12c6d79816e5b Mon Sep 17 00:00:00 2001 From: Joe Lawrence Date: Thu, 30 Jul 2020 14:11:36 -0400 Subject: [PATCH] kpatch-test: clear dmesg just before tests commence Defer clearing the kernel buffer until we're ready to start the tests, otherwise we increase the likelihood of catching stray errors while we're building the modules and preparing the tests. Fixes #1133 ("kpatch-test should ignore older kernel log messages") Signed-off-by: Joe Lawrence --- test/integration/kpatch-test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/kpatch-test b/test/integration/kpatch-test index 5d49f59..c47c5c2 100755 --- a/test/integration/kpatch-test +++ b/test/integration/kpatch-test @@ -303,9 +303,6 @@ if [[ "${ID}" == "rhel" && "${VERSION_ID%%.*}" == "7" && "${VERSION_ID##*.}" -le echo "Dynamic debug is not supported on '${PRETTY_NAME}', disabling." fi -echo "clearing printk buffer" -sudo dmesg -C - for file in "${PATCH_LIST[@]}"; do if [[ $QUICK != 1 || "$file" =~ -FAIL ]]; then build_module "$file" @@ -316,6 +313,9 @@ build_combined_module unload_all +echo "clearing printk buffer" +sudo dmesg -C + if [ "${DYNDEBUG_ENABLED}" == "1" ]; then prev_dyndebug=$(grep klp_try_switch_task "${DYNDEBUG_CONTROL}" | awk '{print $3;}') echo "func klp_try_switch_task +p" >"${DYNDEBUG_CONTROL}" 2>/dev/null