mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-18 10:04:20 +03:00
tests: fix name-mangling test and remove udev transaction in dmsetup wrapper
This commit is contained in:
parent
42eb9b4526
commit
cfc9e178bf
@ -763,9 +763,7 @@ have_readline()
|
|||||||
dmsetup_wrapped()
|
dmsetup_wrapped()
|
||||||
{
|
{
|
||||||
udev_wait
|
udev_wait
|
||||||
init_udev_transaction
|
|
||||||
dmsetup "$@"
|
dmsetup "$@"
|
||||||
finish_udev_transaction
|
|
||||||
}
|
}
|
||||||
|
|
||||||
test -f DEVICES && devs=$(cat DEVICES)
|
test -f DEVICES && devs=$(cat DEVICES)
|
||||||
|
@ -15,7 +15,7 @@ CHARACTER_WHITELIST="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456
|
|||||||
FAIL_MIXED_STR="contains mixed mangled and unmangled characters"
|
FAIL_MIXED_STR="contains mixed mangled and unmangled characters"
|
||||||
FAIL_MULTI_STR="seems to be mangled more than once"
|
FAIL_MULTI_STR="seems to be mangled more than once"
|
||||||
FAIL_BLACK_STR="should be mangled but it contains blacklisted characters"
|
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"
|
RENAMING_STR="renaming to"
|
||||||
|
|
||||||
function create_dm_dev()
|
function create_dm_dev()
|
||||||
@ -66,13 +66,13 @@ function check_create_and_remove()
|
|||||||
test -b "$DM_DEV_DIR/mapper/${PREFIX}$dm_name" && \
|
test -b "$DM_DEV_DIR/mapper/${PREFIX}$dm_name" && \
|
||||||
aux dmsetup remove "${PREFIX}$input_name" $verify_udev --manglename $mode || r=1
|
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
|
r=0
|
||||||
grep "$FAILED_MIXED_STR" err || r=1
|
grep "$FAILED_MIXED_STR" err || r=1
|
||||||
elif [ $dm_name = "FAIL_MULTI" ]; then
|
elif [ "$dm_name" = "FAIL_MULTI" ]; then
|
||||||
r=0
|
r=0
|
||||||
grep "$FAILED_MULTI_STR" err || r=1
|
grep "$FAILED_MULTI_STR" err || r=1
|
||||||
elif [ $dm_name = "FAIL_BLACK" ]; then
|
elif [ "$dm_name" = "FAIL_BLACK" ]; then
|
||||||
r=0
|
r=0
|
||||||
grep "$FAILED_BLACK_STR" err || r=1
|
grep "$FAILED_BLACK_STR" err || r=1
|
||||||
fi
|
fi
|
||||||
@ -164,6 +164,7 @@ r=0
|
|||||||
create_dm_dev auto "abc"
|
create_dm_dev auto "abc"
|
||||||
ln -s "$DM_DEV_DIR/mapper/${PREFIX}abc" "$DM_DEV_DIR/${PREFIX}xyz"
|
ln -s "$DM_DEV_DIR/mapper/${PREFIX}abc" "$DM_DEV_DIR/${PREFIX}xyz"
|
||||||
aux dmsetup status "$DM_DEV_DIR/${PREFIX}xyz" || r=1
|
aux dmsetup status "$DM_DEV_DIR/${PREFIX}xyz" || r=1
|
||||||
|
rm -f "$DM_DEV_DIR/${PREFIX}xyz"
|
||||||
remove_dm_dev auto "abc"
|
remove_dm_dev auto "abc"
|
||||||
if [ r = 1 ]; then
|
if [ r = 1 ]; then
|
||||||
exit 1
|
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 b' 'OK'
|
||||||
check_mangle_cmd none 'a\x20b' 'a b'
|
check_mangle_cmd none 'a\x20b' 'a b'
|
||||||
#
|
check_mangle_cmd none 'a b\x20c' 'a b c'
|
||||||
# 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\x5cx20b' 'a\x20b'
|
check_mangle_cmd none 'a\x5cx20b' 'a\x20b'
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user