xfstests: resolve symlinked devices to real paths

If you try running xfstests on lvm volumes which are symlinks,
it'll fail to run several tests because our _require_scratch 
framework ultimately uses lstat not stat, and does not think 
the lvm device (which is usually a symlink to a dm-X device) 
is a block device.  Sigh.

Last try at this - just resolve any symlinked devicenames
into their realpath(3) in common.config.

This actually seems to work.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
This commit is contained in:
Eric Sandeen
2010-06-08 20:03:39 +00:00
committed by Rich Johnston
parent ac996c6686
commit d5ea873fcb
2 changed files with 41 additions and 0 deletions
+9
View File
@@ -220,6 +220,15 @@ else
known_hosts
fi
# Scripts just don't deal well with symlinked devices
if [ -L $TEST_DEV ]; then
TEST_DEV=`src/realpath $TEST_DEV`
fi
if [ -L $SCRATCH_DEV ]; then
SCRATCH_DEV=`src/realpath $SCRATCH_DEV`
fi
echo $TEST_DEV | grep -q ":" > /dev/null 2>&1
if [ ! -b "$TEST_DEV" -a "$?" != "0" ]; then
echo "common.config: Error: \$TEST_DEV ($TEST_DEV) is not a block device or a NFS filesystem"