generic/454: stop the test if we run out of space
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 20 Mar 2019 00:45:07 +0000 (17:45 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sat, 23 Mar 2019 13:27:12 +0000 (21:27 +0800)
Certain filesystems (ext4 w/ 1k block size) can run out of space while
running this test because they have very limited xattr storage
capabilities.  If we run out of space while setting an attr, don't
bother continuing the test.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/454

index 4a0936c5da244256a1e573b87ae4af535af1015a..01986d6be9d20a240cb248d795170ec25c6ccbfe 100755 (executable)
@@ -48,7 +48,12 @@ setf() {
        key="$(echo -e "$1")"
        value="$2"
 
-       $SETFATTR_PROG -n "user.${key}" -v "${value}" "${testfile}"
+       $SETFATTR_PROG -n "user.${key}" -v "${value}" "${testfile}" > $tmp.output 2>&1
+       if [ $? -ne 0 ]; then
+               grep -q 'No space left on device' $tmp.output && \
+                       _notrun "ran out of space"
+               cat $tmp.output
+       fi
        echo "Storing ${key} ($(hexbytes "${key}")) -> ${value}" >> $seqres.full
 }