summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2019-09-27 14:18:35 -0500
committerDavid Teigland <teigland@redhat.com>2019-09-30 11:38:10 -0500
commit1bfae5bf8e5905a72f7168562e1bbc074f23b791 (patch)
treeacfc7fb89529529f7ef4707b66ea003e35800a4d
parentf836fe3836e990e41b2c2b59c2af7ef6b979097f (diff)
downloadlvm2-1bfae5bf8e5905a72f7168562e1bbc074f23b791.tar.gz
tests: update duplicate md tests
adjust to recent improvements in duplicate handling
-rw-r--r--test/shell/duplicate-pvs-md1.sh39
1 files changed, 14 insertions, 25 deletions
diff --git a/test/shell/duplicate-pvs-md1.sh b/test/shell/duplicate-pvs-md1.sh
index 626c55cb7..334ac4158 100644
--- a/test/shell/duplicate-pvs-md1.sh
+++ b/test/shell/duplicate-pvs-md1.sh
@@ -190,18 +190,17 @@ lvs -o active $vg |tee out || true
grep "active" out
vgchange -an $vg
-# N.B. when the md dev (which is started) has not been scanned by
-# pvscan, then pvscan --cache on the md component does not detect it's
-# an md component, and marks the PVID online, then does activation,
-# but the activation using the component fails because the component
-# device is busy from being used in the md dev, and activation fails.
-# The default behavior in auto mode is preferrable.
+# The dev name and device_hint don't match so pvscan
+# skips quick activation and scans all devs during
+# activation. This means it sees the component and
+# the mddev as duplicates and chooses to use the mddev
+# for activation.
_clear_online_files
-not pvscan --cache -aay "$dev1"
+pvscan --cache -aay "$dev1"
ls "$RUNDIR/lvm/pvs_online/$PVIDMD"
ls "$RUNDIR/lvm/vgs_online/$vg"
lvs -o active $vg |tee out || true
-not grep "active" out
+grep "active" out
# pvscan activation from mddev first, then try from component which fails
_clear_online_files
@@ -332,27 +331,17 @@ pvscan --cache -aay
not ls "$RUNDIR/lvm/pvs_online/$PVIDMD"
not ls "$RUNDIR/lvm/vgs_online/$vg"
+# component dev name does not match device_hint in metadata so
+# quick activation is skipped and activation scans all devs.
+# this leads it to see both components as duplicates which
+# triggers full md check which means we see both devs are
+# md components and drop them, leaving no remaining devs
+# on which this vg is seen.
_clear_online_files
-pvscan --cache -aay "$dev1"
+not pvscan --cache -aay "$dev1"
ls "$RUNDIR/lvm/pvs_online/$PVIDMD"
ls "$RUNDIR/lvm/vgs_online/$vg"
-# N.B. not good to activate from component, but result of "start" setting
-# Other commands will not see the vg at this point because they'll
-# recognize the md components and ignore them (where pvscan is special due
-# to it not scanning all devs and not seeing the duplicates and not
-# detecting the components.)
-# disable dev2 so other cmds don't see dups and we can deactivate the vg
-aux disable_dev "$dev2"
-vgchange -an $vg
-
-aux enable_dev "$dev2"
-aux udev_wait
-cat /proc/mdstat
-# for some reason enabling dev2 starts an odd md dev
-mdadm --stop "$mddev" || true
-mdadm --stop --scan
-cat /proc/mdstat
wipefs -a "$dev1" || true
wipefs -a "$dev2" || true