diff mbox series

[v2,3/4] kselftests: vdso: vdso_test_getcpu: conform test to TAP output

Message ID 20240610054129.1527389-4-usama.anjum@collabora.com (mailing list archive)
State New
Headers show
Series kselftests: vdso: conform tests to TAP output | expand

Commit Message

Muhammad Usama Anjum June 10, 2024, 5:41 a.m. UTC
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@collabora.com>
---
 tools/testing/selftests/vDSO/vdso_test_getcpu.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
diff mbox series

Patch

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();
 }