diff --git a/qa/qa-sample.json b/qa/qa-sample.json index 4c47a62fcac8c5de4f13998cfdbafa57227e338b..087ee6cedd80bc0ac0b30d9cda4fbaca7f96c6cd 100644 --- a/qa/qa-sample.json +++ b/qa/qa-sample.json @@ -19,6 +19,8 @@ "# Dict of OS name and value dict of hypervisor parameters": null, "os-hvp": {}, "primary_ip_version": 4, + "# Name of the LVM group for the cluster": null, + "vg-name": "xenvg", "# Network interface for master role": null, "#master-netdev": "xen-br0", diff --git a/qa/qa_cluster.py b/qa/qa_cluster.py index 6811d74d8c974f1cef74dc26a556ce308d3bddfd..1960acd72f6e13fc83be19fcbeaf9e5e4d94b99f 100644 --- a/qa/qa_cluster.py +++ b/qa/qa_cluster.py @@ -39,6 +39,9 @@ import qa_error from qa_utils import AssertEqual, AssertCommand, GetCommandOutput +# Prefix for LVM volumes created by QA code during tests +_QA_LV_PREFIX = "qa-" + #: cluster verify command _CLUSTER_VERIFY = ["gnt-cluster", "verify"] @@ -185,6 +188,10 @@ def TestClusterInit(rapi_user, rapi_secret): if master.get("secondary", None): cmd.append("--secondary-ip=%s" % master["secondary"]) + vgname = qa_config.get("vg-name", None) + if vgname: + cmd.append("--vg-name=%s" % vgname) + master_netdev = qa_config.get("master-netdev", None) if master_netdev: cmd.append("--master-netdev=%s" % master_netdev) @@ -334,19 +341,23 @@ def TestDelay(node): def TestClusterReservedLvs(): """gnt-cluster reserved lvs""" + vgname = qa_config.get("vg-name", constants.DEFAULT_VG) + lvname = _QA_LV_PREFIX + "test" + lvfullname = "/".join([vgname, lvname]) for fail, cmd in [ (False, _CLUSTER_VERIFY), (False, ["gnt-cluster", "modify", "--reserved-lvs", ""]), - (False, ["lvcreate", "-L1G", "-nqa-test", "xenvg"]), + (False, ["lvcreate", "-L1G", "-n", lvname, vgname]), (True, _CLUSTER_VERIFY), (False, ["gnt-cluster", "modify", "--reserved-lvs", - "xenvg/qa-test,.*/other-test"]), + "%s,.*/other-test" % lvfullname]), (False, _CLUSTER_VERIFY), - (False, ["gnt-cluster", "modify", "--reserved-lvs", ".*/qa-.*"]), + (False, ["gnt-cluster", "modify", "--reserved-lvs", + ".*/%s.*" % _QA_LV_PREFIX]), (False, _CLUSTER_VERIFY), (False, ["gnt-cluster", "modify", "--reserved-lvs", ""]), (True, _CLUSTER_VERIFY), - (False, ["lvremove", "-f", "xenvg/qa-test"]), + (False, ["lvremove", "-f", lvfullname]), (False, _CLUSTER_VERIFY), ]: AssertCommand(cmd, fail=fail)