runfstests.sh is creating temporary directory, which could be easily done
withing the test itself by using tst_tmpdir(), So runfstests.sh should be
deleted.

Signed-off-by: Peng Haitao <[email protected]>
---
 runtest/io                                   |    2 +-
 testcases/kernel/io/aio/aio02/Makefile       |    2 -
 testcases/kernel/io/aio/aio02/README         |    2 +-
 testcases/kernel/io/aio/aio02/aio_tio.c      |   20 ++++----
 testcases/kernel/io/aio/aio02/cases/common.h |   30 -------------
 testcases/kernel/io/aio/aio02/main.c         |    8 ++-
 testcases/kernel/io/aio/aio02/runfstests.sh  |   58 --------------------------
 7 files changed, 17 insertions(+), 105 deletions(-)
 delete mode 100644 testcases/kernel/io/aio/aio02/cases/common.h
 delete mode 100755 testcases/kernel/io/aio/aio02/runfstests.sh

diff --git a/runtest/io b/runtest/io
index a52d053..00032ff 100644
--- a/runtest/io
+++ b/runtest/io
@@ -1,3 +1,3 @@
 #AIO01 & AIO02 tests to be run
 aio01 aio01
-aio02 runfstests.sh -a aio_tio
+aio02 aio_tio
diff --git a/testcases/kernel/io/aio/aio02/Makefile 
b/testcases/kernel/io/aio/aio02/Makefile
index e897d84..7d71634 100644
--- a/testcases/kernel/io/aio/aio02/Makefile
+++ b/testcases/kernel/io/aio/aio02/Makefile
@@ -27,8 +27,6 @@ include $(top_srcdir)/include/mk/testcases.mk
 # Needed for common.h...
 CPPFLAGS               += -D_GNU_SOURCE
 
-INSTALL_TARGETS                := runfstests.sh
-
 LDLIBS                 += $(AIO_LIBS)
 
 FILTER_OUT_MAKE_TARGETS        := main
diff --git a/testcases/kernel/io/aio/aio02/README 
b/testcases/kernel/io/aio/aio02/README
index f56347d..addec27 100644
--- a/testcases/kernel/io/aio/aio02/README
+++ b/testcases/kernel/io/aio/aio02/README
@@ -2,7 +2,7 @@ This program will test Asynchronous I/O support by kernel 2.5 .
 make the program
        make
 execute the test
-       ./runfstests.sh cases/aio_tio
+       ./aio_tio
 
 
 NOTE:
diff --git a/testcases/kernel/io/aio/aio02/aio_tio.c 
b/testcases/kernel/io/aio/aio02/aio_tio.c
index 1627451..dea4d5b 100644
--- a/testcases/kernel/io/aio/aio02/aio_tio.c
+++ b/testcases/kernel/io/aio/aio02/aio_tio.c
@@ -17,7 +17,7 @@
 *  Foundation,
 *
 *  FILE        : aio_tio
-*  USAGE       : runfstest case/aio_tio
+*  USAGE       : ./aio_tio
 *
 *  DESCRIPTION : This program will test Asynchronous I/O for 2.5 Kernel 
infrastructure
 *  REQUIREMENTS:
@@ -213,7 +213,7 @@ int test_main(void)
        int     status = 0 ;
 
        tst_resm(TINFO, "Running test 1\n");
-       status = io_tio("testdir/file1",
+       status = io_tio("file1",
                        O_TRUNC | O_DIRECT | O_WRONLY | O_CREAT | O_LARGEFILE,
                        AIO_MAXIO, IO_CMD_PWRITE);
        if (status) {
@@ -221,42 +221,42 @@ int test_main(void)
        }
 
        tst_resm(TINFO, "Running test 2\n");
-       status = io_tio("testdir/file1", O_RDONLY | O_DIRECT | O_LARGEFILE,
+       status = io_tio("file1", O_RDONLY | O_DIRECT | O_LARGEFILE,
                        AIO_MAXIO, IO_CMD_PREAD);
        if (status) {
                return status;
        }
 
        tst_resm(TINFO, "Running test 3\n");
-       status = io_tio("testdir/file1", O_TRUNC | O_RDWR,
+       status = io_tio("file1", O_TRUNC | O_RDWR,
                        AIO_MAXIO, IO_CMD_PWRITE);
        if (status) {
                return status;
        }
 
        tst_resm(TINFO, "Running test 4\n");
-       status = io_tio("testdir/file1", O_RDWR,
+       status = io_tio("file1", O_RDWR,
                        AIO_MAXIO, IO_CMD_PREAD);
        if (status) {
                return status;
        }
 
        tst_resm(TINFO, "Running test 5\n");
-       status = io_tio("testdir/file1", O_TRUNC | O_WRONLY,
+       status = io_tio("file1", O_TRUNC | O_WRONLY,
                        AIO_MAXIO, IO_CMD_PWRITE);
        if (status) {
                return status;
        }
 
        tst_resm(TINFO, "Running test 6 \n");
-       status = io_tio("testdir/file1", O_RDONLY,
+       status = io_tio("file1", O_RDONLY,
                        AIO_MAXIO, IO_CMD_PREAD);
        if (status) {
                return status;
        }
 
        tst_resm(TINFO, "Running test 7 \n");
-       status = io_tio("testdir/file2",
+       status = io_tio("file2",
                        O_TRUNC | O_DIRECT | O_WRONLY | O_CREAT | O_LARGEFILE,
                        AIO_MAXIO, IO_CMD_FSYNC);
        if (status) {
@@ -264,7 +264,7 @@ int test_main(void)
        }
 
        tst_resm(TINFO, "Running test 8 \n");
-       status = io_tio("testdir/file2",
+       status = io_tio("file2",
                        O_TRUNC | O_DIRECT | O_WRONLY | O_CREAT | O_LARGEFILE,
                        AIO_MAXIO, IO_CMD_FDSYNC);
        if (status) {
@@ -274,4 +274,4 @@ int test_main(void)
        return status;
 }
 
-#endif
\ No newline at end of file
+#endif
diff --git a/testcases/kernel/io/aio/aio02/cases/common.h 
b/testcases/kernel/io/aio/aio02/cases/common.h
deleted file mode 100644
index fd8d921..0000000
--- a/testcases/kernel/io/aio/aio02/cases/common.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/param.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <sys/select.h>
-#if HAVE_LIBAIO_H
-#include <libaio.h>
-#endif
-#include <sys/uio.h>
-#include <assert.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <string.h>
-
-/* Fatal error handler */
-static void io_error(const char *func, int rc)
-{
-       if (rc == -ENOSYS)
-               fprintf(stderr, "AIO not in this kernel\n");
-       else if (rc < 0)
-               fprintf(stderr, "%s: %s\n", func, strerror(-rc));
-       else
-               fprintf(stderr, "%s: error %d\n", func, rc);
-       
-       exit(1);
-}
diff --git a/testcases/kernel/io/aio/aio02/main.c 
b/testcases/kernel/io/aio/aio02/main.c
index 06d63d8..5970527 100644
--- a/testcases/kernel/io/aio/aio02/main.c
+++ b/testcases/kernel/io/aio/aio02/main.c
@@ -23,14 +23,16 @@ int test_main(void);
 
 int main(void)
 {
+       tst_tmpdir();
+
        test_main();
+
+       tst_rmdir();
        tst_exit();
 }
 #else
 int main(void)
 {
        tst_brkm(TCONF, NULL, "libaio missing");
-
-       tst_exit();
 }
-#endif
\ No newline at end of file
+#endif
diff --git a/testcases/kernel/io/aio/aio02/runfstests.sh 
b/testcases/kernel/io/aio/aio02/runfstests.sh
deleted file mode 100755
index 07a40ad..0000000
--- a/testcases/kernel/io/aio/aio02/runfstests.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/sh
-
-echo "Starting the Tests"
-
-passes=0
-fails=0
-
-if [ ! -d testdir ]; then
-       mkdir -m 777 testdir
-fi
-
-echo "Test run starting at " `date`
-
-usage() 
-{
-       cat <<-END >&2
-       usage: ${0##*/} [ -a test name ] 
-
-       example: ${0##*/} -a cases/aio_tio
-
-END
-       exit
-}
-
-while getopts :a: arg; do
-case $arg in
-       a)
-               this_test=$OPTARG;;
-       \?)
-               echo "************** Help Info: ********************"
-               usage;;
-esac
-done
-
-if [ ! -n "$this_test"  ]; then
-       cat <<EOF
-${0##*/} : missing the test program. You must pass a test path/name for testing
-EOF
-       usage
-       exit 1
-fi
-
-#Execute only once at present circumstances
-#while [ $# -ge 1 ] ; do
-       echo "Starting $this_test"
-       $this_test 
-       res=$?
-       if [ $res -eq 0 ] ; then
-               : $(( passes += 1 ))
-       else
-               : $(( fails += 1 ))
-       fi
-#done
-
-echo "Pass: $passes Fail: $fails"
-echo "Test run complete at" `date`
-
-rm -rf testdir
-- 
1.7.1


-- 
Best Regards,
Peng
runfstests.sh is creating temporary directory, which could be easily done
withing the test itself by using tst_tmpdir(), So runfstests.sh should be
deleted.

Signed-off-by: Peng Haitao <[email protected]>
---
 runtest/io                                   |    2 +-
 testcases/kernel/io/aio/aio02/Makefile       |    2 -
 testcases/kernel/io/aio/aio02/README         |    2 +-
 testcases/kernel/io/aio/aio02/aio_tio.c      |   20 ++++----
 testcases/kernel/io/aio/aio02/cases/common.h |   30 -------------
 testcases/kernel/io/aio/aio02/main.c         |    8 ++-
 testcases/kernel/io/aio/aio02/runfstests.sh  |   58 --------------------------
 7 files changed, 17 insertions(+), 105 deletions(-)
 delete mode 100644 testcases/kernel/io/aio/aio02/cases/common.h
 delete mode 100755 testcases/kernel/io/aio/aio02/runfstests.sh

diff --git a/runtest/io b/runtest/io
index a52d053..00032ff 100644
--- a/runtest/io
+++ b/runtest/io
@@ -1,3 +1,3 @@
 #AIO01 & AIO02 tests to be run
 aio01 aio01
-aio02 runfstests.sh -a aio_tio
+aio02 aio_tio
diff --git a/testcases/kernel/io/aio/aio02/Makefile 
b/testcases/kernel/io/aio/aio02/Makefile
index e897d84..7d71634 100644
--- a/testcases/kernel/io/aio/aio02/Makefile
+++ b/testcases/kernel/io/aio/aio02/Makefile
@@ -27,8 +27,6 @@ include $(top_srcdir)/include/mk/testcases.mk
 # Needed for common.h...
 CPPFLAGS               += -D_GNU_SOURCE
 
-INSTALL_TARGETS                := runfstests.sh
-
 LDLIBS                 += $(AIO_LIBS)
 
 FILTER_OUT_MAKE_TARGETS        := main
diff --git a/testcases/kernel/io/aio/aio02/README 
b/testcases/kernel/io/aio/aio02/README
index f56347d..addec27 100644
--- a/testcases/kernel/io/aio/aio02/README
+++ b/testcases/kernel/io/aio/aio02/README
@@ -2,7 +2,7 @@ This program will test Asynchronous I/O support by kernel 2.5 .
 make the program
        make
 execute the test
-       ./runfstests.sh cases/aio_tio
+       ./aio_tio
 
 
 NOTE:
diff --git a/testcases/kernel/io/aio/aio02/aio_tio.c 
b/testcases/kernel/io/aio/aio02/aio_tio.c
index 1627451..dea4d5b 100644
--- a/testcases/kernel/io/aio/aio02/aio_tio.c
+++ b/testcases/kernel/io/aio/aio02/aio_tio.c
@@ -17,7 +17,7 @@
 *  Foundation,
 *
 *  FILE        : aio_tio
-*  USAGE       : runfstest case/aio_tio
+*  USAGE       : ./aio_tio
 *
 *  DESCRIPTION : This program will test Asynchronous I/O for 2.5 Kernel 
infrastructure
 *  REQUIREMENTS:
@@ -213,7 +213,7 @@ int test_main(void)
        int     status = 0 ;
 
        tst_resm(TINFO, "Running test 1\n");
-       status = io_tio("testdir/file1",
+       status = io_tio("file1",
                        O_TRUNC | O_DIRECT | O_WRONLY | O_CREAT | O_LARGEFILE,
                        AIO_MAXIO, IO_CMD_PWRITE);
        if (status) {
@@ -221,42 +221,42 @@ int test_main(void)
        }
 
        tst_resm(TINFO, "Running test 2\n");
-       status = io_tio("testdir/file1", O_RDONLY | O_DIRECT | O_LARGEFILE,
+       status = io_tio("file1", O_RDONLY | O_DIRECT | O_LARGEFILE,
                        AIO_MAXIO, IO_CMD_PREAD);
        if (status) {
                return status;
        }
 
        tst_resm(TINFO, "Running test 3\n");
-       status = io_tio("testdir/file1", O_TRUNC | O_RDWR,
+       status = io_tio("file1", O_TRUNC | O_RDWR,
                        AIO_MAXIO, IO_CMD_PWRITE);
        if (status) {
                return status;
        }
 
        tst_resm(TINFO, "Running test 4\n");
-       status = io_tio("testdir/file1", O_RDWR,
+       status = io_tio("file1", O_RDWR,
                        AIO_MAXIO, IO_CMD_PREAD);
        if (status) {
                return status;
        }
 
        tst_resm(TINFO, "Running test 5\n");
-       status = io_tio("testdir/file1", O_TRUNC | O_WRONLY,
+       status = io_tio("file1", O_TRUNC | O_WRONLY,
                        AIO_MAXIO, IO_CMD_PWRITE);
        if (status) {
                return status;
        }
 
        tst_resm(TINFO, "Running test 6 \n");
-       status = io_tio("testdir/file1", O_RDONLY,
+       status = io_tio("file1", O_RDONLY,
                        AIO_MAXIO, IO_CMD_PREAD);
        if (status) {
                return status;
        }
 
        tst_resm(TINFO, "Running test 7 \n");
-       status = io_tio("testdir/file2",
+       status = io_tio("file2",
                        O_TRUNC | O_DIRECT | O_WRONLY | O_CREAT | O_LARGEFILE,
                        AIO_MAXIO, IO_CMD_FSYNC);
        if (status) {
@@ -264,7 +264,7 @@ int test_main(void)
        }
 
        tst_resm(TINFO, "Running test 8 \n");
-       status = io_tio("testdir/file2",
+       status = io_tio("file2",
                        O_TRUNC | O_DIRECT | O_WRONLY | O_CREAT | O_LARGEFILE,
                        AIO_MAXIO, IO_CMD_FDSYNC);
        if (status) {
@@ -274,4 +274,4 @@ int test_main(void)
        return status;
 }
 
-#endif
\ No newline at end of file
+#endif
diff --git a/testcases/kernel/io/aio/aio02/cases/common.h 
b/testcases/kernel/io/aio/aio02/cases/common.h
deleted file mode 100644
index fd8d921..0000000
--- a/testcases/kernel/io/aio/aio02/cases/common.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/param.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <sys/select.h>
-#if HAVE_LIBAIO_H
-#include <libaio.h>
-#endif
-#include <sys/uio.h>
-#include <assert.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <string.h>
-
-/* Fatal error handler */
-static void io_error(const char *func, int rc)
-{
-       if (rc == -ENOSYS)
-               fprintf(stderr, "AIO not in this kernel\n");
-       else if (rc < 0)
-               fprintf(stderr, "%s: %s\n", func, strerror(-rc));
-       else
-               fprintf(stderr, "%s: error %d\n", func, rc);
-       
-       exit(1);
-}
diff --git a/testcases/kernel/io/aio/aio02/main.c 
b/testcases/kernel/io/aio/aio02/main.c
index 06d63d8..5970527 100644
--- a/testcases/kernel/io/aio/aio02/main.c
+++ b/testcases/kernel/io/aio/aio02/main.c
@@ -23,14 +23,16 @@ int test_main(void);
 
 int main(void)
 {
+       tst_tmpdir();
+
        test_main();
+
+       tst_rmdir();
        tst_exit();
 }
 #else
 int main(void)
 {
        tst_brkm(TCONF, NULL, "libaio missing");
-
-       tst_exit();
 }
-#endif
\ No newline at end of file
+#endif
diff --git a/testcases/kernel/io/aio/aio02/runfstests.sh 
b/testcases/kernel/io/aio/aio02/runfstests.sh
deleted file mode 100755
index 07a40ad..0000000
--- a/testcases/kernel/io/aio/aio02/runfstests.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/sh
-
-echo "Starting the Tests"
-
-passes=0
-fails=0
-
-if [ ! -d testdir ]; then
-       mkdir -m 777 testdir
-fi
-
-echo "Test run starting at " `date`
-
-usage() 
-{
-       cat <<-END >&2
-       usage: ${0##*/} [ -a test name ] 
-
-       example: ${0##*/} -a cases/aio_tio
-
-END
-       exit
-}
-
-while getopts :a: arg; do
-case $arg in
-       a)
-               this_test=$OPTARG;;
-       \?)
-               echo "************** Help Info: ********************"
-               usage;;
-esac
-done
-
-if [ ! -n "$this_test"  ]; then
-       cat <<EOF
-${0##*/} : missing the test program. You must pass a test path/name for testing
-EOF
-       usage
-       exit 1
-fi
-
-#Execute only once at present circumstances
-#while [ $# -ge 1 ] ; do
-       echo "Starting $this_test"
-       $this_test 
-       res=$?
-       if [ $res -eq 0 ] ; then
-               : $(( passes += 1 ))
-       else
-               : $(( fails += 1 ))
-       fi
-#done
-
-echo "Pass: $passes Fail: $fails"
-echo "Test run complete at" `date`
-
-rm -rf testdir
-- 
1.7.1

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to