summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2015-01-12 15:16:57 +0100
committerPeter Rajnoha <prajnoha@redhat.com>2015-01-12 15:16:57 +0100
commit8804023825e9eb00df653a7c5116097d1ce49087 (patch)
treeb77fe30fe283cb20e866f8974e72c997996e4c82
parent99d895014d971395fe7a739838952e7405eb4dda (diff)
downloadlvm2-8804023825e9eb00df653a7c5116097d1ce49087.tar.gz
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!).
-rw-r--r--test/shell/lvmetad-pvscan-filter.sh4
-rw-r--r--test/shell/lvmetad-pvscan-md.sh4
2 files changed, 5 insertions, 3 deletions
diff --git a/test/shell/lvmetad-pvscan-filter.sh b/test/shell/lvmetad-pvscan-filter.sh
index a3af1b20b..05666df0a 100644
--- a/test/shell/lvmetad-pvscan-filter.sh
+++ b/test/shell/lvmetad-pvscan-filter.sh
@@ -18,8 +18,10 @@ aux prepare_pvs 2
maj=$(($(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"
-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
# be notified about device removal on REMOVE uevent, hence
# this should not fail so udev does not grab a "failed" state
diff --git a/test/shell/lvmetad-pvscan-md.sh b/test/shell/lvmetad-pvscan-md.sh
index 449369d10..653d18a72 100644
--- a/test/shell/lvmetad-pvscan-md.sh
+++ b/test/shell/lvmetad-pvscan-md.sh
@@ -69,8 +69,8 @@ pvcreate $lvmdev
pvscan --cache "$lvmdev"
# ensure that lvmetad can only see the toplevel MD device
-not pvscan --cache "$dev1" 2>&1 | grep "not found"
-not pvscan --cache "$dev2" 2>&1 | grep "not found"
+pvscan --cache "$dev1" 2>&1 | grep "not found"
+pvscan --cache "$dev2" 2>&1 | grep "not found"
pvs | grep $lvmdev
pvs | not grep "$dev1"