Skip to contentSkip to conversation

syscalls/chown03.c: Remove the redundant pass information

PATCH New Jinhui Huang 2 participants 3 messages Apr 28, 2021 – Apr 29, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 syscalls/chown03.c: Remove the redundant pass information

When executing testcase chown03_16, the system will report pass information
even if 16-bit version of chown() is not supported, for example:
--------------------------------------------------------------------------
tst_test.c:1313: TINFO: Timeout per run is 0h 05m 00s
chown03.c:48: TPASS: chown03_testfile: expected owner set to (uid=99, gid=0)
chown03.c:58: TPASS: chown03_testfile: expected mode permissions 0106770 /root/ltp/testcases/kernel/syscalls/chown/../utils/compat_tst_16.h:153: TCONF: 16-bit version of chown() is not supported on your platform

Summary:

passed   2
failed   0
broken   0
skipped  1

warnings 0
--------------------------------------------------------------------------

The redundant pass information may mislead testers, so we should remove them.

---
 testcases/kernel/syscalls/chown/chown03.c | 6 ------
 1 file changed, 6 deletions(-)
testcases/kernel/syscalls/chown/chown03.c +0 -6
index 8ff2602..ff6e904 100644
@@ -43,9 +43,6 @@ static void check_owner(struct stat *s, uid_t exp_uid, gid_t exp_gid)
 		tst_res(TFAIL, "%s: wrong owner set to (uid=%d, gid=%d),"
 			       " expected (uid=%d, gid=%d)",
 			FILENAME, s->st_uid, s->st_gid, exp_uid, exp_gid);
-	else
-		tst_res(TPASS, "%s: expected owner set to (uid=%d, gid=%d)",
-			FILENAME, exp_uid, exp_gid);
 }
 
 static void check_mode(struct stat *s, mode_t exp_mode)
@@ -53,9 +50,6 @@ static void check_mode(struct stat *s, mode_t exp_mode)
 	if (s->st_mode != exp_mode)
 	      tst_res(TFAIL, "%s: wrong mode permissions %#o, expected %#o",
 		      FILENAME, s->st_mode, exp_mode);
-	else
-	      tst_res(TPASS, "%s: expected mode permissions %#o",
-		      FILENAME, s->st_mode);
 }
 
 static void run(void)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 syscalls/chown03.c: Remove the redundant pass information

Hi Jinhui

Sound reasonable,

Best Regards
Yang Xu

Quoted 47 lines

When executing testcase chown03_16, the system will report pass information
even if 16-bit version of chown() is not supported, for example:
--------------------------------------------------------------------------
tst_test.c:1313: TINFO: Timeout per run is 0h 05m 00s
chown03.c:48: TPASS: chown03_testfile: expected owner set to (uid=99, gid=0)
chown03.c:58: TPASS: chown03_testfile: expected mode permissions 0106770 /root/ltp/testcases/kernel/syscalls/chown/../utils/compat_tst_16.h:153: TCONF: 16-bit version of chown() is not supported on your platform

Summary:

passed   2
failed   0
broken   0
skipped  1

warnings 0
--------------------------------------------------------------------------

The redundant pass information may mislead testers, so we should remove them.

---
  testcases/kernel/syscalls/chown/chown03.c | 6 ------
  1 file changed, 6 deletions(-)
testcases/kernel/syscalls/chown/chown03.c +0 -6
index 8ff2602..ff6e904 100644
@@ -43,9 +43,6 @@ static void check_owner(struct stat *s, uid_t exp_uid, gid_t exp_gid)
  		tst_res(TFAIL, "%s: wrong owner set to (uid=%d, gid=%d),"
  			       " expected (uid=%d, gid=%d)",
  			FILENAME, s->st_uid, s->st_gid, exp_uid, exp_gid);
-	else
-		tst_res(TPASS, "%s: expected owner set to (uid=%d, gid=%d)",
-			FILENAME, exp_uid, exp_gid);
  }
 
  static void check_mode(struct stat *s, mode_t exp_mode)
@@ -53,9 +50,6 @@ static void check_mode(struct stat *s, mode_t exp_mode)
  	if (s->st_mode != exp_mode)
  	      tst_res(TFAIL, "%s: wrong mode permissions %#o, expected %#o",
  		      FILENAME, s->st_mode, exp_mode);
-	else
-	      tst_res(TPASS, "%s: expected mode permissions %#o",
-		      FILENAME, s->st_mode);
  }
 
  static void run(void)
#2 lore raw

PATCH 1/1 syscalls/chown03.c: Remove the redundant pass information

Hi Jinhui
Thanks, merged!

Best Regards
Yang Xu

Quoted 55 lines

Hi Jinhui

Sound reasonable,

Best Regards
Yang Xu

Quoted 47 lines

When executing testcase chown03_16, the system will report pass information
even if 16-bit version of chown() is not supported, for example:
--------------------------------------------------------------------------
tst_test.c:1313: TINFO: Timeout per run is 0h 05m 00s
chown03.c:48: TPASS: chown03_testfile: expected owner set to (uid=99, gid=0)
chown03.c:58: TPASS: chown03_testfile: expected mode permissions 0106770 /root/ltp/testcases/kernel/syscalls/chown/../utils/compat_tst_16.h:153: TCONF: 16-bit version of chown() is not supported on your platform

Summary:

passed   2
failed   0
broken   0
skipped  1

warnings 0
--------------------------------------------------------------------------

The redundant pass information may mislead testers, so we should remove them.

---
   testcases/kernel/syscalls/chown/chown03.c | 6 ------
   1 file changed, 6 deletions(-)
testcases/kernel/syscalls/chown/chown03.c +0 -6
index 8ff2602..ff6e904 100644
@@ -43,9 +43,6 @@ static void check_owner(struct stat *s, uid_t exp_uid, gid_t exp_gid)
   		tst_res(TFAIL, "%s: wrong owner set to (uid=%d, gid=%d),"
   			       " expected (uid=%d, gid=%d)",
   			FILENAME, s->st_uid, s->st_gid, exp_uid, exp_gid);
-	else
-		tst_res(TPASS, "%s: expected owner set to (uid=%d, gid=%d)",
-			FILENAME, exp_uid, exp_gid);
   }
 
   static void check_mode(struct stat *s, mode_t exp_mode)
@@ -53,9 +50,6 @@ static void check_mode(struct stat *s, mode_t exp_mode)
   	if (s->st_mode != exp_mode)
   	      tst_res(TFAIL, "%s: wrong mode permissions %#o, expected %#o",
   		      FILENAME, s->st_mode, exp_mode);
-	else
-	      tst_res(TPASS, "%s: expected mode permissions %#o",
-		      FILENAME, s->st_mode);
   }
 
   static void run(void)