From a53bb4b36b92eb70b29e8f49dc4a2b8ecac54581 Mon Sep 17 00:00:00 2001 From: Yongqin Liu Date: Thu, 14 Nov 2024 23:05:57 +0800 Subject: [PATCH] ANDROID: Update kunit README on test_dir it needs to be specified for the kernel/tests/tools/run_test_only.sh script for most of the cases, since the switch to the pkg_install method for the build and install of kunit test modules. Fixes: fe0f4e33f69f ("ANDROID: Add kunit installation rules") Change-Id: Ib4fbfa983ef29342119fe2ff3e939e4b8c116d49 Signed-off-by: Yongqin Liu --- tools/testing/kunit/android/README | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/testing/kunit/android/README b/tools/testing/kunit/android/README index 2b5e2ccde24e..6e6239a3e0a4 100644 --- a/tools/testing/kunit/android/README +++ b/tools/testing/kunit/android/README @@ -6,7 +6,10 @@ Prerequisites "no trim" kernel (e.g. add `--notrim` to bazel build command). Run tests on a physical or virtual device: - $ kernel/tests/tools/run_test_only.sh -t kunit -s + $ kernel/tests/tools/run_test_only.sh -t kunit -s -td + + test_dir is the same directory as specified when running: + $ tools/bazel run //common:kunit_tests_arm64 -- -v --destdir Before the tests, you can use the following command to launch a virtual device: $ kernel/tests/tools/launch_cvd.sh @@ -37,6 +40,10 @@ Load and run a test module on Android device manually $ cd /data $ insmod kunit.ko enable=1 + If the kunit.ko has been installed already but without enable=1 passed, + it needs to remove it first via the rmmod command, and install again + via the insmod command + * Push the KUnit test module over to the device. For example using adb: $ adb push kunit-example-test.ko /data @@ -75,7 +82,10 @@ View test results Run KUnit tests on Android Device via test automation infrastructure tradefed * Build ACK KUnit tests and install (e.g. /tmp/kunit_tests): - $ tools/bazel run -- //common:kunit_tests_x86_64 -v --destdir /tmp/kunit_tests + $ tools/bazel run -- //common:kunit_tests_x86_64 -v --destdir /tmp/kunit_tests + Or + $ tools/bazel run -- //common:kunit_tests_arm64 -v --destdir /tmp/kunit_tests + * With device connected and accessible via adb run the tests: $ prebuilts/tradefed/filegroups/tradefed/tradefed.sh run commandAndExit \