1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

test: lvmetad-pvscan-filter

update for pvscan changes
This commit is contained in:
David Teigland 2016-05-05 15:16:38 -05:00
parent 9b640c3684
commit 3d3efd7ab8

View File

@ -22,17 +22,35 @@ min=$(($(stat -L --printf=0x%T "$dev2")))
# Filter out device, pvscan should trigger
# clearing of the device from lvmetad cache.
aux hide_dev "$dev2"
pvscan --cache "$dev2" 2>&1 | grep "not found"
# We can't use aux hide_dev here because that
# changes the global_filter which triggers a
# token mismatch rescan by subsequent pvscan
# commands instead of the single-dev scans
# that are testing here.
mv "$dev2" "$dev2-HIDDEN"
pvscan --cache "$dev2" 2>&1 | tee out || true
grep "not found" out
# pvscan with --major/--minor does not fail: lvmetad needs to
# be notified about device removal on REMOVE uevent, hence
# this should not fail so udev does not grab a "failed" state
# incorrectly. We notify device addition and removal with
# exactly the same command "pvscan --cache" - in case of removal,
# this is detected by nonexistence of the device itself.
pvscan --cache --major $maj --minor $min 2>&1 | grep "not found"
aux unhide_dev "$dev2"
pvscan --cache "$dev2" 2>&1 | not grep "not found"
pvscan --cache --major $maj --minor $min 2>&1 | not grep "not found"
pvscan --cache --major $maj --minor $min 2>&1 | tee out || true
grep "not found" out
# aux unhide_dev "$dev2"
mv "$dev2-HIDDEN" "$dev2"
pvscan --cache "$dev2" 2>&1 | tee out || true
not grep "not found" out
pvscan --cache --major $maj --minor $min 2>&1 | tee out || true
not grep "not found" out
pvs | grep "$dev2"