[PATCH v1] selftests: ipc: Updates the msgque test to use kselftest framework

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Updates the msgque test to print the pass or fail status after the
completion of the test.

Signed-off-by: Atul Kumar Pant <atulpant.linux@xxxxxxxxx>
---
 tools/testing/selftests/ipc/msgque.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/testing/selftests/ipc/msgque.c b/tools/testing/selftests/ipc/msgque.c
index 656c43c24044..513b1265bb75 100644
--- a/tools/testing/selftests/ipc/msgque.c
+++ b/tools/testing/selftests/ipc/msgque.c
@@ -9,6 +9,7 @@
 
 #include "../kselftest.h"
 
+#define NUM_TEST_CASES		1
 #define MAX_MSG_SIZE		32
 
 struct msg1 {
@@ -197,6 +198,7 @@ int main(int argc, char **argv)
 	int msg, pid, err;
 	struct msgque_data msgque;
 
+	ksft_set_plan(NUM_TEST_CASES);
 	if (getuid() != 0)
 		return ksft_exit_skip(
 				"Please run the test as root - Exiting.\n");
@@ -243,13 +245,16 @@ int main(int argc, char **argv)
 		printf("Failed to test queue: %d\n", err);
 		goto err_out;
 	}
+	ksft_test_result_pass("# Test Passed\n");
 	return ksft_exit_pass();
 
 err_destroy:
 	if (msgctl(msgque.msq_id, IPC_RMID, NULL)) {
 		printf("Failed to destroy queue: %d\n", -errno);
+		ksft_test_result_fail("# Test Failed\n");
 		return ksft_exit_fail();
 	}
 err_out:
+	ksft_test_result_fail("# Test Failed\n");
 	return ksft_exit_fail();
 }
-- 
2.25.1




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux