From 5abecc1cd128574edc4e78fc3115948b830d2eee Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Thu, 28 Jul 2011 11:18:08 +0200 Subject: [PATCH] Add support for cluster/OS parameters in QA Currently there is no way to QA with (for example) an initrd because the QA only inits the cluster with the default parameters. This makes it impossible to QA using anything but the default parameters, which doesn't always work. Additionally, we add OS parameters and OS hypervisor parameters, for completeness and for testing that these commands also work. Signed-off-by: Iustin Pop <iustin@google.com> Reviewed-by: Michael Hanselmann <hansmi@google.com> --- qa/qa-sample.json | 8 ++++++++ qa/qa_cluster.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/qa/qa-sample.json b/qa/qa-sample.json index 6e62f80fc..e7e0d1c9d 100644 --- a/qa/qa-sample.json +++ b/qa/qa-sample.json @@ -2,6 +2,14 @@ "name": "xen-test", "rename": "xen-test-rename", "enabled-hypervisors": "xen-pvm", + "# Dict of hypervisor name and parameters (like on the cmd line)": null, + "hypervisor-parameters": {}, + "# Backend parameters (like on the cmd line)": null, + "backend-parameters": "", + "# Dict of OS name and parameters (like on the cmd line)": null, + "os-parameters": {}, + "# Dict of OS name and value dict of hypervisor parameters": null, + "os-hvp": {}, "primary_ip_version": 4, "os": "debian-etch", diff --git a/qa/qa_cluster.py b/qa/qa_cluster.py index 176bcd9eb..aa1fd70fd 100644 --- a/qa/qa_cluster.py +++ b/qa/qa_cluster.py @@ -96,6 +96,30 @@ def TestClusterInit(rapi_user, rapi_secret): AssertCommand(cmd) + cmd = ["gnt-cluster", "modify"] + # hypervisor parameter modifications + hvp = qa_config.get("hypervisor-parameters", {}) + for k, v in hvp.items(): + cmd.extend(["-H", "%s:%s" % (k, v)]) + # backend parameter modifications + bep = qa_config.get("backend-parameters", "") + if bep: + cmd.extend(["-B", bep]) + + if len(cmd) > 2: + AssertCommand(cmd) + + # OS parameters + osp = qa_config.get("os-parameters", {}) + for k, v in osp.items(): + AssertCommand(["gnt-os", "modify", "-O", v, k]) + + # OS hypervisor parameters + os_hvp = qa_config.get("os-hvp", {}) + for os_name in os_hvp: + for hv, hvp in os_hvp[os_name].items(): + AssertCommand(["gnt-os", "modify", "-H", "%s:%s" % (hv, hvp), os_name]) + def TestClusterRename(): """gnt-cluster rename""" @@ -206,6 +230,10 @@ def TestClusterModifyBe(): ]: AssertCommand(cmd, fail=fail) + # redo the original-requested BE parameters, if any + bep = qa_config.get("backend-parameters", "") + if bep: + AssertCommand(["gnt-cluster", "modify", "-B", bep]) def TestClusterInfo(): """gnt-cluster info""" -- GitLab