setuid01: use TST_EXP_PASS() macro, docparse comment and reword
PATCH 1/1 setuid01: use TST_EXP_PASS() macro, docparse comment and reword
Signed-off-by Avinesh Kumar <[email protected]>
--- testcases/kernel/syscalls/setuid/setuid01.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)
testcases/kernel/syscalls/setuid/setuid01.c +6 -10
@@ -3,10 +3,11 @@* Copyright (c) International Business Machines Corp., 2001 */ -/* DESCRIPTION -* This test will verify that setuid(2) syscall basic functionality. -* setuid(2) returns a value of 0 and uid has been set successfully -* as a normal or super user. +/* +* [Description] +* +* Verify that setuid(2) returns 0 and effective uid has +* been set successfully as a normal or super user. */ #include <errno.h>
@@ -19,15 +20,10 @@ static void verify_setuid(void) {uid_t uid; -/* Set the effective user ID to the current real uid */ uid =getuid ();UID16_CHECK (uid, setuid); -TEST (SETUID (uid)); -if (TST_RET ==-1 ) -tst_res (TFAIL |TTERRNO ,"setuid(%d) failed" , uid); -else -tst_res (TPASS ,"setuid(%d) successfully" , uid); +TST_EXP_PASS (SETUID (uid),"setuid(%d)" , uid); }static struct tst_test test = {
Signature · 5 lines
2.36.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Avinesh,
testcases/kernel/syscalls/setuid/setuid01.c line 6
Quoted 5 lines
testcases/kernel/syscalls/setuid/setuid01.c +1
-4-/* DESCRIPTION -* This test will verify that setuid(2) syscall basic functionality. -* setuid(2) returns a value of 0 and uid has been set successfully -* as a normal or super user. +/*
This is wrong, it must be '/*\'. I guess we need to add support for this into make check.
I fixed it, updated copyright and merged.
Thanks!
Kind regards,
Petr
Quoted 5 lines
+ * [Description]
+ *
+ * Verify that setuid(2) returns 0 and effective uid has
+ * been set successfully as a normal or super user. */
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp