Permalink
Browse files

Ported script snapshot_001_pos.ksh snapshot_002_pos.ksh snapshot_004_…

…pos.ksh snapshot_005_pos.ksh setup.ksh snapshot.cfg from snapshot directory.
  • Loading branch information...
1 parent c33d532 commit 26fd41a7656d5198cdcf0dc8948925debf879baf @vikramjadhav vikramjadhav committed Jan 8, 2011
@@ -27,16 +27,22 @@
# ident "@(#)setup.ksh 1.2 07/01/09 SMI"
#
-#. $STF_SUITE/include/libtest.kshlib
. $STF_SUITE/commands.cfg
. $STF_SUITE/include/libtest.kshlib
. $STF_SUITE/include/default_common_varible.kshlib
-#. $STF_SUITE/STF/usr/src/tools/stf/contrib/include/logapi.kshlib
-. /home/kqinfo/ZFS-test/ZFS-Test_Suite/STF/usr/src/tools/stf/contrib/include/logapi.kshlib
DISK=$1
-#default_container_volume_setup ${DISK}
+if [ $(id -u) != 0 ]; then
+ echo "You must run as root"
+ exit 1;
+fi
+
+if [ $# != 1 ]; then
+ echo "Usage : ./setup.ksh <diskname>"
+ exit 1;
+fi
+
default_setup $DISK
@@ -39,7 +39,8 @@ export TESTCLONE2=testclone2$$
export TESTFILE=testfile$$
export TESTFILE1=testfile1$$
export SNAPROOT=".zfs/snapshot"
-export FILE_WRITE=file_write
+export FILE_WRITE=${STF_SUITE}/bin/file_write
+
export SNAPPOOL="$TESTPOOL@$TESTSNAP"
export SNAPFS="$TESTPOOL/$TESTFS@$TESTSNAP"
@@ -55,7 +56,8 @@ export VOLSIZE=1gb
export BLOCKSZ=8192
export NUM_WRITES=20
export DATA=0
-export LIMIT=524288 # tolerance measured in bytes, 512K
+export LIMIT=524288 # tolerance measured in bytes, 512K
export FSQUOTA=500m
export FILESIZE=400m
export FILESIZE1=200m
+
@@ -26,12 +26,9 @@
#
# ident "@(#)snapshot_001_pos.ksh 1.2 07/01/09 SMI"
#
-#. $STF_SUITE/include/libtest.kshlib
. $STF_SUITE/commands.cfg
. $STF_SUITE/include/libtest.kshlib
. $STF_SUITE/include/default_common_varible.kshlib
-#. $STF_SUITE/STF/usr/src/tools/stf/contrib/include/logapi.kshlib
-. /home/kqinfo/ZFS-test/ZFS-Test_Suite/STF/usr/src/tools/stf/contrib/include/logapi.kshlib
. $STF_SUITE/tests/functional/snapshot/snapshot.cfg
@@ -87,7 +84,7 @@ log_assert "Verify a file system snapshot is identical to original."
log_onexit cleanup
log_note "Create a file in the zfs filesystem..."
-log_must ./$FILE_WRITE -o create -f $TESTDIR/$TESTFILE -b $BLOCKSZ -c $NUM_WRITES -d $DATA
+log_must $FILE_WRITE -o create -f $TESTDIR/$TESTFILE -b $BLOCKSZ -c $NUM_WRITES -d $DATA
log_note "Sum the file, save for later comparison..."
FILE_SUM=`$SUM -r $TESTDIR/$TESTFILE | $AWK '{ print $1 }'`
@@ -98,7 +95,7 @@ echo $SNAPFS
log_must $ZFS snapshot $SNAPFS
log_note "Append to the original file..."
-log_must ./$FILE_WRITE -o append -f $TESTDIR/$TESTFILE -b $BLOCKSZ -c $NUM_WRITES -d $DATA
+log_must $FILE_WRITE -o append -f $TESTDIR/$TESTFILE -b $BLOCKSZ -c $NUM_WRITES -d $DATA
SNAP_FILE_SUM=`$SUM -r $SNAPDIR/$TESTFILE | $AWK '{ print $1 }'`
if [[ $SNAP_FILE_SUM -ne $FILE_SUM ]]; then
@@ -29,8 +29,6 @@
. $STF_SUITE/commands.cfg
. $STF_SUITE/include/libtest.kshlib
. $STF_SUITE/include/default_common_varible.kshlib
-#. $STF_SUITE/STF/usr/src/tools/stf/contrib/include/logapi.kshlib
-. /home/kqinfo/ZFS-test/ZFS-Test_Suite/STF/usr/src/tools/stf/contrib/include/logapi.kshlib
. $STF_SUITE/tests/functional/snapshot/snapshot.cfg
@@ -106,7 +104,7 @@ log_note "Create files in the zfs filesystem..."
typeset i=1
while [ $i -lt $COUNT ]; do
- log_must ./$FILE_WRITE -o $OP -f $TESTDIR/file$i -b $BLOCKSZ -c $NUM_WRITES -d $DATA
+ log_must $FILE_WRITE -o $OP -f $TESTDIR/file$i -b $BLOCKSZ -c $NUM_WRITES -d $DATA
(( i = i + 1 ))
done
@@ -26,7 +26,10 @@
#
# ident "@(#)snapshot_004_pos.ksh 1.2 07/01/09 SMI"
#
+. $STF_SUITE/commands.cfg
. $STF_SUITE/include/libtest.kshlib
+. $STF_SUITE/include/default_common_varible.kshlib
+. $STF_SUITE/tests/functional/snapshot/snapshot.cfg
################################################################################
#
@@ -26,7 +26,12 @@
#
# ident "@(#)snapshot_005_pos.ksh 1.2 07/01/09 SMI"
#
+
+. $STF_SUITE/commands.cfg
. $STF_SUITE/include/libtest.kshlib
+. $STF_SUITE/include/default_common_varible.kshlib
+. $STF_SUITE/tests/functional/snapshot/snapshot.cfg
+
################################################################################
#
@@ -78,21 +83,22 @@ log_assert "Verify that a snapshot of a dataset is identical to " \
log_onexit cleanup
log_note "Create a file in the zfs filesystem..."
-log_must $FILE_WRITE -o create -f $TESTDIR1/$TESTFILE -b $BLOCKSZ \
+log_must $FILE_WRITE -o create -f $TESTDIR/$TESTFILE -b $BLOCKSZ \
-c $NUM_WRITES -d $DATA
log_note "Sum the file, save for later comparison..."
-FILE_SUM=`$SUM -r $TESTDIR1/$TESTFILE | $AWK '{ print $1 }'`
+FILE_SUM=`$SUM -r $TESTDIR/$TESTFILE | $AWK '{ print $1 }'`
log_note "FILE_SUM = $FILE_SUM"
log_note "Create a snapshot and mount it..."
-log_must $ZFS snapshot $SNAPCTR
+
+log_must $ZFS snapshot $SNAPFS
log_note "Append to the original file..."
-log_must $FILE_WRITE -o append -f $TESTDIR1/$TESTFILE -b $BLOCKSZ \
+log_must $FILE_WRITE -o append -f $TESTDIR/$TESTFILE -b $BLOCKSZ \
-c $NUM_WRITES -d $DATA
-SNAP_FILE_SUM=`$SUM -r $SNAPDIR1/$TESTFILE | $AWK '{ print $1 }'`
+SNAP_FILE_SUM=`$SUM -r $SNAPDIR/$TESTFILE | $AWK '{ print $1 }'`
if [[ $SNAP_FILE_SUM -ne $FILE_SUM ]]; then
log_fail "Sums do not match, aborting!! ($SNAP_FILE_SUM != $FILE_SUM)"
fi

0 comments on commit 26fd41a

Please sign in to comment.