From a4e17a8f239a545c463f8ec27db4ed6e74b31841 Mon Sep 17 00:00:00 2001 From: "Ricardo B. Marliere" Date: Thu, 5 Dec 2024 17:50:35 -0300 Subject: ktest.pl: Check kernelrelease return in get_version In the case of a test that uses the special option ${KERNEL_VERSION} in one of its settings but has no configuration available in ${OUTPUT_DIR}, for example if it's a new empty directory, then the `make kernelrelease` call will fail and the subroutine will chomp an empty string, silently. Fix that by adding an empty configuration and retrying. Cc: stable@vger.kernel.org Cc: John Hawley Fixes: 5f9b6ced04a4e ("ktest: Bisecting, install modules, add logging") Link: https://lore.kernel.org/20241205-ktest_kver_fallback-v2-1-869dae4c7777@suse.com Signed-off-by: Ricardo B. Marliere Signed-off-by: Steven Rostedt --- tools/testing/ktest/ktest.pl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tools/testing/ktest') diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index dacad94e2be4..171262915636 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -2419,6 +2419,11 @@ sub get_version { return if ($have_version); doprint "$make kernelrelease ... "; $version = `$make -s kernelrelease | tail -1`; + if (!length($version)) { + run_command "$make allnoconfig" or return 0; + doprint "$make kernelrelease ... "; + $version = `$make -s kernelrelease | tail -1`; + } chomp($version); doprint "$version\n"; $have_version = 1; -- cgit v1.2.3 From 776735b954f49f85fd19e1198efa421fae2ad77c Mon Sep 17 00:00:00 2001 From: Ba Jing Date: Mon, 2 Sep 2024 21:07:35 +0800 Subject: ktest.pl: Remove unused declarations in run_bisect_test function Since $output and $ret are not used in the subsequent code, the declarations should be removed. Fixes: a75fececff3c ("ktest: Added sample.conf, new %default option format") Link: https://lore.kernel.org/20240902130735.6034-1-bajing@cmss.chinamobile.com Signed-off-by: Ba Jing Signed-off-by: Steven Rostedt --- tools/testing/ktest/ktest.pl | 2 -- 1 file changed, 2 deletions(-) (limited to 'tools/testing/ktest') diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 171262915636..c76ad0be54e2 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -2965,8 +2965,6 @@ sub run_bisect_test { my $failed = 0; my $result; - my $output; - my $ret; $in_bisect = 1; -- cgit v1.2.3 From 770221a36932a65c5a8b7711b5477430a1dbf5e8 Mon Sep 17 00:00:00 2001 From: Ba Jing Date: Mon, 2 Sep 2024 20:46:45 +0800 Subject: ktest.pl: Fix typo in comment "on of these" should be "one of these". Fixes: 77d942ceacbad ("ktest: Create variables for the ktest config files") Link: https://lore.kernel.org/20240902124645.5674-1-bajing@cmss.chinamobile.com Signed-off-by: Ba Jing Signed-off-by: Steven Rostedt --- tools/testing/ktest/ktest.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/testing/ktest') diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index c76ad0be54e2..8c8da966c641 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -1245,7 +1245,7 @@ sub __read_config { # Config variables are only active while reading the # config and can be defined anywhere. They also ignore # TEST_START and DEFAULTS, but are skipped if they are in - # on of these sections that have SKIP defined. + # one of these sections that have SKIP defined. # The save variable can be # defined multiple times and the new one simply overrides # the previous one. -- cgit v1.2.3 From f3a30016e4b557495d49df7851f18ad97b6d5a23 Mon Sep 17 00:00:00 2001 From: WangYuli Date: Wed, 18 Dec 2024 22:04:37 +0800 Subject: ktest.pl: Fix typo "accesing" There is a spelling mistake of 'accesing' in comments which should be 'accessing'. Fixes: 6d76f469c8ac9 ("ktest: Add useful example configs") Link: https://lore.kernel.org/8714AE3735C0EA0B+20241218140437.194906-1-wangyuli@uniontech.com Reviewed-by: SeongJae Park Signed-off-by: WangYuli Signed-off-by: Steven Rostedt --- tools/testing/ktest/examples/include/defaults.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/testing/ktest') diff --git a/tools/testing/ktest/examples/include/defaults.conf b/tools/testing/ktest/examples/include/defaults.conf index 63a1a83f4f0b..f6d8517a471e 100644 --- a/tools/testing/ktest/examples/include/defaults.conf +++ b/tools/testing/ktest/examples/include/defaults.conf @@ -46,7 +46,7 @@ CLEAR_LOG = 1 SSH_USER = root -# For accesing the machine, we will ssh to root@machine. +# For accessing the machine, we will ssh to root@machine. SSH := ssh ${SSH_USER}@${MACHINE} # Update this. The default here is ktest will ssh to the target box -- cgit v1.2.3