From 1d6933114a7295ab2cbad6e9a1b8eb628e5e4d96 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann Date: Mon, 1 Dec 2008 20:52:31 +0000 Subject: [PATCH] Update QA scripts to new cluster parameters There are still issues, especially with "gnt-instance modify" and resetting values. However, this is a start. Reviewed-by: ultrotter --- qa/qa-sample.json | 8 +++++--- qa/qa_cluster.py | 8 ++++---- qa/qa_config.py | 3 +++ qa/qa_instance.py | 43 +++++++++++++++++++++++++++---------------- 4 files changed, 39 insertions(+), 23 deletions(-) diff --git a/qa/qa-sample.json b/qa/qa-sample.json index 9b323cd..f4e84d5 100644 --- a/qa/qa-sample.json +++ b/qa/qa-sample.json @@ -1,13 +1,15 @@ { "name": "xen-test", "rename": "xen-test-rename", - "hypervisor-type": "xen-pvm", + "default-hypervisor": "xen-pvm", "os": "debian-etch", - "os-size": "10G", - "swap-size": "1G", "mem": "512M", + "# Lists of disk sizes": null, + "disk": ["1G", "512M"], + "disk-growth": ["2G", "768M"], + "nodes": [ { "# Master node": null, diff --git a/qa/qa_cluster.py b/qa/qa_cluster.py index bf4095f..46f07bf 100644 --- a/qa/qa_cluster.py +++ b/qa/qa_cluster.py @@ -68,9 +68,9 @@ def TestClusterInit(): cmd.append('--bridge=%s' % bridge) cmd.append('--master-netdev=%s' % bridge) - htype = qa_config.get('hypervisor-type', None) + htype = qa_config.get('default-hypervisor', None) if htype: - cmd.append('--hypervisor-type=%s' % htype) + cmd.append('--default-hypervisor=%s' % htype) cmd.append(qa_config.get('name')) @@ -169,8 +169,8 @@ def TestClusterBurnin(): # Run burnin cmd = [script, '--os=%s' % qa_config.get('os'), - '--os-size=%s' % qa_config.get('os-size'), - '--swap-size=%s' % qa_config.get('swap-size'), + '--disk-size=%s' % ",".join(qa_config.get('disk')), + '--disk-growth=%s' % ",".join(qa_config.get('disk-growth')), '--disk-template=%s' % disk_template] cmd += [inst['name'] for inst in instances] AssertEqual(StartSSH(master['primary'], diff --git a/qa/qa_config.py b/qa/qa_config.py index 13d857f..4afe253 100644 --- a/qa/qa_config.py +++ b/qa/qa_config.py @@ -53,6 +53,9 @@ def Validate(): raise qa_error.Error("Need at least one node") if len(cfg['instances']) < 1: raise qa_error.Error("Need at least one instance") + if len(cfg["disk"]) != len(cfg["disk-growth"]): + raise qa_error.Error("Config options 'disk' and 'disk-growth' must have" + " the same number of items") def get(name, default=None): diff --git a/qa/qa_instance.py b/qa/qa_instance.py index cf749d7..fe5dfb5 100644 --- a/qa/qa_instance.py +++ b/qa/qa_instance.py @@ -41,9 +41,10 @@ def _GetDiskStatePath(disk): def _GetGenericAddParameters(): - return ['--os-size=%s' % qa_config.get('os-size'), - '--swap-size=%s' % qa_config.get('swap-size'), - '--memory=%s' % qa_config.get('mem')] + params = ['-B', '%s=%s' % (constants.BE_MEMORY, qa_config.get('mem'))] + for idx, size in enumerate(qa_config.get('disk')): + params.extend(["--disk", "%s:size=%s" % (idx, size)]) + return params def _DiskTest(node, disk_template): @@ -153,22 +154,32 @@ def TestInstanceModify(instance): """gnt-instance modify""" master = qa_config.GetMasterNode() + # Assume /sbin/init exists on all systems + test_kernel = "/sbin/init" + test_initrd = test_kernel + orig_memory = qa_config.get('mem') orig_bridge = qa_config.get('bridge', 'xen-br0') args = [ - ["--memory", "128"], - ["--memory", str(orig_memory)], - ["--cpu", "2"], - ["--cpu", "1"], - ["--bridge", "xen-br1"], - ["--bridge", orig_bridge], - ["--kernel", "/dev/null"], - ["--kernel", "default"], - ["--initrd", "/dev/null"], - ["--initrd", "none"], - ["--initrd", "default"], - ["--hvm-boot-order", "acn"], - ["--hvm-boot-order", "default"], + ["-B", "%s=128" % constants.BE_MEMORY], + ["-B", "%s=%s" % (constants.BE_MEMORY, orig_memory)], + ["-B", "%s=2" % constants.BE_VCPUS], + ["-B", "%s=1" % constants.BE_VCPUS], + ["-B", "%s=%s" % (constants.BE_VCPUS, constants.VALUE_DEFAULT)], + + ["-H", "%s=%s" % (constants.HV_KERNEL_PATH, test_kernel)], + ["-H", "%s=%s" % (constants.HV_KERNEL_PATH, constants.VALUE_DEFAULT)], + ["-H", "%s=%s" % (constants.HV_INITRD_PATH, test_initrd)], + ["-H", "%s=%s" % (constants.HV_INITRD_PATH, constants.VALUE_NONE)], + ["-H", "%s=%s" % (constants.HV_INITRD_PATH, constants.VALUE_DEFAULT)], + + # TODO: bridge tests + #["--bridge", "xen-br1"], + #["--bridge", orig_bridge], + + # TODO: Do these tests only with xen-hvm + #["-H", "%s=acn" % constants.HV_BOOT_ORDER], + #["-H", "%s=%s" % (constants.HV_BOOT_ORDER, constants.VALUE_DEFAULT)], ] for alist in args: cmd = ['gnt-instance', 'modify'] + alist + [instance['name']] -- 1.7.10.4