From: Andrew Chen <[email protected]>

Ensure creating files in /tmp/ instead of test current directory.
In our setup, the latter causes the generated directory which the
test files belong to cannot be removed by rmdir() and test failed
in later run once the directory names are hit again.

Signed-off-by: Andrew Chen <[email protected]>
---
 .../testcases/kernel/syscalls/fstatat/fstatat01.c  |    4 ++++
 .../kernel/syscalls/futimesat/futimesat01.c        |    4 ++++
 .../testcases/kernel/syscalls/openat/openat01.c    |    4 ++++
 .../kernel/syscalls/readlinkat/readlinkat01.c      |    4 ++++
 .../kernel/syscalls/renameat/renameat01.c          |    4 ++++
 .../kernel/syscalls/unlinkat/unlinkat01.c          |    4 ++++
 6 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/ltp-full-20101031/testcases/kernel/syscalls/fstatat/fstatat01.c 
b/ltp-full-20101031/testcases/kernel/syscalls/fstatat/fstatat01.c
index 5f81dac..0851cbc 100644
--- a/ltp-full-20101031/testcases/kernel/syscalls/fstatat/fstatat01.c
+++ b/ltp-full-20101031/testcases/kernel/syscalls/fstatat/fstatat01.c
@@ -247,6 +247,8 @@ void setup()
        /* capture signals */
        tst_sig(NOFORK, DEF_HANDLER, cleanup);
 
+       tst_tmpdir();
+
        /* Pause if that option was specified */
        TEST_PAUSE;
 }                              /* End setup() */
@@ -269,6 +271,8 @@ void cleanup()
         */
        TEST_CLEANUP;
 
+       tst_rmdir();
+
        /* exit with return code appropriate for results */
        tst_exit();
 }                              /* End cleanup() */
diff --git 
a/ltp-full-20101031/testcases/kernel/syscalls/futimesat/futimesat01.c 
b/ltp-full-20101031/testcases/kernel/syscalls/futimesat/futimesat01.c
index d82a2c4..767259c 100644
--- a/ltp-full-20101031/testcases/kernel/syscalls/futimesat/futimesat01.c
+++ b/ltp-full-20101031/testcases/kernel/syscalls/futimesat/futimesat01.c
@@ -213,6 +213,8 @@ void setup()
        /* capture signals */
        tst_sig(NOFORK, DEF_HANDLER, cleanup);
 
+       tst_tmpdir();
+
        /* Pause if that option was specified */
        TEST_PAUSE;
 }                              /* End setup() */
@@ -235,6 +237,8 @@ void cleanup()
         */
        TEST_CLEANUP;
 
+       tst_rmdir();
+
        /* exit with return code appropriate for results */
        tst_exit();
 }                              /* End cleanup() */
diff --git a/ltp-full-20101031/testcases/kernel/syscalls/openat/openat01.c 
b/ltp-full-20101031/testcases/kernel/syscalls/openat/openat01.c
index be40c63..f784e70 100644
--- a/ltp-full-20101031/testcases/kernel/syscalls/openat/openat01.c
+++ b/ltp-full-20101031/testcases/kernel/syscalls/openat/openat01.c
@@ -195,6 +195,8 @@ void setup()
        /* capture signals */
        tst_sig(NOFORK, DEF_HANDLER, cleanup);
 
+       tst_tmpdir();
+
        /* Pause if that option was specified */
        TEST_PAUSE;
 }                              /* End setup() */
@@ -222,6 +224,8 @@ void cleanup()
         */
        TEST_CLEANUP;
 
+       tst_rmdir();
+
        /* exit with return code appropriate for results */
        tst_exit();
 }                              /* End cleanup() */
diff --git 
a/ltp-full-20101031/testcases/kernel/syscalls/readlinkat/readlinkat01.c 
b/ltp-full-20101031/testcases/kernel/syscalls/readlinkat/readlinkat01.c
index a6963f1..7a547ed 100644
--- a/ltp-full-20101031/testcases/kernel/syscalls/readlinkat/readlinkat01.c
+++ b/ltp-full-20101031/testcases/kernel/syscalls/readlinkat/readlinkat01.c
@@ -274,6 +274,8 @@ void setup()
        /* capture signals */
        tst_sig(NOFORK, DEF_HANDLER, cleanup);
 
+       tst_tmpdir();
+
        /* Pause if that option was specified */
        TEST_PAUSE;
 }                              /* End setup() */
@@ -300,6 +302,8 @@ void cleanup()
         */
        TEST_CLEANUP;
 
+       tst_rmdir();
+
        /* exit with return code appropriate for results */
        tst_exit();
 }                              /* End cleanup() */
diff --git a/ltp-full-20101031/testcases/kernel/syscalls/renameat/renameat01.c 
b/ltp-full-20101031/testcases/kernel/syscalls/renameat/renameat01.c
index 3f27c95..f4766ad 100644
--- a/ltp-full-20101031/testcases/kernel/syscalls/renameat/renameat01.c
+++ b/ltp-full-20101031/testcases/kernel/syscalls/renameat/renameat01.c
@@ -247,6 +247,8 @@ void setup()
        /* capture signals */
        tst_sig(NOFORK, DEF_HANDLER, cleanup);
 
+       tst_tmpdir();
+
        /* Pause if that option was specified */
        TEST_PAUSE;
 }                              /* End setup() */
@@ -273,6 +275,8 @@ void cleanup()
         */
        TEST_CLEANUP;
 
+       tst_rmdir();
+
        /* exit with return code appropriate for results */
        tst_exit();
 }                              /* End cleanup() */
diff --git a/ltp-full-20101031/testcases/kernel/syscalls/unlinkat/unlinkat01.c 
b/ltp-full-20101031/testcases/kernel/syscalls/unlinkat/unlinkat01.c
index f8977f5..5d758fb 100644
--- a/ltp-full-20101031/testcases/kernel/syscalls/unlinkat/unlinkat01.c
+++ b/ltp-full-20101031/testcases/kernel/syscalls/unlinkat/unlinkat01.c
@@ -227,6 +227,8 @@ void setup()
        /* capture signals */
        tst_sig(NOFORK, DEF_HANDLER, cleanup);
 
+       tst_tmpdir();
+
        /* Pause if that option was specified */
        TEST_PAUSE;
 }                              /* End setup() */
@@ -252,6 +254,8 @@ void cleanup()
         */
        TEST_CLEANUP;
 
+       tst_rmdir();
+
        /* exit with return code appropriate for results */
        tst_exit();
 }                              /* End cleanup() */
-- 
1.6.5


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to