mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
tests: update duplicate md tests
adjust to recent improvements in duplicate handling
This commit is contained in:
parent
f836fe3836
commit
1bfae5bf8e
@ -190,18 +190,17 @@ lvs -o active $vg |tee out || true
|
|||||||
grep "active" out
|
grep "active" out
|
||||||
vgchange -an $vg
|
vgchange -an $vg
|
||||||
|
|
||||||
# N.B. when the md dev (which is started) has not been scanned by
|
# The dev name and device_hint don't match so pvscan
|
||||||
# pvscan, then pvscan --cache on the md component does not detect it's
|
# skips quick activation and scans all devs during
|
||||||
# an md component, and marks the PVID online, then does activation,
|
# activation. This means it sees the component and
|
||||||
# but the activation using the component fails because the component
|
# the mddev as duplicates and chooses to use the mddev
|
||||||
# device is busy from being used in the md dev, and activation fails.
|
# for activation.
|
||||||
# The default behavior in auto mode is preferrable.
|
|
||||||
_clear_online_files
|
_clear_online_files
|
||||||
not pvscan --cache -aay "$dev1"
|
pvscan --cache -aay "$dev1"
|
||||||
ls "$RUNDIR/lvm/pvs_online/$PVIDMD"
|
ls "$RUNDIR/lvm/pvs_online/$PVIDMD"
|
||||||
ls "$RUNDIR/lvm/vgs_online/$vg"
|
ls "$RUNDIR/lvm/vgs_online/$vg"
|
||||||
lvs -o active $vg |tee out || true
|
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
|
# pvscan activation from mddev first, then try from component which fails
|
||||||
_clear_online_files
|
_clear_online_files
|
||||||
@ -332,27 +331,17 @@ pvscan --cache -aay
|
|||||||
not ls "$RUNDIR/lvm/pvs_online/$PVIDMD"
|
not ls "$RUNDIR/lvm/pvs_online/$PVIDMD"
|
||||||
not ls "$RUNDIR/lvm/vgs_online/$vg"
|
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
|
_clear_online_files
|
||||||
pvscan --cache -aay "$dev1"
|
not pvscan --cache -aay "$dev1"
|
||||||
ls "$RUNDIR/lvm/pvs_online/$PVIDMD"
|
ls "$RUNDIR/lvm/pvs_online/$PVIDMD"
|
||||||
ls "$RUNDIR/lvm/vgs_online/$vg"
|
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 "$dev1" || true
|
||||||
wipefs -a "$dev2" || true
|
wipefs -a "$dev2" || true
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user