Skip to content

Commit

Permalink
Merge tag 'linux-kselftest-kunit-fixes-6.0-rc5' of git://git.kernel.o…
Browse files Browse the repository at this point in the history
…rg/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull KUnit fixes from Shuah Khan:
 "Two fixes to test build and a fix for incorrect taint reason reporting"

* tag 'linux-kselftest-kunit-fixes-6.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  tools: Add new "test" taint to kernel-chktaint
  kunit: fix Kconfig for build-in tests USB4 and Nitro Enclaves
  kunit: fix assert_type for comparison macros
  • Loading branch information
torvalds committed Sep 9, 2022
2 parents 22b2e2d + 2a2dfc8 commit e35ff25
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
3 changes: 1 addition & 2 deletions drivers/thunderbolt/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ config USB4_DEBUGFS_WRITE

config USB4_KUNIT_TEST
bool "KUnit tests" if !KUNIT_ALL_TESTS
depends on (USB4=m || KUNIT=y)
depends on KUNIT
depends on USB4 && KUNIT=y
default KUNIT_ALL_TESTS

config USB4_DMA_TEST
Expand Down
2 changes: 1 addition & 1 deletion drivers/virt/nitro_enclaves/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ config NITRO_ENCLAVES

config NITRO_ENCLAVES_MISC_DEV_TEST
bool "Tests for the misc device functionality of the Nitro Enclaves" if !KUNIT_ALL_TESTS
depends on NITRO_ENCLAVES && KUNIT
depends on NITRO_ENCLAVES && KUNIT=y
default KUNIT_ALL_TESTS
help
Enable KUnit tests for the misc device functionality of the Nitro
Expand Down
6 changes: 3 additions & 3 deletions include/kunit/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ do { \

#define KUNIT_EXPECT_LE_MSG(test, left, right, fmt, ...) \
KUNIT_BINARY_INT_ASSERTION(test, \
KUNIT_ASSERTION, \
KUNIT_EXPECTATION, \
left, <=, right, \
fmt, \
##__VA_ARGS__)
Expand Down Expand Up @@ -1116,7 +1116,7 @@ do { \

#define KUNIT_ASSERT_LT_MSG(test, left, right, fmt, ...) \
KUNIT_BINARY_INT_ASSERTION(test, \
KUNIT_EXPECTATION, \
KUNIT_ASSERTION, \
left, <, right, \
fmt, \
##__VA_ARGS__)
Expand Down Expand Up @@ -1157,7 +1157,7 @@ do { \

#define KUNIT_ASSERT_GT_MSG(test, left, right, fmt, ...) \
KUNIT_BINARY_INT_ASSERTION(test, \
KUNIT_EXPECTATION, \
KUNIT_ASSERTION, \
left, >, right, \
fmt, \
##__VA_ARGS__)
Expand Down
9 changes: 9 additions & 0 deletions tools/debugging/kernel-chktaint
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ else
echo " * auxiliary taint, defined for and used by distros (#16)"

fi

T=`expr $T / 2`
if [ `expr $T % 2` -eq 0 ]; then
addout " "
Expand All @@ -195,6 +196,14 @@ else
echo " * kernel was built with the struct randomization plugin (#17)"
fi

T=`expr $T / 2`
if [ `expr $T % 2` -eq 0 ]; then
addout " "
else
addout "N"
echo " * an in-kernel test (such as a KUnit test) has been run (#18)"
fi

echo "For a more detailed explanation of the various taint flags see"
echo " Documentation/admin-guide/tainted-kernels.rst in the Linux kernel sources"
echo " or https://kernel.org/doc/html/latest/admin-guide/tainted-kernels.html"
Expand Down

0 comments on commit e35ff25

Please sign in to comment.