common: support black listing fs in _supported_fs()
[xfstests-dev.git] / common / rc
index a8252c7f6eedb070ef12afa52f7555eca178fd4a..eda5fcff34a0c2986a1b988a51e695c2332db4ee 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1585,19 +1585,29 @@ _fail()
 
 # tests whether $FSTYP is one of the supported filesystems for a test
 #
-_supported_fs()
+_check_supported_fs()
 {
-    local f
+       local res=1
+       local f
 
-    for f
-    do
-       if [ "$f" = "$FSTYP" -o "$f" = "generic" ]
-       then
-           return
-       fi
-    done
+       for f; do
+               # ^FS means black listed fs
+               if [ "$f" = "^$FSTYP" ]; then
+                       return 1
+               elif [ "$f" = "generic" ] || [[ "$f" == "^"* ]]; then
+                       # ^FS implies "generic ^FS"
+                       res=0
+               elif [ "$f" = "$FSTYP" ]; then
+                       return 0
+               fi
+       done
+       return $res
+}
 
-    _notrun "not suitable for this filesystem type: $FSTYP"
+_supported_fs()
+{
+       _check_supported_fs $* || \
+               _notrun "not suitable for this filesystem type: $FSTYP"
 }
 
 _check_if_dev_already_mounted()