diff --git a/configs/test.fragment.E10 b/configs/test.fragment.E10 index 7240f82..1806ff6 100644 --- a/configs/test.fragment.E10 +++ b/configs/test.fragment.E10 @@ -1,8 +1,9 @@ # The test fragment for era E10, merged into every graded configuration, the reference's and rucc's alike. # -# It only turns things on. The first block is what tinyconfig lacks to reach userspace at all, the -# rest is the boot rig and the test suites, as in docs/plan/11-boot-and-tests.md. rk build merges it -# after the configuration target, runs olddefconfig, and records every request that did not take. +# It turns things on, except for the KUnit fault test. The first block is what tinyconfig lacks to +# reach userspace at all, the rest is the boot rig and the test suites, as in +# docs/plan/11-boot-and-tests.md. rk build merges it after the configuration target, runs +# olddefconfig, and records every request that did not take. # enough of a kernel to run init from an initramfs CONFIG_PRINTK=y @@ -39,6 +40,8 @@ CONFIG_9P_FS=y # test infrastructure CONFIG_KUNIT=y CONFIG_KUNIT_ALL_TESTS=m +# kunit_fault oopses on purpose, and with oops=panic that stops the run before the later suites +# CONFIG_KUNIT_FAULT_TEST is not set CONFIG_DEBUG_STACK_USAGE=y CONFIG_PRINTK_TIME=y CONFIG_PANIC_ON_OOPS=y diff --git a/configs/test.fragment.E11 b/configs/test.fragment.E11 index ebb4ba9..a721ac5 100644 --- a/configs/test.fragment.E11 +++ b/configs/test.fragment.E11 @@ -1,8 +1,9 @@ # The test fragment for era E11, merged into every graded configuration, the reference's and rucc's alike. # -# It only turns things on. The first block is what tinyconfig lacks to reach userspace at all, the -# rest is the boot rig and the test suites, as in docs/plan/11-boot-and-tests.md. rk build merges it -# after the configuration target, runs olddefconfig, and records every request that did not take. +# It turns things on, except for the KUnit fault test. The first block is what tinyconfig lacks to +# reach userspace at all, the rest is the boot rig and the test suites, as in +# docs/plan/11-boot-and-tests.md. rk build merges it after the configuration target, runs +# olddefconfig, and records every request that did not take. # enough of a kernel to run init from an initramfs CONFIG_PRINTK=y @@ -39,6 +40,8 @@ CONFIG_9P_FS=y # test infrastructure CONFIG_KUNIT=y CONFIG_KUNIT_ALL_TESTS=m +# kunit_fault oopses on purpose, and with oops=panic that stops the run before the later suites +# CONFIG_KUNIT_FAULT_TEST is not set CONFIG_DEBUG_STACK_USAGE=y CONFIG_PRINTK_TIME=y CONFIG_PANIC_ON_OOPS=y diff --git a/configs/test.fragment.E8 b/configs/test.fragment.E8 index 0ded055..043ac92 100644 --- a/configs/test.fragment.E8 +++ b/configs/test.fragment.E8 @@ -1,8 +1,9 @@ # The test fragment for era E8, merged into every graded configuration, the reference's and rucc's alike. # -# It only turns things on. The first block is what tinyconfig lacks to reach userspace at all, the -# rest is the boot rig and the test suites, as in docs/plan/11-boot-and-tests.md. rk build merges it -# after the configuration target, runs olddefconfig, and records every request that did not take. +# It turns things on, except for the KUnit fault test. The first block is what tinyconfig lacks to +# reach userspace at all, the rest is the boot rig and the test suites, as in +# docs/plan/11-boot-and-tests.md. rk build merges it after the configuration target, runs +# olddefconfig, and records every request that did not take. # enough of a kernel to run init from an initramfs CONFIG_PRINTK=y @@ -39,6 +40,8 @@ CONFIG_9P_FS=y # test infrastructure CONFIG_KUNIT=y CONFIG_KUNIT_ALL_TESTS=m +# kunit_fault oopses on purpose, and with oops=panic that stops the run before the later suites +# CONFIG_KUNIT_FAULT_TEST is not set CONFIG_DEBUG_STACK_USAGE=y CONFIG_PRINTK_TIME=y CONFIG_PANIC_ON_OOPS=y diff --git a/configs/test.fragment.E9 b/configs/test.fragment.E9 index 2077d3f..96a1628 100644 --- a/configs/test.fragment.E9 +++ b/configs/test.fragment.E9 @@ -1,8 +1,9 @@ # The test fragment for era E9, merged into every graded configuration, the reference's and rucc's alike. # -# It only turns things on. The first block is what tinyconfig lacks to reach userspace at all, the -# rest is the boot rig and the test suites, as in docs/plan/11-boot-and-tests.md. rk build merges it -# after the configuration target, runs olddefconfig, and records every request that did not take. +# It turns things on, except for the KUnit fault test. The first block is what tinyconfig lacks to +# reach userspace at all, the rest is the boot rig and the test suites, as in +# docs/plan/11-boot-and-tests.md. rk build merges it after the configuration target, runs +# olddefconfig, and records every request that did not take. # enough of a kernel to run init from an initramfs CONFIG_PRINTK=y @@ -39,6 +40,8 @@ CONFIG_9P_FS=y # test infrastructure CONFIG_KUNIT=y CONFIG_KUNIT_ALL_TESTS=m +# kunit_fault oopses on purpose, and with oops=panic that stops the run before the later suites +# CONFIG_KUNIT_FAULT_TEST is not set CONFIG_DEBUG_STACK_USAGE=y CONFIG_PRINTK_TIME=y CONFIG_PANIC_ON_OOPS=y diff --git a/crates/rk/src/kconfig.rs b/crates/rk/src/kconfig.rs index 958308b..3a3b467 100644 --- a/crates/rk/src/kconfig.rs +++ b/crates/rk/src/kconfig.rs @@ -371,6 +371,10 @@ CONFIG_GCC_VERSION=140200 ); let text = std::fs::read_to_string(&path).unwrap(); assert!(parse_fragment(&text).len() > 20, "{path}"); + assert!( + parse_fragment(&text).contains(&("KUNIT_FAULT_TEST".to_string(), "n".to_string())), + "{path}" + ); } } diff --git a/docs/plan/11-boot-and-tests.md b/docs/plan/11-boot-and-tests.md index cf44700..517b5a1 100644 --- a/docs/plan/11-boot-and-tests.md +++ b/docs/plan/11-boot-and-tests.md @@ -4,7 +4,7 @@ A kernel build that links proves little. This document defines the boot rig, the ## 11.1 The test fragment -`rucc-kernel/configs/test.fragment` is merged into every graded configuration. It only turns things on (02.1), and its contents are fixed per era. The fragment for E10 and E11: +`rucc-kernel/configs/test.fragment` is merged into every graded configuration. It only turns things on (02.1), with one exception given below, and its contents are fixed per era. The fragment for E10 and E11: ``` # console and init @@ -32,6 +32,7 @@ CONFIG_9P_FS=y # test infrastructure CONFIG_KUNIT=y CONFIG_KUNIT_ALL_TESTS=m # built as modules, loaded by rk-init +# CONFIG_KUNIT_FAULT_TEST is not set # oopses on purpose CONFIG_DEBUG_STACK_USAGE=y # 02.5 stack high water mark CONFIG_PRINTK_TIME=y CONFIG_PANIC_ON_OOPS=y @@ -44,6 +45,7 @@ CONFIG_PARAVIRT=y Notes: - **`KUNIT_ALL_TESTS=m` builds every KUnit suite the configuration allows.** It is legal because it only turns things on, and it is the largest single source of tests. It also means `defconfig` plus the fragment compiles a few hundred more units than `defconfig`, which we want. - **`PANIC_ON_OOPS` makes an oops end the run** with a clear marker rather than a hang. +- **`KUNIT_FAULT_TEST` is off.** Its `kunit_fault` suite dereferences NULL on purpose to show that KUnit survives a fault. With `PANIC_ON_OOPS` that oops ends the run, and every suite after it does not run. Some kernels, such as 6.12, turn it on by default. It is off for both builds, so it is fair. - **`CONFIG_PVH` and `HYPERVISOR_GUEST`** are for 09.6's direct boot. They are on for both builds, so they are fair. - **Older eras' fragments** drop what does not exist: - KUnit before 5.5;