Commit 21e2734f authored by Bernardo Dal Seno's avatar Bernardo Dal Seno
Browse files

QA: Cluster-verify reports shared PVs with exclusive storage



Exclusive storage forbids sharing PVs between unrelated LVs. This is a test
that cluster-verify correctly report such cases.
Signed-off-by: default avatarBernardo Dal Seno <bdalseno@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 23610ff8
......@@ -468,6 +468,8 @@ def RunExclusiveStorageTests():
qa_cluster.TestExclStorSingleNode(node)
qa_cluster.TestSetExclStorCluster(True)
qa_cluster.TestExclStorSharedPv(node)
if qa_config.TestEnabled("instance-add-plain-disk"):
# Make sure that the cluster doesn't have any pre-existing problem
qa_cluster.AssertClusterVerify()
......
......@@ -674,3 +674,21 @@ def TestExclStorSingleNode(node):
AssertClusterVerify(fail=True, errors=[constants.CV_EGROUPMIXEDESFLAG])
AssertCommand(_BuildSetESCmd("default", node_name))
AssertClusterVerify()
def TestExclStorSharedPv(node):
"""cluster-verify reports LVs that share the same PV with exclusive_storage.
"""
vgname = qa_config.get("vg-name", constants.DEFAULT_VG)
lvname1 = _QA_LV_PREFIX + "vol1"
lvname2 = _QA_LV_PREFIX + "vol2"
node_name = node["primary"]
AssertCommand(["lvcreate", "-L1G", "-n", lvname1, vgname], node=node_name)
AssertClusterVerify(fail=True, errors=[constants.CV_ENODEORPHANLV])
AssertCommand(["lvcreate", "-L1G", "-n", lvname2, vgname], node=node_name)
AssertClusterVerify(fail=True, errors=[constants.CV_ENODELVM,
constants.CV_ENODEORPHANLV])
AssertCommand(["lvremove", "-f", "/".join([vgname, lvname1])], node=node_name)
AssertCommand(["lvremove", "-f", "/".join([vgname, lvname2])], node=node_name)
AssertClusterVerify()
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