Browse files

Ported script "no_space"

Script Name : enospc_001_pos.ksh
                                                                                                                                                              DESCRIPTION:
 ENOSPC is returned on an attempt to write a second file
 to a file system after a first file was written that terminated
 with ENOSPC on a cleanly initialized file system.

 STRATEGY:
 1. Write a file until the file system is full.
 2. Ensure that ENOSPC is returned.
 3. Write a second file while the file system remains full.
 4. Verify the return code is ENOSPC.
  • Loading branch information...
1 parent d4d1fad commit 5e741a9578e7065c392847bf8e23d98d4402ea95 @vikramjadhav vikramjadhav committed Jan 6, 2011
View
1 ZFS-Test_Suite/tests/functional/no_space/enospc.cfg
@@ -35,3 +35,4 @@ export BLOCKSZ=8192
export NUM_WRITES=655360
export DATA=0
export SLICE=0
+export FILE_WRITE=${STF_SUITE}/bin/file_write
View
12 ZFS-Test_Suite/tests/functional/no_space/enospc_001_pos.ksh
@@ -29,7 +29,6 @@
. $STF_SUITE/include/libtest.kshlib
. $STF_SUITE/include/default_common_varible.kshlib
. $STF_SUITE/tests/functional/no_space/enospc.cfg
-#. $STF_SUITE/include/default_common_varible.kshlib
################################################################################
#
@@ -60,22 +59,19 @@
#verify_runnable "both"
-#log_assert "ENOSPC is returned when file system is full."
+log_assert "ENOSPC is returned when file system is full."
log_must $ZFS set compression=off $TESTPOOL/$TESTFS
log_note "Writing file: $TESTFILE0 until ENOSPC."
-echo $TESTPOOL
-echo $TESTFS
-./$FILE_WRITE -o create -f $TESTDIR/$TESTFILE0 -b $BLOCKSZ \
+$FILE_WRITE -o create -f $TESTDIR/$TESTFILE0 -b $BLOCKSZ \
-c $NUM_WRITES -d $DATA
ret=$?
-echo $TESTDIR
-echo $TESTFILE0
+
(( $ret != $ENOSPC )) && \
log_fail "$TESTFILE0 returned: $ret rather than ENOSPC."
log_note "Write another file: $TESTFILE1 but expect ENOSPC."
-./$FILE_WRITE -o create -f $TESTDIR/$TESTFILE1 -b $BLOCKSZ \
+$FILE_WRITE -o create -f $TESTDIR/$TESTFILE1 -b $BLOCKSZ \
-c $NUM_WRITES -d $DATA
ret=$?
View
13 ZFS-Test_Suite/tests/functional/no_space/setup.ksh
@@ -32,8 +32,21 @@
. $STF_SUITE/include/default_common_varible.kshlib
. $STF_SUITE/STF/usr/src/tools/stf/contrib/include/logapi.kshlib
. $STF_SUITE/tests/functional/no_space/enospc.cfg
+
+
+if [ $(id -u) != 0 ]; then
+ echo "You must run as root"
+ exit 1;
+fi
+
+if [ $# != 1 ]; then
+ echo "Usage : ./grow_pool_001_pos.ksh <diskname1>"
+ exit 1;
+fi
+
verify_runnable "global"
+
#if ! $(is_physical_device $DISKS) ; then
# log_unsupported "This directory cannot be run on raw files."
#fi

0 comments on commit 5e741a9

Please sign in to comment.