Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 5e741a9578e7065c392847bf8e23d98d4402ea95 1 parent d4d1fad
vikramjadhav vikramjadhav authored
1  ZFS-Test_Suite/tests/functional/no_space/enospc.cfg
@@ -35,3 +35,4 @@ export BLOCKSZ=8192
35 35 export NUM_WRITES=655360
36 36 export DATA=0
37 37 export SLICE=0
  38 +export FILE_WRITE=${STF_SUITE}/bin/file_write
12 ZFS-Test_Suite/tests/functional/no_space/enospc_001_pos.ksh
@@ -29,7 +29,6 @@
29 29 . $STF_SUITE/include/libtest.kshlib
30 30 . $STF_SUITE/include/default_common_varible.kshlib
31 31 . $STF_SUITE/tests/functional/no_space/enospc.cfg
32   -#. $STF_SUITE/include/default_common_varible.kshlib
33 32
34 33 ################################################################################
35 34 #
@@ -60,22 +59,19 @@
60 59
61 60 #verify_runnable "both"
62 61
63   -#log_assert "ENOSPC is returned when file system is full."
  62 +log_assert "ENOSPC is returned when file system is full."
64 63 log_must $ZFS set compression=off $TESTPOOL/$TESTFS
65 64
66 65 log_note "Writing file: $TESTFILE0 until ENOSPC."
67   -echo $TESTPOOL
68   -echo $TESTFS
69   -./$FILE_WRITE -o create -f $TESTDIR/$TESTFILE0 -b $BLOCKSZ \
  66 +$FILE_WRITE -o create -f $TESTDIR/$TESTFILE0 -b $BLOCKSZ \
70 67 -c $NUM_WRITES -d $DATA
71 68 ret=$?
72   -echo $TESTDIR
73   -echo $TESTFILE0
  69 +
74 70 (( $ret != $ENOSPC )) && \
75 71 log_fail "$TESTFILE0 returned: $ret rather than ENOSPC."
76 72
77 73 log_note "Write another file: $TESTFILE1 but expect ENOSPC."
78   -./$FILE_WRITE -o create -f $TESTDIR/$TESTFILE1 -b $BLOCKSZ \
  74 +$FILE_WRITE -o create -f $TESTDIR/$TESTFILE1 -b $BLOCKSZ \
79 75 -c $NUM_WRITES -d $DATA
80 76 ret=$?
81 77
13 ZFS-Test_Suite/tests/functional/no_space/setup.ksh
@@ -32,8 +32,21 @@
32 32 . $STF_SUITE/include/default_common_varible.kshlib
33 33 . $STF_SUITE/STF/usr/src/tools/stf/contrib/include/logapi.kshlib
34 34 . $STF_SUITE/tests/functional/no_space/enospc.cfg
  35 +
  36 +
  37 +if [ $(id -u) != 0 ]; then
  38 + echo "You must run as root"
  39 + exit 1;
  40 +fi
  41 +
  42 +if [ $# != 1 ]; then
  43 + echo "Usage : ./grow_pool_001_pos.ksh <diskname1>"
  44 + exit 1;
  45 +fi
  46 +
35 47 verify_runnable "global"
36 48
  49 +
37 50 #if ! $(is_physical_device $DISKS) ; then
38 51 # log_unsupported "This directory cannot be run on raw files."
39 52 #fi

0 comments on commit 5e741a9

Please sign in to comment.
Something went wrong with that request. Please try again.