diff mbox series

[1/3] umount01: Simplify test using TST_ macros

Message ID 1697100058-2859-1-git-send-email-xuyang2018.jy@fujitsu.com
State Changes Requested
Headers show
Series [1/3] umount01: Simplify test using TST_ macros | expand

Commit Message

Yang Xu \(Fujitsu\) Oct. 12, 2023, 8:40 a.m. UTC
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 testcases/kernel/syscalls/umount/umount01.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Comments

Yang Xu \(Fujitsu\) Oct. 20, 2023, 9:49 a.m. UTC | #1
Hi

Ping!


Best Regards,

Yang Xu

> Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
> ---
>   testcases/kernel/syscalls/umount/umount01.c | 9 ++-------
>   1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/umount/umount01.c b/testcases/kernel/syscalls/umount/umount01.c
> index d05296dce..2950300a7 100644
> --- a/testcases/kernel/syscalls/umount/umount01.c
> +++ b/testcases/kernel/syscalls/umount/umount01.c
> @@ -1,6 +1,7 @@
>   // SPDX-License-Identifier: GPL-2.0-or-later
>   /*
>    * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
> + * Copyright (c) Linux Test Project, 2003-2023
>    * Author: Nirmala Devi Dhanasekar <nirmala.devi@wipro.com>
>    *
>    * Phase I test for the umount(2) system call.
> @@ -23,7 +24,7 @@ static void verify_umount(void)
>   		mount_flag = 1;
>   	}
>   
> -	TEST(umount(MNTPOINT));
> +	TST_EXP_PASS(umount(MNTPOINT), "umount(%s)", MNTPOINT);
>   
>   	if (TST_RET != 0 && TST_ERR == EBUSY) {
>   		tst_res(TINFO, "umount() Failed with EBUSY "
> @@ -31,12 +32,6 @@ static void verify_umount(void)
>   			"is probing newly mounted dirs");
>   	}
>   
> -	if (TST_RET != 0) {
> -		tst_res(TFAIL | TTERRNO, "umount() Failed");
> -		return;
> -	}
> -
> -	tst_res(TPASS, "umount() Passed");
>   	mount_flag = 0;
>   }
>
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/umount/umount01.c b/testcases/kernel/syscalls/umount/umount01.c
index d05296dce..2950300a7 100644
--- a/testcases/kernel/syscalls/umount/umount01.c
+++ b/testcases/kernel/syscalls/umount/umount01.c
@@ -1,6 +1,7 @@ 
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
+ * Copyright (c) Linux Test Project, 2003-2023
  * Author: Nirmala Devi Dhanasekar <nirmala.devi@wipro.com>
  *
  * Phase I test for the umount(2) system call.
@@ -23,7 +24,7 @@  static void verify_umount(void)
 		mount_flag = 1;
 	}
 
-	TEST(umount(MNTPOINT));
+	TST_EXP_PASS(umount(MNTPOINT), "umount(%s)", MNTPOINT);
 
 	if (TST_RET != 0 && TST_ERR == EBUSY) {
 		tst_res(TINFO, "umount() Failed with EBUSY "
@@ -31,12 +32,6 @@  static void verify_umount(void)
 			"is probing newly mounted dirs");
 	}
 
-	if (TST_RET != 0) {
-		tst_res(TFAIL | TTERRNO, "umount() Failed");
-		return;
-	}
-
-	tst_res(TPASS, "umount() Passed");
 	mount_flag = 0;
 }