mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
tests: minor simplifications
minor updates
This commit is contained in:
parent
fee09f0964
commit
79844b9066
@ -34,8 +34,6 @@ prepare_clvmd() {
|
||||
if test -z "${installed_testsuite+varset}"; then
|
||||
(which clvmd 2>/dev/null | grep -q "$abs_builddir") || skip
|
||||
fi
|
||||
# lvs is executed from clvmd - use our version
|
||||
export LVM_BINARY=$(which lvm)
|
||||
|
||||
test -e "$DM_DEV_DIR/control" || dmsetup table >/dev/null # create control node
|
||||
# skip if singlenode is not compiled in
|
||||
@ -46,7 +44,8 @@ prepare_clvmd() {
|
||||
test "${LVM_VALGRIND_CLVMD:-0}" -eq 0 || run_valgrind="run_valgrind"
|
||||
rm -f "$CLVMD_PIDFILE"
|
||||
echo "<======== Starting CLVMD ========>"
|
||||
LVM_LOG_FILE_EPOCH=CLVMD $run_valgrind clvmd -Isinglenode -d 1 -f &
|
||||
# lvs is executed from clvmd - use our version
|
||||
LVM_LOG_FILE_EPOCH=CLVMD LVM_BINARY=$(which lvm) $run_valgrind clvmd -Isinglenode -d 1 -f &
|
||||
echo $! > LOCAL_CLVMD
|
||||
|
||||
for i in $(seq 1 100) ; do
|
||||
@ -422,7 +421,7 @@ prepare_md_dev() {
|
||||
mddev=/dev/md_lvm_test0
|
||||
|
||||
mdadm --create --metadata=1.0 "$mddev" --auto=md --level $level --chunk $rchunk --raid-devices=$rdevs "${@:4}"
|
||||
test -b "$mddev" || skip "mdadm has not create device!"
|
||||
test -b "$mddev" || skip "mdadm has not created device!"
|
||||
|
||||
# LVM/DM will see this device
|
||||
case "$DM_DEV_DIR" in
|
||||
@ -467,7 +466,7 @@ prepare_backing_dev() {
|
||||
if test -f BACKING_DEV; then
|
||||
BACKING_DEV=$(< BACKING_DEV)
|
||||
elif test -b "$LVM_TEST_BACKING_DEVICE"; then
|
||||
BACKING_DEV="$LVM_TEST_BACKING_DEVICE"
|
||||
BACKING_DEV=$LVM_TEST_BACKING_DEVICE
|
||||
echo "$BACKING_DEV" > BACKING_DEV
|
||||
else
|
||||
prepare_loop "$@"
|
||||
|
@ -209,7 +209,7 @@ run_refresh_check() {
|
||||
|
||||
# Disable dev2 and do some I/O to make the kernel notice
|
||||
aux disable_dev "$dev2"
|
||||
dd if=/dev/urandom of=$DM_DEV_DIR/$sizelv bs=1k count=$size
|
||||
dd if=/dev/urandom of="$DM_DEV_DIR/$sizelv" bs=1k count=$size
|
||||
sync
|
||||
|
||||
# Check for 'p'artial flag
|
||||
|
@ -23,13 +23,11 @@ vgcreate $vg1 "$dev1" "$dev2"
|
||||
lvcreate -n foo -l 1 -an --zero n $vg1
|
||||
|
||||
# start lvmetad but make sure it doesn't know about $dev1 or $dev2
|
||||
aux disable_dev "$dev1"
|
||||
aux disable_dev "$dev2"
|
||||
aux disable_dev "$dev1" "$dev2"
|
||||
aux prepare_lvmetad
|
||||
lvs
|
||||
mv LOCAL_LVMETAD XXX
|
||||
aux enable_dev "$dev2"
|
||||
aux enable_dev "$dev1"
|
||||
aux enable_dev "$dev2" "$dev1"
|
||||
mv XXX LOCAL_LVMETAD
|
||||
|
||||
aux lvmconf 'global/use_lvmetad = 0'
|
||||
|
@ -14,8 +14,7 @@ aux prepare_devs 2
|
||||
pvcreate "$dev1"
|
||||
pvcreate "$dev2"
|
||||
|
||||
aux disable_dev "$dev1"
|
||||
aux disable_dev "$dev2"
|
||||
aux disable_dev "$dev1" "$dev2"
|
||||
|
||||
aux enable_dev "$dev1"
|
||||
vgscan
|
||||
@ -35,8 +34,7 @@ vgscan
|
||||
pvs "$dev1"
|
||||
pvs "$dev2"
|
||||
|
||||
vgs -o+vg_uuid >err
|
||||
cat err
|
||||
vgs -o+vg_uuid | tee err
|
||||
grep $UUID1 err
|
||||
grep $UUID2 err
|
||||
|
||||
@ -45,18 +43,15 @@ grep $UUID2 err
|
||||
# grep $UUID1 err
|
||||
|
||||
aux disable_dev "$dev2"
|
||||
vgs -o+vg_uuid >err
|
||||
cat err
|
||||
vgs -o+vg_uuid | tee err
|
||||
grep $UUID1 err
|
||||
not grep $UUID2 err
|
||||
aux enable_dev "$dev2"
|
||||
vgscan
|
||||
|
||||
aux disable_dev "$dev1"
|
||||
vgs -o+vg_uuid >err
|
||||
cat err
|
||||
vgs -o+vg_uuid | tee err
|
||||
grep $UUID2 err
|
||||
not grep $UUID1 err
|
||||
aux enable_dev "$dev1"
|
||||
vgscan
|
||||
|
||||
|
@ -57,4 +57,3 @@ grep "$dev11" err
|
||||
grep "$dev12" err
|
||||
grep "$dev13" err
|
||||
grep "$dev14" err
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user