All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] Change some absolute paths in the linkat test to point to its own files instead of /etc/passwd
@ 2009-06-08 11:27 Jiri Palecek
  2009-06-09 18:25 ` Subrata Modak
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Palecek @ 2009-06-08 11:27 UTC (permalink / raw)
  To: ltp-list

 This avoids unwanted error when /etc and /tmp are on different
 devices

Signed-off-by: Jiri Palecek <jpalecek@web.de>
---
 testcases/kernel/syscalls/linkat/linkat01.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/testcases/kernel/syscalls/linkat/linkat01.c b/testcases/kernel/syscalls/linkat/linkat01.c
index d62416b..72845f2 100644
--- a/testcases/kernel/syscalls/linkat/linkat01.c
+++ b/testcases/kernel/syscalls/linkat/linkat01.c
@@ -79,6 +79,7 @@ static void mylinkat_test(struct test_struct* desc);
 #define TEST_FIFO "fifo"
 
 static char dpathname[256] = "%s/"TEST_DIR2"/"TEST_FILE1;
+static char spathname[256] = "%s/"TEST_DIR1"/"TEST_FILE1;
 static int olddirfd, newdirfd = -1, cwd_fd = AT_FDCWD, stdinfd = 0, crapfd = -1, deldirfd;
 
 struct test_struct {
@@ -94,7 +95,7 @@ struct test_struct {
 	/* relative paths */
 	{ &olddirfd, TEST_FILE1, &newdirfd, TEST_FILE1, 0, TEST_DIR1"/"TEST_FILE1, TEST_DIR2"/"TEST_FILE1, 0 },
 	/* abs path at source */
-	{ &olddirfd, "/etc/passwd", &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
+	{ &olddirfd, spathname, &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
 	/* abs path at dst */
 	{ &olddirfd, TEST_FILE1, &newdirfd, dpathname, 0, TEST_DIR1"/"TEST_FILE1, TEST_DIR2"/"TEST_FILE1, 0},
 
@@ -103,7 +104,7 @@ struct test_struct {
 	/* relative paths to cwd */
 	{ &olddirfd, TEST_FILE1, &cwd_fd, TEST_DIR2"/"TEST_FILE1, 0, TEST_DIR1"/"TEST_FILE1, TEST_DIR2"/"TEST_FILE1, 0 },
 	/* abs path at source */
-	{ &cwd_fd, "/etc/passwd", &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
+	{ &cwd_fd, spathname, &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
 	/* abs path at dst */
 	{ &olddirfd, TEST_FILE1, &cwd_fd, dpathname, 0, TEST_DIR1"/"TEST_FILE1, TEST_DIR2"/"TEST_FILE1, 0},
 
@@ -112,7 +113,7 @@ struct test_struct {
 	/* relative paths to invalid */
 	{ &olddirfd, TEST_FILE1, &stdinfd, TEST_DIR2"/"TEST_FILE1, 0, 0, 0, ENOTDIR },
 	/* abs path at source */
-	{ &stdinfd, "/etc/passwd", &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
+	{ &stdinfd, spathname, &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
 	/* abs path at dst */
 	{ &olddirfd, TEST_FILE1, &stdinfd, dpathname, 0, TEST_DIR1"/"TEST_FILE1, TEST_DIR2"/"TEST_FILE1, 0},
 
@@ -121,7 +122,7 @@ struct test_struct {
 	/* relative paths to crap */
 	{ &olddirfd, TEST_FILE1, &crapfd, TEST_DIR2"/"TEST_FILE1, 0, 0, 0, EBADF },
 	/* abs path at source */
-	{ &crapfd, "/etc/passwd", &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
+	{ &crapfd, spathname, &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
 	/* abs path at dst */
 	{ &olddirfd, TEST_FILE1, &crapfd, dpathname, 0, TEST_DIR1"/"TEST_FILE1, TEST_DIR2"/"TEST_FILE1, 0},
 
@@ -130,7 +131,7 @@ struct test_struct {
 	/* relative paths to deleted */
 	{ &olddirfd, TEST_FILE1, &deldirfd, TEST_DIR2"/"TEST_FILE1, 0, 0, 0, ENOENT },
 	/* abs path at source */
-	{ &deldirfd, "/etc/passwd", &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
+	{ &deldirfd, spathname, &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
 	/* abs path at dst */
 	{ &olddirfd, TEST_FILE1, &deldirfd, dpathname, 0, TEST_DIR1"/"TEST_FILE1, TEST_DIR2"/"TEST_FILE1, 0},
 
@@ -298,6 +299,9 @@ static void setup()
 	tmp = strdup(dpathname);
 	snprintf(dpathname, sizeof(dpathname), tmp, get_current_dir_name());
 
+	tmp = strdup(spathname);
+	snprintf(spathname, sizeof(spathname), tmp, get_current_dir_name());
+
 	/* Pause if that option was specified */
 	TEST_PAUSE;
 }				/* End setup() */
-- 
1.6.2.4


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] Change some absolute paths in the linkat test to point to its own files instead of /etc/passwd
  2009-06-08 11:27 [LTP] [PATCH] Change some absolute paths in the linkat test to point to its own files instead of /etc/passwd Jiri Palecek
@ 2009-06-09 18:25 ` Subrata Modak
  0 siblings, 0 replies; 2+ messages in thread
From: Subrata Modak @ 2009-06-09 18:25 UTC (permalink / raw)
  To: Jiri Palecek; +Cc: ltp-list

On Mon, 2009-06-08 at 13:27 +0200, Jiri Palecek wrote: 
> This avoids unwanted error when /etc and /tmp are on different
>  devices
> 
> Signed-off-by: Jiri Palecek <jpalecek@web.de>

Thanks.

Regards--
Subrata

> ---
>  testcases/kernel/syscalls/linkat/linkat01.c |   14 +++++++++-----
>  1 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/linkat/linkat01.c b/testcases/kernel/syscalls/linkat/linkat01.c
> index d62416b..72845f2 100644
> --- a/testcases/kernel/syscalls/linkat/linkat01.c
> +++ b/testcases/kernel/syscalls/linkat/linkat01.c
> @@ -79,6 +79,7 @@ static void mylinkat_test(struct test_struct* desc);
>  #define TEST_FIFO "fifo"
> 
>  static char dpathname[256] = "%s/"TEST_DIR2"/"TEST_FILE1;
> +static char spathname[256] = "%s/"TEST_DIR1"/"TEST_FILE1;
>  static int olddirfd, newdirfd = -1, cwd_fd = AT_FDCWD, stdinfd = 0, crapfd = -1, deldirfd;
> 
>  struct test_struct {
> @@ -94,7 +95,7 @@ struct test_struct {
>  	/* relative paths */
>  	{ &olddirfd, TEST_FILE1, &newdirfd, TEST_FILE1, 0, TEST_DIR1"/"TEST_FILE1, TEST_DIR2"/"TEST_FILE1, 0 },
>  	/* abs path at source */
> -	{ &olddirfd, "/etc/passwd", &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
> +	{ &olddirfd, spathname, &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
>  	/* abs path at dst */
>  	{ &olddirfd, TEST_FILE1, &newdirfd, dpathname, 0, TEST_DIR1"/"TEST_FILE1, TEST_DIR2"/"TEST_FILE1, 0},
> 
> @@ -103,7 +104,7 @@ struct test_struct {
>  	/* relative paths to cwd */
>  	{ &olddirfd, TEST_FILE1, &cwd_fd, TEST_DIR2"/"TEST_FILE1, 0, TEST_DIR1"/"TEST_FILE1, TEST_DIR2"/"TEST_FILE1, 0 },
>  	/* abs path at source */
> -	{ &cwd_fd, "/etc/passwd", &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
> +	{ &cwd_fd, spathname, &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
>  	/* abs path at dst */
>  	{ &olddirfd, TEST_FILE1, &cwd_fd, dpathname, 0, TEST_DIR1"/"TEST_FILE1, TEST_DIR2"/"TEST_FILE1, 0},
> 
> @@ -112,7 +113,7 @@ struct test_struct {
>  	/* relative paths to invalid */
>  	{ &olddirfd, TEST_FILE1, &stdinfd, TEST_DIR2"/"TEST_FILE1, 0, 0, 0, ENOTDIR },
>  	/* abs path at source */
> -	{ &stdinfd, "/etc/passwd", &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
> +	{ &stdinfd, spathname, &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
>  	/* abs path at dst */
>  	{ &olddirfd, TEST_FILE1, &stdinfd, dpathname, 0, TEST_DIR1"/"TEST_FILE1, TEST_DIR2"/"TEST_FILE1, 0},
> 
> @@ -121,7 +122,7 @@ struct test_struct {
>  	/* relative paths to crap */
>  	{ &olddirfd, TEST_FILE1, &crapfd, TEST_DIR2"/"TEST_FILE1, 0, 0, 0, EBADF },
>  	/* abs path at source */
> -	{ &crapfd, "/etc/passwd", &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
> +	{ &crapfd, spathname, &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
>  	/* abs path at dst */
>  	{ &olddirfd, TEST_FILE1, &crapfd, dpathname, 0, TEST_DIR1"/"TEST_FILE1, TEST_DIR2"/"TEST_FILE1, 0},
> 
> @@ -130,7 +131,7 @@ struct test_struct {
>  	/* relative paths to deleted */
>  	{ &olddirfd, TEST_FILE1, &deldirfd, TEST_DIR2"/"TEST_FILE1, 0, 0, 0, ENOENT },
>  	/* abs path at source */
> -	{ &deldirfd, "/etc/passwd", &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
> +	{ &deldirfd, spathname, &newdirfd, TEST_FILE1, 0, 0, 0, 0 },
>  	/* abs path at dst */
>  	{ &olddirfd, TEST_FILE1, &deldirfd, dpathname, 0, TEST_DIR1"/"TEST_FILE1, TEST_DIR2"/"TEST_FILE1, 0},
> 
> @@ -298,6 +299,9 @@ static void setup()
>  	tmp = strdup(dpathname);
>  	snprintf(dpathname, sizeof(dpathname), tmp, get_current_dir_name());
> 
> +	tmp = strdup(spathname);
> +	snprintf(spathname, sizeof(spathname), tmp, get_current_dir_name());
> +
>  	/* Pause if that option was specified */
>  	TEST_PAUSE;
>  }				/* End setup() */


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2009-06-09 18:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-08 11:27 [LTP] [PATCH] Change some absolute paths in the linkat test to point to its own files instead of /etc/passwd Jiri Palecek
2009-06-09 18:25 ` Subrata Modak

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.