1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-28 05:57:49 +03:00

tests: pvscan --cache DevicePath does not fail if the device is just filtered

It's not an error if the device is filtered out and hence cleared from
lvmetad cache - "pvscan --cache DevPath" has now the same behaviour in
this case as "pvscan --cache major:minor" (which is more consistent).

Before, the tests expected failure return code for "pvscan --cache DevicePath"
if the device was filtered (which is a different situation if the device
is missing in the system completely!).
This commit is contained in:
Peter Rajnoha 2015-01-12 15:16:57 +01:00
parent 99d895014d
commit 8804023825
2 changed files with 5 additions and 3 deletions

View File

@ -18,8 +18,10 @@ aux prepare_pvs 2
maj=$(($(stat -L --printf=0x%t "$dev2"))) maj=$(($(stat -L --printf=0x%t "$dev2")))
min=$(($(stat -L --printf=0x%T "$dev2"))) min=$(($(stat -L --printf=0x%T "$dev2")))
# Filter out device, pvscan should trigger
# clearing of the device from lvmetad cache.
aux hide_dev "$dev2" aux hide_dev "$dev2"
not pvscan --cache "$dev2" 2>&1 | grep "not found" pvscan --cache "$dev2" 2>&1 | grep "not found"
# pvscan with --major/--minor does not fail: lvmetad needs to # pvscan with --major/--minor does not fail: lvmetad needs to
# be notified about device removal on REMOVE uevent, hence # be notified about device removal on REMOVE uevent, hence
# this should not fail so udev does not grab a "failed" state # this should not fail so udev does not grab a "failed" state

View File

@ -69,8 +69,8 @@ pvcreate $lvmdev
pvscan --cache "$lvmdev" pvscan --cache "$lvmdev"
# ensure that lvmetad can only see the toplevel MD device # ensure that lvmetad can only see the toplevel MD device
not pvscan --cache "$dev1" 2>&1 | grep "not found" pvscan --cache "$dev1" 2>&1 | grep "not found"
not pvscan --cache "$dev2" 2>&1 | grep "not found" pvscan --cache "$dev2" 2>&1 | grep "not found"
pvs | grep $lvmdev pvs | grep $lvmdev
pvs | not grep "$dev1" pvs | not grep "$dev1"