Test for unsupported file systems and skip them (no false negatives)
authorErez_Zadok <ezk@cs.sunysb.edu>
Thu, 2 Aug 2007 03:01:24 +0000 (23:01 -0400)
committerErez_Zadok <ezk@cs.sunysb.edu>
Thu, 2 Aug 2007 03:01:24 +0000 (23:01 -0400)
run-tests

index 02723b5f6144629c338b02ffa07ed03ffd3183d7..448bd1b55e6f5299bc1bf6283b9737a6bd2ebbb2 100755 (executable)
--- a/run-tests
+++ b/run-tests
@@ -188,6 +188,32 @@ function do_umount
     esac
 }
 
+# test if file system is supported, skip if not
+function test_fs
+{
+    for i in $* ; do
+       # translate file system names to actual module names
+       case $i in
+           ext4* ) fs="ext4dev" ;;
+           nfs4 ) fs=$i ;;
+           nfs* ) fs="nfs" ;;
+           * ) fs=$i ;;
+       esac
+       # see if f/s is already supported
+       egrep -q "[^a-z]$fs$" /proc/filesystems && return 0
+       # otherwise try to load the module and ...
+       modprobe $fs 2> /dev/null
+       # try one more time to see if f/s is supported
+       egrep -q "[^a-z]$fs$" /proc/filesystems && return 0
+       # else exit, ignoring unsupported file system
+       echo -e -n "\033[1;31m"
+       echo -e -n "File system $fs is not supported in this kernel (`uname -r`)"
+       echo "\033[m\a"
+       sleep 1
+       exit 0
+    done
+}
+
 export PATH=../../unionfs-utils:$PATH
 
 LINEBRK="----------------------------------------------------------------------"
@@ -218,6 +244,9 @@ do
       exit 1
   fi
 
+  # test if file systems are supported by this kernel, and skip if not
+  test_fs $MYFS $FS0 $FS1 $FS2 $FS3 $SPECIAL_FS
+
   delay=$DELAY
   echo "Sleeping for "$delay" seconds between each command."
   setup_lower