[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240529072454.2522495-4-usama.anjum@collabora.com>
Date: Wed, 29 May 2024 12:24:53 +0500
From: Muhammad Usama Anjum <usama.anjum@...labora.com>
To: Shuah Khan <shuah@...nel.org>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Muhammad Usama Anjum <usama.anjum@...labora.com>,
Colin Ian King <colin.i.king@...il.com>,
Tiezhu Yang <yangtiezhu@...ngson.cn>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: kernel@...labora.com
Subject: [PATCH 3/4] kselftests: vdso: vdso_test_getcpu: conform test to TAP output
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum <usama.anjum@...labora.com>
---
tools/testing/selftests/vDSO/vdso_test_getcpu.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/tools/testing/selftests/vDSO/vdso_test_getcpu.c b/tools/testing/selftests/vDSO/vdso_test_getcpu.c
index b758f68c6c9c2..d8e247783057a 100644
--- a/tools/testing/selftests/vDSO/vdso_test_getcpu.c
+++ b/tools/testing/selftests/vDSO/vdso_test_getcpu.c
@@ -28,9 +28,12 @@ int main(int argc, char **argv)
getcpu_t get_cpu;
long ret;
+ ksft_print_header();
+ ksft_set_plan(1);
+
sysinfo_ehdr = getauxval(AT_SYSINFO_EHDR);
if (!sysinfo_ehdr) {
- printf("AT_SYSINFO_EHDR is not present!\n");
+ ksft_print_msg("AT_SYSINFO_EHDR is not present!\n");
return KSFT_SKIP;
}
@@ -38,17 +41,12 @@ int main(int argc, char **argv)
get_cpu = (getcpu_t)vdso_sym(version, name[4]);
if (!get_cpu) {
- printf("Could not find %s\n", name[4]);
+ ksft_print_msg("Could not find %s\n", name[4]);
return KSFT_SKIP;
}
ret = get_cpu(&cpu, &node, 0);
- if (ret == 0) {
- printf("Running on CPU %u node %u\n", cpu, node);
- } else {
- printf("%s failed\n", name[4]);
- return KSFT_FAIL;
- }
+ ksft_test_result(ret == 0, "Running on CPU %u node %u\n", cpu, node);
- return 0;
+ ksft_finished();
}
--
2.39.2
Powered by blists - more mailing lists