From: Andrew Delgadillo <adelg(a)google.com>
When testing a kernel, one of the earliest signals one can get is if a
kernel has become tainted. For example, an organization might be
interested in mass testing commits on their hardware. An obvious first
step would be to make sure every commit boots, and a next step would be
to make sure there are no warnings/crashes/lockups, hence the utility of
a taint test.
Signed-off-by: Andrew Delgadillo <adelg(a)google.com>
---
tools/testing/selftests/core/Makefile | 1 +
tools/testing/selftests/core/taint.sh | 28 +++++++++++++++++++++++++++
2 files changed, 29 insertions(+)
create mode 100755 tools/testing/selftests/core/taint.sh
diff --git a/tools/testing/selftests/core/Makefile b/tools/testing/selftests/core/Makefile
index f6f2d6f473c6a..695bdbfb02f90 100644
--- a/tools/testing/selftests/core/Makefile
+++ b/tools/testing/selftests/core/Makefile
@@ -2,6 +2,7 @@
CFLAGS += -g -I../../../../usr/include/
TEST_GEN_PROGS := close_range_test
+TEST_PROGS := taint.sh
include ../lib.mk
diff --git a/tools/testing/selftests/core/taint.sh b/tools/testing/selftests/core/taint.sh
new file mode 100755
index 0000000000000..661c2cb8cd9bf
--- /dev/null
+++ b/tools/testing/selftests/core/taint.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+set -oue pipefail
+
+# By default, we only want to check if our system has:
+# - seen an oops or bug
+# - a warning occurred
+# - a lockup occurred
+# The bit values for these, and more, can be found at
+# Documentation/admin-guide/tainted-kernels.html
+# This value can be overridden by passing a mask as the
+# first positional argument.
+taint_bitmask=$(( 128 + 512 + 16384 ))
+
+# If we have a positional argument, then override our
+# default bitmask.
+if [[ -n "${1-}" ]]; then
+ taint_bitmask=$1
+fi
+
+taint_bits=$(cat /proc/sys/kernel/tainted)
+
+result=$(( taint_bitmask & taint_bits ))
+if [[ "$result" -ne 0 ]]; then
+ exit 1
+fi
+
+exit 0
--
2.37.1.595.g718a3a8f04-goog
寄件人:JosephOpick <linux-kselftest(a)vger.kernel.org>
主旨:The Telegraph: Mude von Arbeit und Schulden? Raus aus dieser Scheie?
郵件內文:
Mude von niedrigen Lohnen und hohen Benzinpreisen? Es gibt eine Losung http://news-kc.cavemanorganics.com/news-bild-4196
--
This e-mail was sent from a contact form on Hearingaid (http://hearingaid.com.hk)
Hi Linus,
Please pull the following KUnit fixes update for Linux 6.0-rc3.
This KUnit fixes update for Linux 6.0-rc3 consists of fixes to mmc
test and fix to load .kunit_test_suites section when CONFIG_KUNIT=m,
and not just when KUnit is built-in.
Please note that this KUnit update touches mmc driver Kconfig and
kernel/module/main.c.
diff is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit 568035b01cfb107af8d2e4bd2fb9aea22cf5b868:
Linux 6.0-rc1 (2022-08-14 15:50:18 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-kunit-fixes-6.0-rc3
for you to fetch changes up to 41a55567b9e31cb852670684404654ec4fd0d8d6:
module: kunit: Load .kunit_test_suites section when CONFIG_KUNIT=m (2022-08-15 13:51:07 -0600)
----------------------------------------------------------------
linux-kselftest-kunit-fixes-6.0-rc3
This KUnit fixes update for Linux 6.0-rc3 consists of fixes to mmc
test and fix to load .kunit_test_suites section when CONFIG_KUNIT=m,
and not just when KUnit is built-in.
----------------------------------------------------------------
David Gow (2):
mmc: sdhci-of-aspeed: test: Fix dependencies when KUNIT=m
module: kunit: Load .kunit_test_suites section when CONFIG_KUNIT=m
drivers/mmc/host/Kconfig | 1 +
kernel/module/main.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------
Hi Linus,
Please pull the following Kselftest update for Linux 6.0-rc3.
This Kselftest fixes update for Linux 6.0-rc3 consists of fixes
and warnings to vm and sgx test builds.
sgx test fails to build without this change on new distros.
diff is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit 568035b01cfb107af8d2e4bd2fb9aea22cf5b868:
Linux 6.0-rc1 (2022-08-14 15:50:18 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-fixes-6.0-rc3
for you to fetch changes up to bdbf0617bbc3641af158d1aeffeebb1505f76263:
selftests/vm: fix inability to build any vm tests (2022-08-19 17:57:20 -0600)
----------------------------------------------------------------
linux-kselftest-fixes-6.0-rc3
This Kselftest fixes update for Linux 6.0-rc3 consists of fixes
and warnings to vm and sgx test builds.
----------------------------------------------------------------
Axel Rasmussen (1):
selftests/vm: fix inability to build any vm tests
Kristen Carlson Accardi (1):
selftests/sgx: Ignore OpenSSL 3.0 deprecated functions warning
tools/testing/selftests/lib.mk | 1 +
tools/testing/selftests/sgx/sigstruct.c | 6 ++++++
2 files changed, 7 insertions(+)
----------------------------------------------------------------
There are some use cases where the kernel binary is desired to be the same
for both production and testing. This poses a problem for users of KUnit
as built-in tests will automatically run at startup and test modules
can still be loaded leaving the kernel in an unsafe state. There is a
"test" taint flag that gets set if a test runs but nothing to prevent
the execution.
This patch adds the kunit.enable module parameter that will need to be
set to true in addition to KUNIT being enabled for KUnit tests to run.
The default value is true giving backwards compatibility. However, for
the production+testing use case the new config option
KUNIT_ENABLE_DEFAULT_DISABLED can be enabled to default kunit.enable to
false requiring the tester to opt-in by passing kunit.enable=1 to
the kernel.
Joe Fradley (2):
kunit: add kunit.enable to enable/disable KUnit test
kunit: no longer call module_info(test, "Y") for kunit modules
.../admin-guide/kernel-parameters.txt | 6 ++++++
include/kunit/test.h | 1 -
lib/kunit/Kconfig | 8 ++++++++
lib/kunit/test.c | 20 +++++++++++++++++++
4 files changed, 34 insertions(+), 1 deletion(-)
--
2.37.1.595.g718a3a8f04-goog