On Wed, 6 Nov 2019, Joe Lawrence wrote: > The livepatch selftests compare expected dmesg output to verify kernel > behavior. They currently filter out "tainting kernel with > TAINT_LIVEPATCH" messages which may be logged when loading livepatch > modules. > > Further filter the log to also drop "loading out-of-tree module taints > kernel" messages in case the klp_test modules have been build without > the in-tree module flag. That is true, but "tainting kernel with TAINT_LIVEPATCH" should be printed out even in this case. check_modinfo_livepatch() is called for all modules and relies on MODINFO(livepatch, Y). So either the bug is elsewhere or I need one more cup of tea. Miroslav > Signed-off-by: Joe Lawrence <joe.lawrence@xxxxxxxxxx> > --- > > Note: I stumbled across this in a testing scenario and thought it might > be generally useful to extend this admittedly fragile mechanism. Since > there are no related livepatch-core changes, this can go through Shuah's > kselftest tree if she prefers. -- Joe > > tools/testing/selftests/livepatch/functions.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh > index 79b0affd21fb..57975c323542 100644 > --- a/tools/testing/selftests/livepatch/functions.sh > +++ b/tools/testing/selftests/livepatch/functions.sh > @@ -221,7 +221,7 @@ function check_result { > local expect="$*" > local result > > - result=$(dmesg | grep -v 'tainting' | grep -e 'livepatch:' -e 'test_klp' | sed 's/^\[[ 0-9.]*\] //') > + result=$(dmesg | grep -ve '\<taints\>' -ve '\<tainting\>' | grep -e 'livepatch:' -e 'test_klp' | sed 's/^\[[ 0-9.]*\] //') > > if [[ "$expect" == "$result" ]] ; then > echo "ok" > -- > 2.21.0 >