blob: 1e241090d242f14879f380776c5ff247addecc88 [file] [log] [blame]
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Joe Fradley <joefradley@google.com>
Date: Wed, 4 May 2022 23:00:45 +0000
Subject: ANDROID: GKI: Disable KUnit built-in testing
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Permanently disable running built-in KUnit tests.
Squash:
ANDROID: GKI: Add kunit.enable module parameter
Bug: 231160059
Bug: 231160619
Signed-off-by: Joe Fradley <joefradley@google.com>
Change-Id: Ic0610b14b8b84fbedbe5ae813555f0856941e1a3
Signed-off-by: Lee Jones <joneslee@google.com>
---
Documentation/admin-guide/kernel-parameters.txt | 2 +-
Documentation/dev-tools/kunit/index.rst | 9 +++++++++
init/main.c | 4 ----
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -2537,7 +2537,7 @@
CONFIG_KUNIT to be set to be fully enabled. The
default value can be overridden via
KUNIT_DEFAULT_ENABLED.
- Default is 1 (enabled)
+ Default is 0 (disabled)
kvm.ignore_msrs=[KVM] Ignore guest accesses to unhandled MSRs.
Default is 0 (don't ignore, but inject #GP)
diff --git a/Documentation/dev-tools/kunit/index.rst b/Documentation/dev-tools/kunit/index.rst
--- a/Documentation/dev-tools/kunit/index.rst
+++ b/Documentation/dev-tools/kunit/index.rst
@@ -18,6 +18,15 @@ KUnit - Linux Kernel Unit Testing
faq
running_tips
+.. warning::
+ AOSP only supports running tests loaded with modules. Built-in
+ test execution support has been disabled. In addition, in order
+ to fully enable running module loaded tests both CONFIG_KUNIT
+ needs to be enabled and kernel command line argument
+ `kunit.enable` needs to be set to 1.
+
+ The remaining KUnit documentation has been left as-is.
+
This section details the kernel unit testing framework.
Introduction
diff --git a/init/main.c b/init/main.c
--- a/init/main.c
+++ b/init/main.c
@@ -109,8 +109,6 @@
#define CREATE_TRACE_POINTS
#include <trace/events/initcall.h>
-#include <kunit/test.h>
-
static int kernel_init(void *);
/*
@@ -1550,8 +1548,6 @@ static noinline void __init kernel_init_freeable(void)
do_basic_setup();
- kunit_run_all_tests();
-
wait_for_initramfs();
console_on_rootfs();