summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2014-03-06 14:46:50 +0100
committerPeter Rajnoha <prajnoha@redhat.com>2014-03-06 14:46:50 +0100
commitcfc9e178bf24982f14c4d1e9034056ff6c3d3e31 (patch)
tree2a6735219ae41807eda0afc247ac139c666a8c3e
parent42eb9b45262f3cb9d9baf0903249128bb6923d4e (diff)
downloadlvm2-cfc9e178bf24982f14c4d1e9034056ff6c3d3e31.tar.gz
tests: fix name-mangling test and remove udev transaction in dmsetup wrapper
-rw-r--r--test/lib/aux.sh2
-rw-r--r--test/shell/name-mangling.sh15
2 files changed, 6 insertions, 11 deletions
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index c178ab5f4..5d2d188c3 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -763,9 +763,7 @@ have_readline()
dmsetup_wrapped()
{
udev_wait
- init_udev_transaction
dmsetup "$@"
- finish_udev_transaction
}
test -f DEVICES && devs=$(cat DEVICES)
diff --git a/test/shell/name-mangling.sh b/test/shell/name-mangling.sh
index b5906c119..2f0752317 100644
--- a/test/shell/name-mangling.sh
+++ b/test/shell/name-mangling.sh
@@ -15,7 +15,7 @@ CHARACTER_WHITELIST="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456
FAIL_MIXED_STR="contains mixed mangled and unmangled characters"
FAIL_MULTI_STR="seems to be mangled more than once"
FAIL_BLACK_STR="should be mangled but it contains blacklisted characters"
-CORRECT_FORM_STR="name already in correct form"
+CORRECT_FORM_STR="already in correct form"
RENAMING_STR="renaming to"
function create_dm_dev()
@@ -66,13 +66,13 @@ function check_create_and_remove()
test -b "$DM_DEV_DIR/mapper/${PREFIX}$dm_name" && \
aux dmsetup remove "${PREFIX}$input_name" $verify_udev --manglename $mode || r=1
- if [ $dm_name = "FAIL_MIXED" ]; then
+ if [ "$dm_name" = "FAIL_MIXED" ]; then
r=0
grep "$FAILED_MIXED_STR" err || r=1
- elif [ $dm_name = "FAIL_MULTI" ]; then
+ elif [ "$dm_name" = "FAIL_MULTI" ]; then
r=0
grep "$FAILED_MULTI_STR" err || r=1
- elif [ $dm_name = "FAIL_BLACK" ]; then
+ elif [ "$dm_name" = "FAIL_BLACK" ]; then
r=0
grep "$FAILED_BLACK_STR" err || r=1
fi
@@ -164,6 +164,7 @@ r=0
create_dm_dev auto "abc"
ln -s "$DM_DEV_DIR/mapper/${PREFIX}abc" "$DM_DEV_DIR/${PREFIX}xyz"
aux dmsetup status "$DM_DEV_DIR/${PREFIX}xyz" || r=1
+rm -f "$DM_DEV_DIR/${PREFIX}xyz"
remove_dm_dev auto "abc"
if [ r = 1 ]; then
exit 1
@@ -191,11 +192,7 @@ check_expected_names none 'a\x5cx20b' 'a\x5cx20b' 'a\x5cx20b' 'a\x20b'
check_mangle_cmd none 'a b' 'OK'
check_mangle_cmd none 'a\x20b' 'a b'
-#
-# FIXME: this test leave entry in /dev/mapper dir
-# and is not detected nor cleaned
-#
-#check_mangle_cmd none 'a b\x20c' 'a b c'
+check_mangle_cmd none 'a b\x20c' 'a b c'
check_mangle_cmd none 'a\x5cx20b' 'a\x20b'