Script isofs.sh looks like a not bad candidate for
testing an 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 |   26 ++++++
 testcases/kernel/fs/iso9660/isofs.sh |  158 ++++++++++++++++++++++++++++++++++
 testscripts/isofs.sh                 |  158 ----------------------------------
 4 files changed, 186 insertions(+), 158 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..33a8412 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
+
+isofs isofs.sh
diff --git a/testcases/kernel/fs/iso9660/Makefile 
b/testcases/kernel/fs/iso9660/Makefile
new file mode 100644
index 0000000..459b3a4
--- /dev/null
+++ b/testcases/kernel/fs/iso9660/Makefile
@@ -0,0 +1,26 @@
+#
+#  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
+
+MAKE_TARGETS           :=
+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..294d6f0
--- /dev/null
+++ b/testcases/kernel/fs/iso9660/isofs.sh
@@ -0,0 +1,158 @@
+#!/bin/sh
+#
+# Copyright (c) International Business Machines  Corp., 2003
+# Copyright (c) 2014 Oracle and/or its affiliates. All Rights Reserved.
+#
+# 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.
+#
+# Written by Prakash Narayana ([email protected])
+# and Michael Reed ([email protected])
+#
+# 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.
+#
+
+TCID=isofs
+TST_TOTAL=77
+. test.sh
+
+NO_CLEANUP=""
+IS_MOUNTED=""
+
+usage()
+{
+       echo "USAGE: $0 <optional> -n -h -d [directory name]"
+       exit
+}
+
+cleanup()
+{
+       if [ "$NO_CLEANUP" = "no" ]; then
+               tst_resm TINFO "Temporary directory $PWD was not removed"
+       else
+               [ "$IS_MOUNTED" != "yes" ] && tst_rmdir
+       fi
+}
+
+
+COPY_DIR="/etc/"
+
+while getopts :hnd: arg; do
+       case $arg in
+       d)
+               COPY_DIR=$OPTARG
+               ;;
+       h)
+               echo ""
+               echo "n - The directories created will not be removed"
+               echo "d - Specify a directory to copy into /tmp"
+               echo "h - Help options"
+               echo ""
+               usage
+               echo ""
+               ;;
+       n)
+               NO_CLEANUP="no"
+               ;;
+       esac
+done
+
+if [ ! -e "$COPY_DIR" ]; then
+       tst_brkm TCONF "$COPY_DIR not found"
+fi
+
+tst_require_root
+
+tst_tmpdir
+TST_CLEANUP=cleanup
+
+MNT_POINT="$PWD/mnt"
+MAKE_FILE_SYS_DIR="$PWD/tmp/$COPY_DIR"
+
+mkdir -p -m 777 $MNT_POINT
+mkdir -p $MAKE_FILE_SYS_DIR
+
+cp -rf $COPY_DIR* $MAKE_FILE_SYS_DIR
+
+# 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
+       rm -f isofs.iso
+       mkisofs -o isofs.iso -quiet $mkisofs_opt $MAKE_FILE_SYS_DIR 2> /dev/null
+       if [ $? -eq 0 ]; then
+               tst_resm TPASS \
+                       "mkisofs -o isofs.iso -quiet $mkisofs_opt 
$MAKE_FILE_SYS_DIR"
+       else
+               tst_resm TFAIL \
+                       tst_resm TFAIL "mkisofs -o isofs.iso -quiet 
$mkisofs_opt $MAKE_FILE_SYS_DIR"
+               continue
+       fi
+
+       for mount_opt in \
+               "ro" \
+               "norock" \
+               "nojoliet" \
+               "block=512,unhide" \
+               "block=1024,cruft" \
+               "block=2048,nocompress" \
+               "check=strict,map=off,gid=bin,uid=bin" \
+               "check=strict,map=acorn,gid=bin,uid=bin" \
+               "check=relaxed,map=normal" \
+               "block=512,unhide,session=2"
+               # "sbsector=32"
+       do
+               loop_dev=$(losetup --show -f isofs.iso)
+               if [ $? -ne 0 ]; then
+                       tst_brkm TBROK "losetup failed"
+               fi
+
+               mount -t iso9660 -o $mount_opt "$loop_dev" $MNT_POINT
+               if [ $? -ne 0 ]; then
+                       tst_resm TFAIL \
+                               "mount -t iso9660 -o $mount_opt "$loop_dev" 
$MNT_POINT"
+                       continue
+               fi
+               IS_MOUNTED="yes"
+
+               umount $MNT_POINT
+               if [ $? -ne 0 ]; then
+                       tst_resm TFAIL "umount $MNT_POINT"
+               fi
+               IS_MOUNTED="no"
+
+               # Now tearing down the loopback device
+               while /bin/true; do
+                       out=$(LC_ALL=C losetup -d "$loop_dev" 2>&1)
+
+                       if echo "$out" | grep -q -i "No such device"; then
+                               break
+                       fi
+               done
+
+               tst_resm TPASS "mount/umount with \"$mount_opt\" options"
+       done
+done
+
+tst_exit
diff --git a/testscripts/isofs.sh b/testscripts/isofs.sh
deleted file mode 100755
index 294d6f0..0000000
--- a/testscripts/isofs.sh
+++ /dev/null
@@ -1,158 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) International Business Machines  Corp., 2003
-# Copyright (c) 2014 Oracle and/or its affiliates. All Rights Reserved.
-#
-# 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.
-#
-# Written by Prakash Narayana ([email protected])
-# and Michael Reed ([email protected])
-#
-# 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.
-#
-
-TCID=isofs
-TST_TOTAL=77
-. test.sh
-
-NO_CLEANUP=""
-IS_MOUNTED=""
-
-usage()
-{
-       echo "USAGE: $0 <optional> -n -h -d [directory name]"
-       exit
-}
-
-cleanup()
-{
-       if [ "$NO_CLEANUP" = "no" ]; then
-               tst_resm TINFO "Temporary directory $PWD was not removed"
-       else
-               [ "$IS_MOUNTED" != "yes" ] && tst_rmdir
-       fi
-}
-
-
-COPY_DIR="/etc/"
-
-while getopts :hnd: arg; do
-       case $arg in
-       d)
-               COPY_DIR=$OPTARG
-               ;;
-       h)
-               echo ""
-               echo "n - The directories created will not be removed"
-               echo "d - Specify a directory to copy into /tmp"
-               echo "h - Help options"
-               echo ""
-               usage
-               echo ""
-               ;;
-       n)
-               NO_CLEANUP="no"
-               ;;
-       esac
-done
-
-if [ ! -e "$COPY_DIR" ]; then
-       tst_brkm TCONF "$COPY_DIR not found"
-fi
-
-tst_require_root
-
-tst_tmpdir
-TST_CLEANUP=cleanup
-
-MNT_POINT="$PWD/mnt"
-MAKE_FILE_SYS_DIR="$PWD/tmp/$COPY_DIR"
-
-mkdir -p -m 777 $MNT_POINT
-mkdir -p $MAKE_FILE_SYS_DIR
-
-cp -rf $COPY_DIR* $MAKE_FILE_SYS_DIR
-
-# 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
-       rm -f isofs.iso
-       mkisofs -o isofs.iso -quiet $mkisofs_opt $MAKE_FILE_SYS_DIR 2> /dev/null
-       if [ $? -eq 0 ]; then
-               tst_resm TPASS \
-                       "mkisofs -o isofs.iso -quiet $mkisofs_opt 
$MAKE_FILE_SYS_DIR"
-       else
-               tst_resm TFAIL \
-                       tst_resm TFAIL "mkisofs -o isofs.iso -quiet 
$mkisofs_opt $MAKE_FILE_SYS_DIR"
-               continue
-       fi
-
-       for mount_opt in \
-               "ro" \
-               "norock" \
-               "nojoliet" \
-               "block=512,unhide" \
-               "block=1024,cruft" \
-               "block=2048,nocompress" \
-               "check=strict,map=off,gid=bin,uid=bin" \
-               "check=strict,map=acorn,gid=bin,uid=bin" \
-               "check=relaxed,map=normal" \
-               "block=512,unhide,session=2"
-               # "sbsector=32"
-       do
-               loop_dev=$(losetup --show -f isofs.iso)
-               if [ $? -ne 0 ]; then
-                       tst_brkm TBROK "losetup failed"
-               fi
-
-               mount -t iso9660 -o $mount_opt "$loop_dev" $MNT_POINT
-               if [ $? -ne 0 ]; then
-                       tst_resm TFAIL \
-                               "mount -t iso9660 -o $mount_opt "$loop_dev" 
$MNT_POINT"
-                       continue
-               fi
-               IS_MOUNTED="yes"
-
-               umount $MNT_POINT
-               if [ $? -ne 0 ]; then
-                       tst_resm TFAIL "umount $MNT_POINT"
-               fi
-               IS_MOUNTED="no"
-
-               # Now tearing down the loopback device
-               while /bin/true; do
-                       out=$(LC_ALL=C losetup -d "$loop_dev" 2>&1)
-
-                       if echo "$out" | grep -q -i "No such device"; then
-                               break
-                       fi
-               done
-
-               tst_resm TPASS "mount/umount with \"$mount_opt\" options"
-       done
-done
-
-tst_exit
-- 
1.7.1


------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to