* [LTP] [PATCH v2 1/3] umount01: Simplify test using TST_ macros
@ 2023-10-27 9:37 Yang Xu
2023-10-27 9:38 ` [LTP] [PATCH v2 2/3] umount02: " Yang Xu
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Yang Xu @ 2023-10-27 9:37 UTC (permalink / raw)
To: ltp
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
testcases/kernel/syscalls/umount/umount01.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/testcases/kernel/syscalls/umount/umount01.c b/testcases/kernel/syscalls/umount/umount01.c
index d05296dce..47e35eaeb 100644
--- a/testcases/kernel/syscalls/umount/umount01.c
+++ b/testcases/kernel/syscalls/umount/umount01.c
@@ -7,7 +7,6 @@
* It is intended to provide a limited exposure of the system call.
*/
-#include <errno.h>
#include <sys/mount.h>
#include "tst_test.h"
@@ -23,7 +22,7 @@ static void verify_umount(void)
mount_flag = 1;
}
- TEST(umount(MNTPOINT));
+ TST_EXP_PASS(umount(MNTPOINT));
if (TST_RET != 0 && TST_ERR == EBUSY) {
tst_res(TINFO, "umount() Failed with EBUSY "
@@ -31,12 +30,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;
}
--
2.39.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread* [LTP] [PATCH v2 2/3] umount02: Simplify test using TST_ macros
2023-10-27 9:37 [LTP] [PATCH v2 1/3] umount01: Simplify test using TST_ macros Yang Xu
@ 2023-10-27 9:38 ` Yang Xu
2023-10-27 17:01 ` Petr Vorel
2023-10-27 9:38 ` [LTP] [PATCH v2 3/3] umount03: " Yang Xu
2023-10-27 17:18 ` [LTP] [PATCH v2 1/3] umount01: " Petr Vorel
2 siblings, 1 reply; 6+ messages in thread
From: Yang Xu @ 2023-10-27 9:38 UTC (permalink / raw)
To: ltp
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
testcases/kernel/syscalls/umount/umount02.c | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)
diff --git a/testcases/kernel/syscalls/umount/umount02.c b/testcases/kernel/syscalls/umount/umount02.c
index 34a38c998..4aa999014 100644
--- a/testcases/kernel/syscalls/umount/umount02.c
+++ b/testcases/kernel/syscalls/umount/umount02.c
@@ -14,8 +14,6 @@
* 5) ENAMETOOLONG if pathname was longer than MAXPATHLEN.
*/
-#include <errno.h>
-#include <string.h>
#include <sys/mount.h>
#include "tst_test.h"
@@ -41,21 +39,7 @@ static void verify_umount(unsigned int n)
{
struct tcase *tc = &tcases[n];
- TEST(umount(tc->mntpoint));
-
- if (TST_RET != -1) {
- tst_res(TFAIL, "umount() succeeds unexpectedly");
- return;
- }
-
- if (tc->exp_errno != TST_ERR) {
- tst_res(TFAIL | TTERRNO, "umount() should fail with %s",
- tst_strerrno(tc->exp_errno));
- return;
- }
-
- tst_res(TPASS | TTERRNO, "umount() fails as expected: %s",
- tc->err_desc);
+ TST_EXP_FAIL(umount(tc->mntpoint), tc->exp_errno);
}
static void setup(void)
--
2.39.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread* [LTP] [PATCH v2 3/3] umount03: Simplify test using TST_ macros
2023-10-27 9:37 [LTP] [PATCH v2 1/3] umount01: Simplify test using TST_ macros Yang Xu
2023-10-27 9:38 ` [LTP] [PATCH v2 2/3] umount02: " Yang Xu
@ 2023-10-27 9:38 ` Yang Xu
2023-10-27 17:18 ` [LTP] [PATCH v2 1/3] umount01: " Petr Vorel
2 siblings, 0 replies; 6+ messages in thread
From: Yang Xu @ 2023-10-27 9:38 UTC (permalink / raw)
To: ltp
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
testcases/kernel/syscalls/umount/umount03.c | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/testcases/kernel/syscalls/umount/umount03.c b/testcases/kernel/syscalls/umount/umount03.c
index 1cef06fa1..3dd222d9f 100644
--- a/testcases/kernel/syscalls/umount/umount03.c
+++ b/testcases/kernel/syscalls/umount/umount03.c
@@ -7,11 +7,8 @@
* is not the super-user.
*/
-#include <errno.h>
#include <pwd.h>
#include <sys/mount.h>
-#include <sys/types.h>
-#include <unistd.h>
#include "tst_test.h"
#define MNTPOINT "mntpoint"
@@ -20,19 +17,7 @@ static int mount_flag;
static void verify_umount(void)
{
- TEST(umount(MNTPOINT));
-
- if (TST_RET != -1) {
- tst_res(TFAIL, "umount() succeeds unexpectedly");
- return;
- }
-
- if (TST_ERR != EPERM) {
- tst_res(TFAIL | TTERRNO, "umount() should fail with EPERM");
- return;
- }
-
- tst_res(TPASS | TTERRNO, "umount() fails as expected");
+ TST_EXP_FAIL(umount(MNTPOINT), EPERM);
}
static void setup(void)
--
2.39.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [LTP] [PATCH v2 1/3] umount01: Simplify test using TST_ macros
2023-10-27 9:37 [LTP] [PATCH v2 1/3] umount01: Simplify test using TST_ macros Yang Xu
2023-10-27 9:38 ` [LTP] [PATCH v2 2/3] umount02: " Yang Xu
2023-10-27 9:38 ` [LTP] [PATCH v2 3/3] umount03: " Yang Xu
@ 2023-10-27 17:18 ` Petr Vorel
2023-10-27 17:26 ` Petr Vorel
2 siblings, 1 reply; 6+ messages in thread
From: Petr Vorel @ 2023-10-27 17:18 UTC (permalink / raw)
To: Yang Xu; +Cc: ltp
Hi Xu,
[ Cc Cyril, who wrote gvfsd-trash note in 10b61174c ("syscalls: umount01: Give a
hint on failure with EBUSY") ]
While this patch looks to be OK, there is a problem when run several times
(either with -i > 1 or even just repeatedly run without -i):
./umount01 -i2 # your version
tst_device.c:96: TINFO: Found free device 2 '/dev/loop2'
tst_test.c:1105: TINFO: Formatting /dev/loop2 with ext2 opts='' extra opts=''
mke2fs 1.47.0 (5-Feb-2023)
tst_test.c:1690: TINFO: LTP version: 20230929-83-g4123555e7
tst_test.c:1574: TINFO: Timeout per run is 0h 00m 30s
umount01.c:20: TINFO: Mounting /dev/loop2 to /tmp/LTP_umoxYOalA/mntpoint fstyp=ext2 flags=0
umount01.c:25: TFAIL: umount(MNTPOINT) failed: EBUSY (16)
umount01.c:28: TINFO: umount() Failed with EBUSY possibly some daemon (gvfsd-trash) is probing newly mounted dirs
umount01.c:20: TINFO: Mounting /dev/loop2 to /tmp/LTP_umoxYOalA/mntpoint fstyp=ext2 flags=0
umount01.c:20: TBROK: mount(/dev/loop2, mntpoint, ext2, 0, (nil)) failed: EBUSY (16)
I tried to bisect and run even the several years old code (with
CFLAGS="-fcommon", so that I don't have to bother with error fixed in 9ac2ee5ac
("lib: Fix linking error multiple TCID definitions with -fno-common")) it quite
often (not always) fails:
./umount01 # 9185ace3e # (rewrite to new API)
tst_device.c:81: INFO: Found free device '/dev/loop3'
tst_test.c:754: INFO: Timeout per run is 0h 05m 00s
tst_mkfs.c:69: INFO: Formatting /dev/loop3 with ext2 opts='' extra opts=''
mke2fs 1.47.0 (5-Feb-2023)
umount01.c:42: INFO: umount() Failed with EBUSY possibly some daemon (gvfsd-trash) is probing newly mounted dirs
umount01.c:48: FAIL: umount() Failed: EBUSY
tst_device.c:277: INFO: umount('mntpoint') failed with EBUSY, try 1...
tst_device.c:281: INFO: Likely gvfsd-trash is probing newly mounted fs, kill it to speed up tests.
./umount01 # 6825c4f73 (before rewrite to new API)
umount01 0 TINFO : Found free device '/dev/loop2'
umount01 0 TINFO : Formatting /dev/loop2 with ext2 opts='' extra opts=''
mke2fs 1.47.0 (5-Feb-2023)
umount01 0 TINFO : umount() failed with EBUSY possibly some daemon (gvfsd-trash) is probing newly mounted dirs
umount01 1 TFAIL : umount01.c:68: umount(2) Failed while unmounting mntpoint errno = 16 : Device or resource busy
The difference is, that only with your code it not only TFAIL, but also TBROK,
which leads to left mounted filesystem (which could influence other tests). I'll
try to have look next week, this should be fixed.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [LTP] [PATCH v2 1/3] umount01: Simplify test using TST_ macros
2023-10-27 17:18 ` [LTP] [PATCH v2 1/3] umount01: " Petr Vorel
@ 2023-10-27 17:26 ` Petr Vorel
0 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2023-10-27 17:26 UTC (permalink / raw)
To: Yang Xu, ltp, Cyril Hrubis
Hi all,
> Hi Xu,
> [ Cc Cyril, who wrote gvfsd-trash note in 10b61174c ("syscalls: umount01: Give a
> hint on failure with EBUSY") ]
I merged the patch. I'm sorry on the system which I tested the patch was really
running gvfsd-trash. I guess there is no easy solution to handle gvfsd-trash.
I guess the test should TCONF on running gvfsd-trash.
Kind regards,
Petr
> While this patch looks to be OK, there is a problem when run several times
> (either with -i > 1 or even just repeatedly run without -i):
...
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-10-27 17:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-27 9:37 [LTP] [PATCH v2 1/3] umount01: Simplify test using TST_ macros Yang Xu
2023-10-27 9:38 ` [LTP] [PATCH v2 2/3] umount02: " Yang Xu
2023-10-27 17:01 ` Petr Vorel
2023-10-27 9:38 ` [LTP] [PATCH v2 3/3] umount03: " Yang Xu
2023-10-27 17:18 ` [LTP] [PATCH v2 1/3] umount01: " Petr Vorel
2023-10-27 17:26 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox