public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v1 1/2] syscalls/lstat{01,03} rewrote testcase
@ 2019-06-11 10:47 Christian Amann
  2019-06-11 10:47 ` [LTP] [PATCH v1 2/2] syscalls/lstat02: " Christian Amann
  2019-07-03 14:19 ` [LTP] [PATCH v1 1/2] syscalls/lstat{01,03} " Cyril Hrubis
  0 siblings, 2 replies; 4+ messages in thread
From: Christian Amann @ 2019-06-11 10:47 UTC (permalink / raw)
  To: ltp

Merged lstat01 and lstat03:
	Expanded lstat01 testcase to also include everything
	lstat03 was testing for.
Rewrote testcase:
	Cleaned up and ported to new library.

Signed-off-by: Christian Amann <camann@suse.com>
---
 runtest/syscalls                           |   2 -
 testcases/kernel/syscalls/lstat/.gitignore |   2 -
 testcases/kernel/syscalls/lstat/lstat01.c  | 243 ++++++-----------------------
 testcases/kernel/syscalls/lstat/lstat03.c  | 121 --------------
 4 files changed, 46 insertions(+), 322 deletions(-)
 delete mode 100644 testcases/kernel/syscalls/lstat/lstat03.c

diff --git a/runtest/syscalls b/runtest/syscalls
index 702d6a8c7..879290bce 100644
--- a/runtest/syscalls
+++ b/runtest/syscalls
@@ -621,8 +621,6 @@ lstat01 lstat01
 lstat01_64 lstat01_64
 lstat02 lstat02
 lstat02_64 lstat02_64
-lstat03 lstat03
-lstat03_64 lstat03_64
 
 mallopt01 mallopt01
 
diff --git a/testcases/kernel/syscalls/lstat/.gitignore b/testcases/kernel/syscalls/lstat/.gitignore
index 72cba871f..a497a445f 100644
--- a/testcases/kernel/syscalls/lstat/.gitignore
+++ b/testcases/kernel/syscalls/lstat/.gitignore
@@ -2,5 +2,3 @@
 /lstat01_64
 /lstat02
 /lstat02_64
-/lstat03
-/lstat03_64
diff --git a/testcases/kernel/syscalls/lstat/lstat01.c b/testcases/kernel/syscalls/lstat/lstat01.c
index 45a6176c5..c96365064 100644
--- a/testcases/kernel/syscalls/lstat/lstat01.c
+++ b/testcases/kernel/syscalls/lstat/lstat01.c
@@ -1,218 +1,67 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
+ *  Authors:	William Roske, Dave Fenner
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
+ *  06/2019 Ported to new library:
+ *		Christian Amann <camann@suse.com>
  */
-/* $Id: lstat01.c,v 1.7 2009/10/26 14:55:48 subrata_modak Exp $ */
-/**********************************************************
- *
- *    OS Test - Silicon Graphics, Inc.
- *
- *    TEST IDENTIFIER	: lstat01
- *
- *    EXECUTED BY	: anyone
- *
- *    TEST TITLE	: Basic test for lstat(2)
- *
- *    PARENT DOCUMENT	: usctpl01
- *
- *    TEST CASE TOTAL	: 1
- *
- *    WALL CLOCK TIME	: 1
- *
- *    CPU TYPES		: ALL
- *
- *    AUTHOR		: William Roske
- *
- *    CO-PILOT		: Dave Fenner
- *
- *    DATE STARTED	: 03/30/92
- *
- *    INITIAL RELEASE	: UNICOS 7.0
- *
- *    TEST CASES
- *
- * 	1.) lstat(2) returns...(See Description)
- *
- *    INPUT SPECIFICATIONS
- * 	The standard options for system call tests are accepted.
- *	(See the parse_opts(3) man page).
- *
- *    OUTPUT SPECIFICATIONS
- *$
- *    DURATION
- * 	Terminates - with frequency and infinite modes.
- *
- *    SIGNALS
- * 	Uses SIGUSR1 to pause before test if option set.
- * 	(See the parse_opts(3) man page).
- *
- *    RESOURCES
- * 	None
- *
- *    ENVIRONMENTAL NEEDS
- *      No run-time environmental needs.
- *
- *    SPECIAL PROCEDURAL REQUIREMENTS
- * 	None
- *
- *    INTERCASE DEPENDENCIES
- * 	None
- *
- *    DETAILED DESCRIPTION
- *	This is a Phase I test for the lstat(2) system call.  It is intended
- *	to provide a limited exposure of the system call, for now.  It
- *	should/will be extended when full functional tests are written for
- *	lstat(2).
- *
- * 	Setup:
- * 	  Setup signal handling.
- *	  Pause for SIGUSR1 if option specified.
- *
- * 	Test:
- *	 Loop if the proper options are given.
- * 	  Execute system call
- *	  Check return code, if system call failed (return=-1)
- *		Log the errno and Issue a FAIL message.
- *	  Otherwise, Issue a PASS message.
- *
- * 	Cleanup:
- * 	  Print errno log and/or timing stats if options given
- *
+/*
+ * Basic test for lstat():
  *
- *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
+ * Tests if lstat() writes correct information about a symlink
+ * into the stat structure.
+ */
 
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/stat.h>
 #include <errno.h>
 #include <string.h>
-#include <signal.h>
-#include "test.h"
-
-void setup();
-void cleanup();
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include "tst_test.h"
 
-char *TCID = "lstat01";
-int TST_TOTAL = 1;
+#define TESTFILE        "tst_file"
+#define TESTSYML        "tst_syml"
 
-char fname[255], lname[255], symlnk[255], buf[255];
-int fd;
-struct stat statter;
+static uid_t user_id;
+static gid_t group_id;
+static struct stat stat_buf;
 
-int main(int ac, char **av)
+static void run(void)
 {
-	int lc;
-
-    /***************************************************************
-     * parse standard options
-     ***************************************************************/
-	tst_parse_opts(ac, av, NULL, NULL);
-
-    /***************************************************************
-     * perform global setup for test
-     ***************************************************************/
-	setup();
-
-    /***************************************************************
-     * check looping state if -c option given
-     ***************************************************************/
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/*
-		 *  Call lstat(2)
-		 */
-		TEST(lstat(symlnk, &statter));
-
-		/* check return code */
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL,
-				 "lstat(%s, &statter) Failed, errno=%d : %s",
-				 symlnk, TEST_ERRNO, strerror(TEST_ERRNO));
-		} else {
-			tst_resm(TPASS,
-				 "lstat(%s, &statter) returned %ld",
-				 symlnk, TEST_RETURN);
-		}
-
+	TEST(lstat(TESTSYML, &stat_buf));
+	if (TST_RET == -1)
+		tst_res(TFAIL | TTERRNO, "Calling lstat() failed");
+
+	if ((stat_buf.st_mode & S_IFMT) != S_IFLNK ||
+	    stat_buf.st_uid != user_id ||
+	    stat_buf.st_gid != group_id ||
+	    stat_buf.st_size != strlen(TESTFILE)) {
+		tst_res(TFAIL,
+			"lstat() reported incorrect values for the symlink!");
+	} else {
+		tst_res(TPASS,
+			"lstat() reported correct values for the symlink!");
 	}
-
-	cleanup();
-	tst_exit();
 }
 
-/***************************************************************
- * setup() - performs all ONE TIME setup for this test.
- ***************************************************************/
-void setup(void)
+static void setup(void)
 {
+	user_id  = getuid();
+	group_id = getgid();
 
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	sprintf(fname, "tfile_%d", getpid());
-	if ((fd = open(fname, O_RDWR | O_CREAT, 0700)) == -1) {
-		tst_brkm(TBROK, cleanup,
-			 "open(%s, O_RDWR|O_CREAT,0700) Failed, errno=%d : %s",
-			 fname, errno, strerror(errno));
-	} else if (close(fd) == -1) {
-		tst_resm(TWARN, "close(%s) Failed, errno=%d : %s",
-			 fname, errno, strerror(errno));
-	}
-
-	sprintf(symlnk, "lnfile_%d", getpid());
-	if (symlink(fname, symlnk) == -1) {
-		tst_resm(TWARN, "symlink(%s, %s) Failed, errno=%d : %s",
-			 fname, symlnk, errno, strerror(errno));
-	} else if (readlink(symlnk, buf, 255) == -1) {
-		tst_resm(TWARN, "readlink(%s, buf, 255) Failed, errno=%d : %s",
-			 symlnk, errno, strerror(errno));
-	} else if (strcmp(buf, fname) != 0) {
-		tst_resm(TWARN,
-			 "Setup Failure : Expected symbolic link contents of %s : Actual is %s",
-			 fname, buf);
-	}
+	SAFE_TOUCH(TESTFILE, 0644, NULL);
+	SAFE_SYMLINK(TESTFILE, TESTSYML);
 }
 
-/***************************************************************
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- ***************************************************************/
-void cleanup(void)
+static void cleanup(void)
 {
-
-	tst_rmdir();
-
+	SAFE_UNLINK(TESTSYML);
 }
+
+static struct tst_test test = {
+	.test_all = run,
+	.setup = setup,
+	.cleanup = cleanup,
+	.needs_tmpdir = 1,
+};
diff --git a/testcases/kernel/syscalls/lstat/lstat03.c b/testcases/kernel/syscalls/lstat/lstat03.c
deleted file mode 100644
index f22281283..000000000
--- a/testcases/kernel/syscalls/lstat/lstat03.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) International Business Machines  Corp., 2001
- *  07/2001 Ported by Wayne Boyer
- *
- * This program is free software;  you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY;  without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program;  if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * Test Name: lstat03
- *
- * Test Description:
- *  Verify that, lstat(2) succeeds to get the status of a file pointed to by
- *  symlink and fills the stat structure elements.
- *
- * Expected Result:
- *  lstat() should return value 0 on success and the stat structure elements
- *  should be filled with the symlink file information.
- */
-#include <stdio.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <pwd.h>
-
-#include "test.h"
-#include "safe_macros.h"
-
-#define FILE_MODE	S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
-#define TESTFILE	"testfile"
-#define SFILE		"sfile"
-#define FILE_SIZE       1024
-#define BUF_SIZE	256
-#define PERMS		0644
-
-char *TCID = "lstat03";
-int TST_TOTAL = 1;
-static uid_t user_id;
-static gid_t group_id;
-
-static char nobody_uid[] = "nobody";
-static struct passwd *ltpuser;
-
-static void setup(void);
-static void cleanup(void);
-
-int main(int ac, char **av)
-{
-	struct stat stat_buf;
-	int lc;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		TEST(lstat(SFILE, &stat_buf));
-
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL | TTERRNO, "lstat(%s) failed", SFILE);
-			continue;
-		}
-
-		if ((stat_buf.st_uid != user_id) ||
-		    (stat_buf.st_gid != group_id) ||
-		    ((stat_buf.st_mode & S_IFMT) != S_IFLNK) ||
-		    (stat_buf.st_size != strlen(TESTFILE))) {
-			tst_resm(TFAIL, "Functionality of lstat(2) on "
-				 "'%s' Failed", SFILE);
-		} else {
-			tst_resm(TPASS, "Functionality of lstat(2) on "
-				 "'%s' Succcessful", SFILE);
-		}
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-static void setup(void)
-{
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	tst_require_root();
-
-	ltpuser = SAFE_GETPWNAM(NULL, nobody_uid);
-	SAFE_SETUID(NULL, ltpuser->pw_uid);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	if (tst_fill_file(TESTFILE, 'a', 1024, 1))
-		tst_brkm(TBROK, cleanup, "Failed to create " TESTFILE);
-
-	SAFE_SYMLINK(cleanup, TESTFILE, SFILE);
-
-	user_id = getuid();
-	group_id = getgid();
-}
-
-static void cleanup(void)
-{
-	tst_rmdir();
-}
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [LTP] [PATCH v1 2/2] syscalls/lstat02: rewrote testcase
  2019-06-11 10:47 [LTP] [PATCH v1 1/2] syscalls/lstat{01,03} rewrote testcase Christian Amann
@ 2019-06-11 10:47 ` Christian Amann
  2019-07-03 14:30   ` Cyril Hrubis
  2019-07-03 14:19 ` [LTP] [PATCH v1 1/2] syscalls/lstat{01,03} " Cyril Hrubis
  1 sibling, 1 reply; 4+ messages in thread
From: Christian Amann @ 2019-06-11 10:47 UTC (permalink / raw)
  To: ltp

Cleaned up and ported to new library.

Signed-off-by: Christian Amann <camann@suse.com>
---
 testcases/kernel/syscalls/lstat/lstat02.c | 181 +++++++++++-------------------
 1 file changed, 66 insertions(+), 115 deletions(-)

diff --git a/testcases/kernel/syscalls/lstat/lstat02.c b/testcases/kernel/syscalls/lstat/lstat02.c
index 774867020..f39f33b34 100644
--- a/testcases/kernel/syscalls/lstat/lstat02.c
+++ b/testcases/kernel/syscalls/lstat/lstat02.c
@@ -1,24 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *   Copyright (c) International Business Machines  Corp., 2001
  *   07/2001 Ported by Wayne Boyer
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software Foundation,
- *   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *   06/2019 Ported to new library: Christian Amann <camann@suse.com>
  */
 /*
- * Test Description:
- *   Verify that,
+ * This test verifies that:
+ *
  *   1) lstat(2) returns -1 and sets errno to EACCES if search permission is
  *	denied on a component of the path prefix.
  *   2) lstat(2) returns -1 and sets errno to ENOENT if the specified file
@@ -33,70 +21,60 @@
  *	many symbolic links encountered while traversing.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
 #include <errno.h>
+#include <pwd.h>
+#include <stdlib.h>
 #include <string.h>
-#include <signal.h>
+#include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/mman.h>
-#include <pwd.h>
+#include "tst_test.h"
 
-#include "test.h"
-#include "safe_macros.h"
-
-#define MODE_RWX	S_IRWXU | S_IRWXG | S_IRWXO
-#define FILE_MODE	S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
+#define MODE_RWX	0777
+#define MODE_RW0	0666
 #define TEST_DIR	"test_dir"
-#define TEST_EACCES	TEST_DIR"/test_eacces"
-#define TEST_ENOENT	""
-#define TEST_ENOTDIR	"test_file/test_enotdir"
+#define TEST_FILE	"test_file"
+
 #define TEST_ELOOP	"/test_eloop"
+#define TEST_ENOENT	""
+#define TEST_EACCES	TEST_DIR"/test_eacces"
+#define TEST_ENOTDIR	TEST_FILE"/test_enotdir"
 
 static char longpathname[PATH_MAX + 2];
-static char elooppathname[sizeof(TEST_ELOOP) * 43] = ".";
-
-static void setup(void);
-static void lstat_verify(int);
-static void cleanup(void);
-static void bad_addr_setup(int);
+static char elooppathname[sizeof(TEST_ELOOP) * 43];
+static struct stat stat_buf;
 
 static struct test_case_t {
 	char *pathname;
 	int exp_errno;
-	void (*setup) ();
 } test_cases[] = {
-	{TEST_EACCES, EACCES, NULL},
-	{TEST_ENOENT, ENOENT, NULL},
-	{NULL, EFAULT, bad_addr_setup},
-	{longpathname, ENAMETOOLONG, NULL},
-	{TEST_ENOTDIR, ENOTDIR, NULL},
-	{elooppathname, ELOOP, NULL},
+	{TEST_EACCES, EACCES},
+	{TEST_ENOENT, ENOENT},
+	{NULL, EFAULT},
+	{longpathname, ENAMETOOLONG},
+	{TEST_ENOTDIR, ENOTDIR},
+	{elooppathname, ELOOP},
 };
 
-char *TCID = "lstat02";
-int TST_TOTAL = ARRAY_SIZE(test_cases);
-
-int main(int ac, char **av)
+static void run(unsigned int n)
 {
-	int lc;
-	int i;
+	struct test_case_t *tc = &test_cases[n];
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	TEST(lstat(tc->pathname, &stat_buf));
 
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-		for (i = 0; i < TST_TOTAL; i++)
-			lstat_verify(i);
+	if (TST_RET != -1) {
+		tst_res(TFAIL | TTERRNO, "lstat() returned %ld, expected -1",
+			TST_RET);
+		return;
 	}
 
-	cleanup();
-	tst_exit();
+	if (tc->exp_errno == TST_ERR) {
+		tst_res(TPASS | TTERRNO, "lstat() failed as expected");
+	} else {
+		tst_res(TFAIL | TTERRNO,
+			"lstat() failed unexpectedly; expected: %s - got",
+			tst_strerrno(tc->exp_errno));
+	}
 }
 
 static void setup(void)
@@ -104,71 +82,44 @@ static void setup(void)
 	int i;
 	struct passwd *ltpuser;
 
-	tst_require_root();
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	ltpuser = SAFE_GETPWNAM(cleanup, "nobody");
-	SAFE_SETEUID(cleanup, ltpuser->pw_uid);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	SAFE_MKDIR(cleanup, TEST_DIR, MODE_RWX);
-	SAFE_TOUCH(cleanup, TEST_EACCES, 0666, NULL);
-	SAFE_CHMOD(cleanup, TEST_DIR, FILE_MODE);
-
-	SAFE_TOUCH(cleanup, "test_file", MODE_RWX, NULL);
+	/* Drop privileges for EACCES test */
+	if (geteuid() == 0) {
+		ltpuser = SAFE_GETPWNAM("nobody");
+		SAFE_SETEUID(ltpuser->pw_uid);
+	}
 
 	memset(longpathname, 'a', PATH_MAX+1);
+	longpathname[PATH_MAX+1] = '\0';
+
+	SAFE_MKDIR(TEST_DIR, MODE_RWX);
+	SAFE_TOUCH(TEST_EACCES, MODE_RWX, NULL);
+	SAFE_TOUCH(TEST_FILE, MODE_RWX, NULL);
+	SAFE_CHMOD(TEST_DIR, MODE_RW0);
 
-	SAFE_MKDIR(cleanup, "test_eloop", MODE_RWX);
-	SAFE_SYMLINK(cleanup, "../test_eloop", "test_eloop/test_eloop");
+	SAFE_MKDIR("test_eloop", MODE_RWX);
+	SAFE_SYMLINK("../test_eloop", "test_eloop/test_eloop");
 	/*
-	 * NOTE: the ELOOP test is written based on that the consecutive
-	 * symlinks limits in kernel is hardwired to 40.
+	 * NOTE: The ELOOP test is written based on the fact that the
+	 * consecutive symlinks limit in the kernel is hardwired to 40.
 	 */
+	elooppathname[0] = '.';
 	for (i = 0; i < 43; i++)
 		strcat(elooppathname, TEST_ELOOP);
-
-	for (i = 0; i < TST_TOTAL; i++) {
-		if (test_cases[i].setup)
-			test_cases[i].setup(i);
-	}
-}
-
-static void bad_addr_setup(int i)
-{
-	test_cases[i].pathname = tst_get_bad_addr(cleanup);
-}
-
-static void lstat_verify(int i)
-{
-	struct stat stat_buf;
-
-	TEST(lstat(test_cases[i].pathname, &stat_buf));
-
-	if (TEST_RETURN != -1) {
-		tst_resm(TFAIL, "lstat() returned %ld, expected -1, errno=%d",
-			 TEST_RETURN, test_cases[i].exp_errno);
-		return;
-	}
-
-	if (TEST_ERRNO == test_cases[i].exp_errno) {
-		tst_resm(TPASS | TTERRNO, "lstat() failed as expected");
-	} else {
-		tst_resm(TFAIL | TTERRNO,
-			 "lstat() failed unexpectedly; expected: %d - %s",
-			 test_cases[i].exp_errno,
-			 strerror(test_cases[i].exp_errno));
-	}
 }
 
 static void cleanup(void)
 {
-	if (seteuid(0))
-		tst_resm(TINFO | TERRNO, "Failet to seteuid(0) before cleanup");
-
-	tst_rmdir();
+	SAFE_CHMOD(TEST_DIR, MODE_RWX);
+	SAFE_UNLINK("test_eloop/test_eloop");
+	SAFE_RMDIR("test_eloop");
+	SAFE_UNLINK(TEST_EACCES);
+	SAFE_RMDIR(TEST_DIR);
 }
+
+static struct tst_test test = {
+	.test = run,
+	.tcnt = ARRAY_SIZE(test_cases),
+	.setup = setup,
+	.cleanup = cleanup,
+	.needs_tmpdir = 1,
+};
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [LTP] [PATCH v1 1/2] syscalls/lstat{01,03} rewrote testcase
  2019-06-11 10:47 [LTP] [PATCH v1 1/2] syscalls/lstat{01,03} rewrote testcase Christian Amann
  2019-06-11 10:47 ` [LTP] [PATCH v1 2/2] syscalls/lstat02: " Christian Amann
@ 2019-07-03 14:19 ` Cyril Hrubis
  1 sibling, 0 replies; 4+ messages in thread
From: Cyril Hrubis @ 2019-07-03 14:19 UTC (permalink / raw)
  To: ltp

Hi!
Pushed with minor change, thanks.

I've made the stat_buf local variable and also memset() it to 0 before
the test (mostly because of -i paramter).

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LTP] [PATCH v1 2/2] syscalls/lstat02: rewrote testcase
  2019-06-11 10:47 ` [LTP] [PATCH v1 2/2] syscalls/lstat02: " Christian Amann
@ 2019-07-03 14:30   ` Cyril Hrubis
  0 siblings, 0 replies; 4+ messages in thread
From: Cyril Hrubis @ 2019-07-03 14:30 UTC (permalink / raw)
  To: ltp

Hi!
Pushed with minor change, thanks.

I've removed everything but the chmod, which is the only call needed,
from cleanup.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-03 14:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-11 10:47 [LTP] [PATCH v1 1/2] syscalls/lstat{01,03} rewrote testcase Christian Amann
2019-06-11 10:47 ` [LTP] [PATCH v1 2/2] syscalls/lstat02: " Christian Amann
2019-07-03 14:30   ` Cyril Hrubis
2019-07-03 14:19 ` [LTP] [PATCH v1 1/2] syscalls/lstat{01,03} " Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox