From 8159b2c98989e8abc1bb450935dea2c1e91eccf3 Mon Sep 17 00:00:00 2001 From: Erez_Zadok Date: Wed, 1 Aug 2007 23:01:24 -0400 Subject: [PATCH] Test for unsupported file systems and skip them (no false negatives) --- run-tests | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/run-tests b/run-tests index 02723b5..448bd1b 100755 --- 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" + 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 -- 2.43.0