Script isofs.sh looks like a not bad candidate for
testing iso9660 file system.

Therefore moved it into a separate directory and declared
a new test case entry in runtest/fs.

Signed-off-by: Stanislav Kholmanskikh <[email protected]>
---
 runtest/fs                           |    2 +
 testcases/kernel/fs/iso9660/Makefile |   25 +++++
 testcases/kernel/fs/iso9660/isofs.sh |  187 ++++++++++++++++++++++++++++++++++
 testscripts/isofs.sh                 |  187 ----------------------------------
 4 files changed, 214 insertions(+), 187 deletions(-)
 create mode 100644 testcases/kernel/fs/iso9660/Makefile
 create mode 100755 testcases/kernel/fs/iso9660/isofs.sh
 delete mode 100755 testscripts/isofs.sh

diff --git a/runtest/fs b/runtest/fs
index 438c79c..9687ffa 100644
--- a/runtest/fs
+++ b/runtest/fs
@@ -74,3 +74,5 @@ fs_racer fs_racer.sh -t 5
 
 #Run the Quota Remount Test introduced in linux-2.6.26
 quota_remount_test01 quota_remount_test01.sh
+
+iso9660 isofs.sh
diff --git a/testcases/kernel/fs/iso9660/Makefile 
b/testcases/kernel/fs/iso9660/Makefile
new file mode 100644
index 0000000..bba35e6
--- /dev/null
+++ b/testcases/kernel/fs/iso9660/Makefile
@@ -0,0 +1,25 @@
+#
+#  Copyright (c) 2005-2014 Linux Test Project
+#
+#  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
+#
+
+top_srcdir             ?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+INSTALL_TARGETS                := isofs.sh
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/fs/iso9660/isofs.sh 
b/testcases/kernel/fs/iso9660/isofs.sh
new file mode 100755
index 0000000..fd42a3c
--- /dev/null
+++ b/testcases/kernel/fs/iso9660/isofs.sh
@@ -0,0 +1,187 @@
+#!/bin/bash
+
+
+##############################################################
+#
+#  Copyright (c) International Business Machines  Corp., 2003
+#
+#  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
+#
+#  FILE        : isofs.sh
+#  USAGE       : isofs.sh <optional> -n (no clean up)
+#
+#  DESCRIPTION : A script that will test isofs on Linux system.
+#                It makes ISO9660 file system with different options and also
+#                mounts the ISO9660 file system with different mount options.
+#
+#  REQUIREMENTS:
+#
+#  HISTORY     :
+#      06/27/2003 Prakash Narayana ([email protected])
+#      07/28/2005 Michael Reed ([email protected])
+#      - Changed the directory where the filesytems were being created
+#        from /etc to copying /etc to /tmp/for_isofs_test/etc and
+#        creating the file systems there
+#      - Added the -n option to not remove the directories created for
+#        debugging purposes
+#      - Added -d option to specify a different directory to copy to /tmp
+#        to make the file system
+#
+#  CODE COVERAGE: 40.5% - fs/isofs (Total Coverage)
+#
+#                 23.7% - fs/isofs/dir.c
+#                 46.0% - fs/isofs/inode.c
+#                 22.9% - fs/isofs/joliet.c
+#                 50.0% - fs/isofs/namei.c
+#                 38.5% - fs/isofs/rock.c
+#                 10.7% - fs/isofs/util.c
+#
+##############################################################
+
+USAGE="$0"
+NO_CLEANUP=""
+
+  usage()
+  {
+    echo "USAGE: $USAGE <optional> -n -h -d [directory name]"
+    exit
+  }
+
+#Initialize directory variables
+    TMPDIR=${TMPDIR:-/tmp}
+    MNT_POINT="$TMPDIR/isofs_$$"
+    COPY_DIR="/etc/"
+    TEMP_DIR="$TMPDIR/for_isofs_test"
+    MAKE_FILE_SYS_DIR=$TEMP_DIR$COPY_DIR
+
+   while getopts :hnd: arg
+      do  case $arg in
+         d)
+             COPY_DIR=$OPTARG
+            MAKE_FILE_SYS_DIR=${TEMP_DIR}${COPY_DIR}
+           ;;
+         h)
+           echo ""
+            echo "n - The directories created will not be removed"
+            echo "d - Specify a directory to copy into $TEMP_DIR"
+           echo "h - Help options"
+           echo ""
+           usage
+           echo ""
+           ;;
+         n)
+           NO_CLEANUP="no"
+           ;;
+        esac
+    done
+
+
+##############################################################
+#
+# Make sure that uid=root is running this script.
+# Validate the command line arguments.
+#
+##############################################################
+
+if [ $UID != 0 ]
+then
+       echo "FAILED: Must have root access to execute this script"
+       exit 1
+fi
+
+
+      mkdir -p -m 777 $MNT_POINT
+      mkdir -p $MAKE_FILE_SYS_DIR
+
+
+       if [ -e "$COPY_DIR" ]; then
+               cp -rf $COPY_DIR* $MAKE_FILE_SYS_DIR
+       else
+               echo "$COPY_DIR not found"
+               echo "use the -d option to copy a different directory into"
+               echo "/tmp to makethe ISO9660 file system with different"
+                echo "options"
+               usage
+       fi
+
+
+
+# Make ISO9660 file system with different options.
+# Mount the ISO9660 file system with different mount options.
+
+for mkisofs_opt in \
+       " " \
+       "-J" \
+       "-hfs -D" \
+       " -R " \
+       "-R -J" \
+       "-f -l -D -J -L -R" \
+       "-allow-lowercase -allow-multidot -iso-level 3 -f -l -D -J -L -R"
+do
+        echo "Running mkisofs -o isofs.iso -quiet $mkisofs_opt 
$MAKE_FILE_SYS_DIR  Command"
+       mkisofs -o isofs.iso -quiet $mkisofs_opt $MAKE_FILE_SYS_DIR 2> /dev/null
+       if [ $? != 0 ]
+       then
+               rm -rf isofs.iso $MNT_POINT $TEMP_DIR
+               echo "FAILED: mkisofs -o isofs.iso $mkisofs_opt 
$MAKE_FILE_SYS_DIR failed"
+               exit 1
+       fi
+       for mount_opt in \
+               "loop" \
+               "loop,norock" \
+               "loop,nojoliet" \
+               "loop,block=512,unhide" \
+               "loop,block=1024,cruft" \
+               "loop,block=2048,nocompress" \
+               "loop,check=strict,map=off,gid=bin,uid=bin" \
+               "loop,check=strict,map=acorn,gid=bin,uid=bin" \
+               "loop,check=relaxed,map=normal" \
+               "loop,block=512,unhide,session=2"
+               # "loop,sbsector=32"
+       do
+               echo "Running mount -o $mount_opt isofs.iso $MNT_POINT Command"
+               mount -t iso9660 -o $mount_opt isofs.iso $MNT_POINT
+               if [ $? != 0 ]
+               then
+                       rm -rf isofs.iso $MNT_POINT $TEMP_DIR
+                       echo "FAILED: mount -t iso9660 -o $mount_opt isofs.iso 
$MNT_POINT failed"
+                       exit 1
+               fi
+               echo "Running ls -lR $MNT_POINT Command"
+               ls -lR $MNT_POINT > /dev/null
+               exportfs -i -o no_root_squash,rw *:$MNT_POINT
+               exportfs -u :$MNT_POINT
+               umount $MNT_POINT
+       done
+       rm -rf isofs.iso
+done
+
+#######################################################
+#
+# Just before exit, perform the cleanup.
+#
+#######################################################
+
+  if [ "$NO_CLEANUP" == "no" ]; then
+     echo "$MAKE_FILE_SYS_DIR and $MNT_POINT were not removed"
+     echo "These directories will have to be removed manually"
+  else
+    rm -rf $TEMP_DIR
+    rm -rf $MNT_POINT
+  fi
+
+
+echo "PASSED: $0 passed!"
+exit 0
diff --git a/testscripts/isofs.sh b/testscripts/isofs.sh
deleted file mode 100755
index fd42a3c..0000000
--- a/testscripts/isofs.sh
+++ /dev/null
@@ -1,187 +0,0 @@
-#!/bin/bash
-
-
-##############################################################
-#
-#  Copyright (c) International Business Machines  Corp., 2003
-#
-#  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
-#
-#  FILE        : isofs.sh
-#  USAGE       : isofs.sh <optional> -n (no clean up)
-#
-#  DESCRIPTION : A script that will test isofs on Linux system.
-#                It makes ISO9660 file system with different options and also
-#                mounts the ISO9660 file system with different mount options.
-#
-#  REQUIREMENTS:
-#
-#  HISTORY     :
-#      06/27/2003 Prakash Narayana ([email protected])
-#      07/28/2005 Michael Reed ([email protected])
-#      - Changed the directory where the filesytems were being created
-#        from /etc to copying /etc to /tmp/for_isofs_test/etc and
-#        creating the file systems there
-#      - Added the -n option to not remove the directories created for
-#        debugging purposes
-#      - Added -d option to specify a different directory to copy to /tmp
-#        to make the file system
-#
-#  CODE COVERAGE: 40.5% - fs/isofs (Total Coverage)
-#
-#                 23.7% - fs/isofs/dir.c
-#                 46.0% - fs/isofs/inode.c
-#                 22.9% - fs/isofs/joliet.c
-#                 50.0% - fs/isofs/namei.c
-#                 38.5% - fs/isofs/rock.c
-#                 10.7% - fs/isofs/util.c
-#
-##############################################################
-
-USAGE="$0"
-NO_CLEANUP=""
-
-  usage()
-  {
-    echo "USAGE: $USAGE <optional> -n -h -d [directory name]"
-    exit
-  }
-
-#Initialize directory variables
-    TMPDIR=${TMPDIR:-/tmp}
-    MNT_POINT="$TMPDIR/isofs_$$"
-    COPY_DIR="/etc/"
-    TEMP_DIR="$TMPDIR/for_isofs_test"
-    MAKE_FILE_SYS_DIR=$TEMP_DIR$COPY_DIR
-
-   while getopts :hnd: arg
-      do  case $arg in
-         d)
-             COPY_DIR=$OPTARG
-            MAKE_FILE_SYS_DIR=${TEMP_DIR}${COPY_DIR}
-           ;;
-         h)
-           echo ""
-            echo "n - The directories created will not be removed"
-            echo "d - Specify a directory to copy into $TEMP_DIR"
-           echo "h - Help options"
-           echo ""
-           usage
-           echo ""
-           ;;
-         n)
-           NO_CLEANUP="no"
-           ;;
-        esac
-    done
-
-
-##############################################################
-#
-# Make sure that uid=root is running this script.
-# Validate the command line arguments.
-#
-##############################################################
-
-if [ $UID != 0 ]
-then
-       echo "FAILED: Must have root access to execute this script"
-       exit 1
-fi
-
-
-      mkdir -p -m 777 $MNT_POINT
-      mkdir -p $MAKE_FILE_SYS_DIR
-
-
-       if [ -e "$COPY_DIR" ]; then
-               cp -rf $COPY_DIR* $MAKE_FILE_SYS_DIR
-       else
-               echo "$COPY_DIR not found"
-               echo "use the -d option to copy a different directory into"
-               echo "/tmp to makethe ISO9660 file system with different"
-                echo "options"
-               usage
-       fi
-
-
-
-# Make ISO9660 file system with different options.
-# Mount the ISO9660 file system with different mount options.
-
-for mkisofs_opt in \
-       " " \
-       "-J" \
-       "-hfs -D" \
-       " -R " \
-       "-R -J" \
-       "-f -l -D -J -L -R" \
-       "-allow-lowercase -allow-multidot -iso-level 3 -f -l -D -J -L -R"
-do
-        echo "Running mkisofs -o isofs.iso -quiet $mkisofs_opt 
$MAKE_FILE_SYS_DIR  Command"
-       mkisofs -o isofs.iso -quiet $mkisofs_opt $MAKE_FILE_SYS_DIR 2> /dev/null
-       if [ $? != 0 ]
-       then
-               rm -rf isofs.iso $MNT_POINT $TEMP_DIR
-               echo "FAILED: mkisofs -o isofs.iso $mkisofs_opt 
$MAKE_FILE_SYS_DIR failed"
-               exit 1
-       fi
-       for mount_opt in \
-               "loop" \
-               "loop,norock" \
-               "loop,nojoliet" \
-               "loop,block=512,unhide" \
-               "loop,block=1024,cruft" \
-               "loop,block=2048,nocompress" \
-               "loop,check=strict,map=off,gid=bin,uid=bin" \
-               "loop,check=strict,map=acorn,gid=bin,uid=bin" \
-               "loop,check=relaxed,map=normal" \
-               "loop,block=512,unhide,session=2"
-               # "loop,sbsector=32"
-       do
-               echo "Running mount -o $mount_opt isofs.iso $MNT_POINT Command"
-               mount -t iso9660 -o $mount_opt isofs.iso $MNT_POINT
-               if [ $? != 0 ]
-               then
-                       rm -rf isofs.iso $MNT_POINT $TEMP_DIR
-                       echo "FAILED: mount -t iso9660 -o $mount_opt isofs.iso 
$MNT_POINT failed"
-                       exit 1
-               fi
-               echo "Running ls -lR $MNT_POINT Command"
-               ls -lR $MNT_POINT > /dev/null
-               exportfs -i -o no_root_squash,rw *:$MNT_POINT
-               exportfs -u :$MNT_POINT
-               umount $MNT_POINT
-       done
-       rm -rf isofs.iso
-done
-
-#######################################################
-#
-# Just before exit, perform the cleanup.
-#
-#######################################################
-
-  if [ "$NO_CLEANUP" == "no" ]; then
-     echo "$MAKE_FILE_SYS_DIR and $MNT_POINT were not removed"
-     echo "These directories will have to be removed manually"
-  else
-    rm -rf $TEMP_DIR
-    rm -rf $MNT_POINT
-  fi
-
-
-echo "PASSED: $0 passed!"
-exit 0
-- 
1.7.9.5


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to