Commit Graph

17 Commits

Author SHA1 Message Date
Yongqin Liu
a53bb4b36b 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: fe0f4e33f6 ("ANDROID: Add kunit installation rules")
Change-Id: Ib4fbfa983ef29342119fe2ff3e939e4b8c116d49
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
2024-11-19 22:04:30 +00:00
Yongqin Liu
eaa8ddfc60 ANDROID: Update kunit README with correct kunit-example-test.ko name
The name in the kernel source is kunit-example-test,
there is no kunit-test-example defined

Fixes: df08ef1044 ("ANDROID: Add Android KUnit README")
Change-Id: I20b89b5c11ede45ef1b758c722b8bfca13e9c782
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
2024-11-14 21:40:25 +08:00
Cheng-Cheng Lo
3f5d5cb2c6 ANDROID: use INDIVIDUAL_LEAVES for kunit parser resolution
Bug: 371482271
Test: presubmit
Change-Id: I8981499a97c43caa50626872399a02ecb693ff19
Signed-off-by: Cheng-Cheng Lo <locc@google.com>
2024-11-06 17:44:04 +00:00
Cheng-Cheng Lo
712b8abf42 ANDROID: use INDIVIDUAL_LEAVES for kunit parser resolution
Bug: 371482271
Test: presubmit
Change-Id: Id3d03a9ed3d3207f1f710ac6dec17cd7f5445709
Signed-off-by: Cheng-Cheng Lo <locc@google.com>
2024-11-05 20:45:05 +00:00
Hsin-Yi Chen
3fdb51797f ANDROID: Update README about kunit and selftest
Test: kernel/tests/tools/run_test_only.sh \
      -t 'kunit soc-utils-test' -s 127.0.0.1:6520
Bug: 355559072
Change-Id: I256855673cbe0ec1ea02d213d9c35c49e2d8e21b
Signed-off-by: Hsin-Yi Chen <hsinyichen@google.com>
2024-10-30 20:42:50 +00:00
Hsin-Yi Chen
6c455c44f0 ANDROID: Check arch before running kunit
KUnit configurations include KernelTestModuleController that skips the
tests for mismatching architectures.

Test: ./run_test_only.sh --gcov -s 0.0.0.0:6520 -t \
      'kunit soc-utils-test#soc-utils'
Bug: 358439710
Change-Id: I5b1daee4329c9b9cf1d534d0ea88b41d76cfa7bc
Signed-off-by: Hsin-Yi Chen <hsinyichen@google.com>
2024-10-25 05:31:35 +00:00
Cheng-Cheng Lo
6273e1489e ANDROID: install KUnit tests dependencies and enable regmap-kunit.
Some KUnit tests require specific kernel modules to be installed. For example, regmap-kunit depends on regmap-ram and regmap-raw-ram.

Bug: 361411967
Test: abtd
Change-Id: I6e6862492c28e5dd3466a71cca713f1c44737fcd
Signed-off-by: Cheng-Cheng Lo <locc@google.com>
2024-10-03 00:30:49 +00:00
Betty Zhou
2dd00822d4 ANDROID: Shorten the length of line in kunit/android/README.
Test: none
Bug: 345309292
Signed-off-by: Betty Zhou <bettyzhou@google.com>
Change-Id: I4343627fb770e9ca0b2a2cb3c292fde3f8ca5980
2024-09-09 22:35:44 +00:00
Betty Zhou
1d249e2f64 ANDROID: Update kunit README with guide on rmmod lsmod.
Change-Id: I73c3ffc55494ec6b15c74da86d2589a1fe91f530
Signed-off-by: Betty Zhou <bettyzhou@google.com>
Bug: 345309292
2024-08-26 21:50:35 +00:00
Betty Zhou
cb6fcbe17c ANDROID: Update README with CONFIG_KUNT=m approach.
Test: local tests
Bug: 345309292
Change-Id: I609800e40b40609b5d0c2f6a91a4bb9a00bbdb7a
Signed-off-by: Betty Zhou <bettyzhou@google.com>
2024-07-30 16:37:28 -07:00
Betty Zhou
cf4978e5d2 ANDROID: Build GKI with CONFIG_KUNIT=m
Update KUnit build rules and configs to build and load kunit.ko before
testing.

Bug: 345309292
Change-Id: Ifde4e51a97214159bcbc1c6ee81b96765d57f21c
Signed-off-by: Betty Zhou <bettyzhou@google.com>
2024-07-29 16:47:56 +00:00
Joe Fradley
fe0f4e33f6 ANDROID: Add kunit installation rules
Use pkg_install to create installation rules for kunit test modules. To
build and install kunit test modules into /tmp/kunit_tests directory run:

$ tools/bazel run -- //common:kunit_tests_x86_64_dist -v \
    --destdir /tmp/kunit_tests

Also updated the kunit Android README to use this rule instead of
creating tests.zip and unzipping it.

Bug: 324907235

Change-Id: I1e611cf8cc2836cb213526aa270da6fd422f7352
Signed-off-by: Joe Fradley <joefradley@google.com>
2024-04-05 09:14:07 -07:00
Joe Fradley
d279e8dfa7 ANDROID: Disable arm64 clk KUnit tests.
clk-gate_test.ko and clk_test.ko cause kernel panics when run and cannot
be currently used with tradefed.

Bug: 324958636
Change-Id: Idb06806d6f92cdde4d6bc4dfafb59480987490e9
Signed-off-by: Joe Fradley <joefradley@google.com>
2024-02-15 12:39:40 -08:00
Joe Fradley
df08ef1044 ANDROID: Add Android KUnit README
Document how to run a KUnit test module and how to run the ACK KUnit
tests via tradefed. Also, reorganized the toos/testing/kunit/android
file and directory structure slightly. This required a tweak
BUILD.bazel.

Bug: 231159463

Change-Id: I09c47d36593e839911767112176fa84bd7e25fe4
Signed-off-by: Joe Fradley <joefradley@google.com>
2024-02-12 17:30:52 -08:00
Joe Fradley
af8ff008f4 ANDROID: Add KUnit test config and packaging rules for tests.zip
Include KUnit modules and Tradefed test configuration inside
'tests.zip' alongside the kselftest tests. The zip can built via:
$ tools/bazel build //common:tests_zip_arm64

The KUnit tests can be executed on running device with matching kernel
via:
$ tradefed.sh run commandAndExit template/local_min --template:map \
    test=suite/test_mapping_suite --include-filter kunit \
    --tests-dir=<directory of zip contents>  --primary-abi-only

Example zip structure:
Archive:  bazel-bin/common/x86_64/tests.zip

testcases/kunit/kunit.config
testcases/kunit/x86_64/drivers/hid/hid-uclogic-test.ko
testcases/kunit/x86_64/drivers/iio/test/iio-test-format.ko
<truncate>
testcases/selftests/selftests.config
testcases/selftests/x86/futex_requeue
testcases/selftests/x86/futex_requeue_pi
<truncate>
testcases/selftests/x86_64/futex_requeue
testcases/selftests/x86_64/futex_requeue_pi
<truncate>

Bug: 311187098

Test build (x86_64): https://android-build.corp.google.com/builds/abtd/run/L50600030001493915
Test build (arm64): https://android-build.corp.google.com/builds/abtd/run/L76000030001501406

Change-Id: Ic53a000d9d797fc043a626d8892246d0faae2eab
Signed-off-by: Joe Fradley <joefradley@google.com>
2024-01-23 19:37:44 -08:00
Joe Fradley
d0d077eb4d Revert "ANDROID: Add packaging rules for KUnit test modules."
This reverts commit df94db3dda.

Reason for revert:
kernel_virt_debug_* build breakage

Change-Id: I5e7fe4225159e1292532b7930e8da7e2d2f413f3
Signed-off-by: Joe Fradley <joefradley@google.com>
2023-11-28 21:13:21 +00:00
Joe Fradley
df94db3dda ANDROID: Add packaging rules for KUnit test modules.
Include KUnit modules and test configuration inside `tests.zip` alongside the kselftest tests.

Bug: 311187098
Change-Id: Ic82cd8611d0761435a45c8e82c7d10a009d01a73
Signed-off-by: Joe Fradley <joefradley@google.com>
2023-11-28 19:32:54 +00:00