]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common: enable tests that require scratch device on CIFS
authorEryu Guan <eguan@redhat.com>
Thu, 11 Dec 2014 23:53:55 +0000 (10:53 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 11 Dec 2014 23:53:55 +0000 (10:53 +1100)
Just like commit

76c5f3c common: re-enable tests that require scratch dev on NFS

Enable tests that require scratch device on CIFS too to get a better
test coverage.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/rc

index d5e3aff0d7765ee0a0d8eac677201e13c15aa814..435f74f4ecc436af28ebbc94d07cf78c38d31093 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -571,7 +571,9 @@ _scratch_mkfs()
         _scratch_cleanup_files
        ;;
     cifs)
-       # do nothing for cifs
+       # unable to re-create CIFS, just remove all files in $SCRATCH_MNT to
+       # avoid EEXIST caused by the leftover files created in previous runs
+        _scratch_cleanup_files
        ;;
     udf)
         $MKFS_UDF_PROG $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null
@@ -1053,7 +1055,13 @@ _require_scratch_nocheck()
                fi
                ;;
        cifs)
-               _notrun "requires a scratch device"
+               echo $SCRATCH_DEV | grep -q "//" > /dev/null 2>&1
+               if [ -z "$SCRATCH_DEV" -o "$?" != "0" ]; then
+                       _notrun "this test requires a valid \$SCRATCH_DEV"
+               fi
+               if [ ! -d "$SCRATCH_MNT" ]; then
+                    _notrun "this test requires a valid \$SCRATCH_MNT"
+               fi
                ;;
        tmpfs)
                if [ -z "$SCRATCH_DEV" -o ! -d "$SCRATCH_MNT" ];