abstract out multiple quota .seq files into a shared common routine.
authorNathan Scott <nathans@sgi.com>
Tue, 22 May 2001 06:07:23 +0000 (06:07 +0000)
committerNathan Scott <nathans@sgi.com>
Tue, 22 May 2001 06:07:23 +0000 (06:07 +0000)
018
check
common.dump
common.rc

diff --git a/018 b/018
index 8b7fa10ea373937d1e77c15aed8e17e7bcce2fb5..ad7763e2e83bb460fe1ae04f8972291172db3914 100755 (executable)
--- a/018
+++ b/018
@@ -128,20 +128,7 @@ _full " mount"
 mount -t xfs $SCRATCH_DEV $SCRATCH_MNT      >>$seq.full 2>&1 \
     || _fail "mount failed"
 
 mount -t xfs $SCRATCH_DEV $SCRATCH_MNT      >>$seq.full 2>&1 \
     || _fail "mount failed"
 
-if src/feature -U $SCRATCH_DEV
-then
-       if src/feature -G $SCRATCH_DEV
-       then
-               ln $seq.ugquota $seq.out
-       else
-               ln $seq.usrquota $seq.out
-       fi
-elif src/feature -G $SCRATCH_DEV
-then
-       ln $seq.grpquota $seq.out
-else
-       ln $seq.noquota $seq.out
-fi
+_setup_seq_out
 
 # generate some log traffic - but not too much - life gets a little
 # more complicated if the log wraps around. This traffic is
 
 # generate some log traffic - but not too much - life gets a little
 # more complicated if the log wraps around. This traffic is
diff --git a/check b/check
index 033128cf326ef969af15a258a017b9b36135cc56..515c41263cc9a76c94e590874f7f945dfb381bdf 100755 (executable)
--- a/check
+++ b/check
@@ -159,7 +159,7 @@ timestamp=false
 
 if [ ! -z "$MOUNT_OPTIONS" ]
 then
 
 if [ ! -z "$MOUNT_OPTIONS" ]
 then
-    echo "check: \$MOUNT_OPTIONS specifed - \"$MOUNT_OPTIONS\""
+    echo "check: \$MOUNT_OPTIONS specified - \"$MOUNT_OPTIONS\""
     umount $TEST_DEV
     # call the overridden mount - make sure the FS starts as
     # the same as we'll set it later.
     umount $TEST_DEV
     # call the overridden mount - make sure the FS starts as
     # the same as we'll set it later.
index 6f834908391510193ebef7aaf3dd1680e959f5c6..76de90618ca72f0e44f6033d06061b07ad9f1d6b 100644 (file)
@@ -473,6 +473,7 @@ _do_create_dumpdir_fill()
 _create_dumpdir_fill()
 {
     _wipe_fs
 _create_dumpdir_fill()
 {
     _wipe_fs
+    _setup_seq_out
     _mk_fillconfig1
     _do_create_dumpdir_fill
     _stable_fs
     _mk_fillconfig1
     _do_create_dumpdir_fill
     _stable_fs
@@ -481,6 +482,7 @@ _create_dumpdir_fill()
 _create_dumpdir_fill2()
 {
     _wipe_fs
 _create_dumpdir_fill2()
 {
     _wipe_fs
+    _setup_seq_out
     _mk_fillconfig2
     _do_create_dumpdir_fill
     _stable_fs
     _mk_fillconfig2
     _do_create_dumpdir_fill
     _stable_fs
@@ -489,6 +491,7 @@ _create_dumpdir_fill2()
 _create_dumpdir_fill_perm()
 {
     _wipe_fs
 _create_dumpdir_fill_perm()
 {
     _wipe_fs
+    _setup_seq_out
     _mk_fillconfig_perm
     _do_create_dumpdir_fill
     _stable_fs
     _mk_fillconfig_perm
     _do_create_dumpdir_fill
     _stable_fs
@@ -635,6 +638,7 @@ _dump_filter()
       -e 's/date:[     ].*/date: DATE/'       \
       -e 's/dump begun .*/dump begun DATE/'    \
       -e 's/[0-9][0-9]* seconds/SECS seconds/' \
       -e 's/date:[     ].*/date: DATE/'       \
       -e 's/dump begun .*/dump begun DATE/'    \
       -e 's/[0-9][0-9]* seconds/SECS seconds/' \
+      -e 's/restore.[0-9][0-9]*/restore.PID/' \
       -e '/: dump size/s/[1-9][0-9]*/NUM/'     \
       -e '/dump size:/s/[1-9][0-9]*/NUM/'      \
       -e '/media file size/s/[1-9][0-9]*/NUM/' \
       -e '/: dump size/s/[1-9][0-9]*/NUM/'     \
       -e '/dump size:/s/[1-9][0-9]*/NUM/'      \
       -e '/media file size/s/[1-9][0-9]*/NUM/' \
index 5e3f0b5ea2a3c40e8397a98e62cb18b475c6d592..b7d0e563b0b6bea1bdb8db620b3c63350c894fe8 100644 (file)
--- a/common.rc
+++ b/common.rc
@@ -419,9 +419,37 @@ _xfs_mounted()
     fi
 }
 
     fi
 }
 
+
+# setup the .out file link, depending on which form of quota is
+# enabled as this often influences how the test output appears.
+# [NB: SCRATCH_DEV must be mounted for this to work]
+# 
+_setup_seq_out()
+{
+    # this lets us phase use of this into the dump/restore tests easier...
+    [ -f $seq.ugquota -a -f $seq.noquota -a $seq.usrquota -a $seq.grpquota ] \
+       || return
+
+    rm -f $seq.out
+    if src/feature -U $SCRATCH_DEV
+    then
+       if src/feature -G $SCRATCH_DEV
+       then
+           ln $seq.ugquota $seq.out
+       else
+           ln $seq.usrquota $seq.out
+       fi
+    elif src/feature -G $SCRATCH_DEV
+    then
+       ln $seq.grpquota $seq.out
+    else
+       ln $seq.noquota $seq.out
+    fi
+}
+
+
 # remount a FS to a new mode (ro or rw)
 #
 # remount a FS to a new mode (ro or rw)
 #
-
 _remount()
 {
     if [ $# -ne 2 ]
 _remount()
 {
     if [ $# -ne 2 ]