All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [COMMITTED] utimensat01: fix kvers arrary boundary
@ 2020-08-31  6:35 Li Wang
  0 siblings, 0 replies; only message in thread
From: Li Wang @ 2020-08-31  6:35 UTC (permalink / raw)
  To: ltp

To get rid of errors:
   8 utimensat01.c:295: INFO: Testing variant: syscall with old kernel spec
   9 tst_test.c:1300: BROK: Test killed by SIGSEGV!

and,
  BROK: utimensat01.c:293: mkdir(test_dir,0700) failed: EEXIST (17)

Signed-off-by: Li Wang <liwang@redhat.com>
---
 testcases/kernel/syscalls/utimensat/utimensat01.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/utimensat/utimensat01.c b/testcases/kernel/syscalls/utimensat/utimensat01.c
index 5cc5f1d33..e2d4fee3e 100644
--- a/testcases/kernel/syscalls/utimensat/utimensat01.c
+++ b/testcases/kernel/syscalls/utimensat/utimensat01.c
@@ -161,6 +161,7 @@ static void update_error(struct test_case *tc)
 	static struct tst_kern_exv kvers[] = {
 		/* Ubuntu kernel has patch b3b4283 since 4.4.0-48.69 */
 		{ "UBUNTU", "4.4.0-48.69" },
+		{ NULL, NULL},
 	};
 
 	if (tc->exp_err != -1)
@@ -295,7 +296,8 @@ static void setup(void)
 	tst_res(TINFO, "Testing variant: %s", variants[tst_variant].desc);
 
 	bad_addr = tst_get_bad_addr(NULL);
-	SAFE_MKDIR(TEST_DIR, 0700);
+	if (access(TEST_DIR, R_OK))
+		SAFE_MKDIR(TEST_DIR, 0700);
 
 	for (i = 0; i < ARRAY_SIZE(tcase); i++)
 		update_error(&tcase[i]);
-- 
2.21.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-31  6:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-31  6:35 [LTP] [COMMITTED] utimensat01: fix kvers arrary boundary Li Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.