Commit ebeed788 authored by Hrvoje Ribicic's avatar Hrvoje Ribicic

Expand orphan volume test

to ensure we are not reporting stray volumes on other VGs as orphans.
Signed-off-by: default avatarHrvoje Ribicic <riba@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent bd2cafa4
......@@ -1692,12 +1692,18 @@ class TestLUClusterVerifyGroupVerifyOrphanVolumes(
@withLockedLU
def testOrphanedVolume(self, lu):
master_img = cluster.LUClusterVerifyGroup.NodeImage(uuid=self.master_uuid)
master_img.volumes = ["mock_vg/disk_0", "mock_vg/disk_1", "mock_vg/disk_2"]
master_img.volumes = [
"mock_vg/disk_0", # Required, present, no error
"mock_vg/disk_1", # Unknown, present, orphan
"mock_vg/disk_2", # Reserved, present, no error
"other_vg/disk_0", # Required, present, no error
"other_vg/disk_1", # Unknown, present, no error
]
node_imgs = {
self.master_uuid: master_img
}
node_vol_should = {
self.master_uuid: ["mock_vg/disk_0"]
self.master_uuid: ["mock_vg/disk_0", "other_vg/disk_0", "other_vg/disk_1"]
}
lu._VerifyOrphanVolumes("mock_vg", node_vol_should, node_imgs,
......@@ -1705,6 +1711,8 @@ class TestLUClusterVerifyGroupVerifyOrphanVolumes(
self.mcpu.assertLogContainsRegex("volume mock_vg/disk_1 is unknown")
self.mcpu.assertLogDoesNotContainRegex("volume mock_vg/disk_0 is unknown")
self.mcpu.assertLogDoesNotContainRegex("volume mock_vg/disk_2 is unknown")
self.mcpu.assertLogDoesNotContainRegex("volume other_vg/disk_0 is unknown")
self.mcpu.assertLogDoesNotContainRegex("volume other_vg/disk_1 is unknown")
class TestLUClusterVerifyGroupVerifyNPlusOneMemory(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment