]> sourceware.org Git - lvm2.git/commitdiff
Detect unusable nodes on fs
authorZdenek Kabelac <zkabelac@redhat.com>
Sat, 24 Sep 2011 20:54:35 +0000 (20:54 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Sat, 24 Sep 2011 20:54:35 +0000 (20:54 +0000)
Test whether nodes could be used on given filesystem where TMP
dir is being used and skip teardown quicker in fail case.
(makes the problem quickly obvious if you try to such fs).

Skip teardown_dev if we have not created any devs yet.

and do not mkdir /dev/mapper dir  when LVM_TEST_DEVDIR is set.

Drop this test from t-000-basic.sh.

test/lib/aux.sh
test/lib/test.sh
test/t-000-basic.sh

index 7cc98b4494fa19a90a093c52ed1a686d254894a4..7ef20b936b0630157b6ae8b6fe7b93dcb467aa9f 100644 (file)
@@ -164,7 +164,7 @@ teardown() {
 
     echo -n .
 
-    teardown_devs
+    test -d $DM_DEV_DIR/mapper && teardown_devs
 
     echo -n .
 
index b16c1d946867bfcc96a242a8d46c8318dd611439..e4bae879f7780abdf928187fc2d22980d7390aae 100644 (file)
@@ -34,10 +34,15 @@ trap 'aux teardown' EXIT # don't forget to clean up
 
 export LVM_SYSTEM_DIR=$TESTDIR/etc
 DM_DEV_DIR=$TESTDIR/dev
-test -n "$LVM_TEST_DEVDIR" && DM_DEV_DIR="$LVM_TEST_DEVDIR"
+mkdir $LVM_SYSTEM_DIR $TESTDIR/lib $DM_DEV_DIR
+if test -n "$LVM_TEST_DEVDIR" ; then
+       DM_DEV_DIR="$LVM_TEST_DEVDIR"
+else
+       mknod $DM_DEV_DIR/testnull c 1 3 || exit 1;
+       echo >$DM_DEV_DIR/testnull || { echo "Filesystem does support devices in $DM_DEV_DIR (mounted with nodev?)"; exit 1; }
+       mkdir -p $DM_DEV_DIR/mapper
+fi
 export DM_DEV_DIR
-mkdir $LVM_SYSTEM_DIR $TESTDIR/lib
-mkdir -p $DM_DEV_DIR $DM_DEV_DIR/mapper
 
 cd $TESTDIR
 
index b53dae324be642471a8bbe5abad5dcb1d04ba3c6..bd7ba693b8c5107fec701cf38d4a915a23dca81f 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2009-2011 Red Hat, Inc. All rights reserved.
 #
 # This copyrighted material is made available to anyone wishing to use,
 # modify, copy, or redistribute it subject to the terms and conditions
@@ -20,11 +20,6 @@ lvm pvmove --version|sed -n "1s/.*: *\([0-9][^ ]*\) .*/\1/p" > actual
 # ensure they are the same
 diff -u actual expected
 
-mknod $DM_DEV_DIR/null c 1 3 || \
-  error "Can't create nodes on filesystem"
-echo >$DM_DEV_DIR/null || \
-  error "Filesystem for tests does not allow using device nodes (check nodev)"
-
 # ensure we can create devices (uses dmsetup, etc)
 aux prepare_devs 5
 
This page took 0.036295 seconds and 5 git commands to generate.