Skip to content
Snippets Groups Projects
Commit 1d693311 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

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
parent dfecf310
No related branches found
No related tags found
No related merge requests found
{ {
"name": "xen-test", "name": "xen-test",
"rename": "xen-test-rename", "rename": "xen-test-rename",
"hypervisor-type": "xen-pvm", "default-hypervisor": "xen-pvm",
"os": "debian-etch", "os": "debian-etch",
"os-size": "10G",
"swap-size": "1G",
"mem": "512M", "mem": "512M",
"# Lists of disk sizes": null,
"disk": ["1G", "512M"],
"disk-growth": ["2G", "768M"],
"nodes": [ "nodes": [
{ {
"# Master node": null, "# Master node": null,
......
...@@ -68,9 +68,9 @@ def TestClusterInit(): ...@@ -68,9 +68,9 @@ def TestClusterInit():
cmd.append('--bridge=%s' % bridge) cmd.append('--bridge=%s' % bridge)
cmd.append('--master-netdev=%s' % bridge) cmd.append('--master-netdev=%s' % bridge)
htype = qa_config.get('hypervisor-type', None) htype = qa_config.get('default-hypervisor', None)
if htype: if htype:
cmd.append('--hypervisor-type=%s' % htype) cmd.append('--default-hypervisor=%s' % htype)
cmd.append(qa_config.get('name')) cmd.append(qa_config.get('name'))
...@@ -169,8 +169,8 @@ def TestClusterBurnin(): ...@@ -169,8 +169,8 @@ def TestClusterBurnin():
# Run burnin # Run burnin
cmd = [script, cmd = [script,
'--os=%s' % qa_config.get('os'), '--os=%s' % qa_config.get('os'),
'--os-size=%s' % qa_config.get('os-size'), '--disk-size=%s' % ",".join(qa_config.get('disk')),
'--swap-size=%s' % qa_config.get('swap-size'), '--disk-growth=%s' % ",".join(qa_config.get('disk-growth')),
'--disk-template=%s' % disk_template] '--disk-template=%s' % disk_template]
cmd += [inst['name'] for inst in instances] cmd += [inst['name'] for inst in instances]
AssertEqual(StartSSH(master['primary'], AssertEqual(StartSSH(master['primary'],
......
...@@ -53,6 +53,9 @@ def Validate(): ...@@ -53,6 +53,9 @@ def Validate():
raise qa_error.Error("Need at least one node") raise qa_error.Error("Need at least one node")
if len(cfg['instances']) < 1: if len(cfg['instances']) < 1:
raise qa_error.Error("Need at least one instance") 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): def get(name, default=None):
......
...@@ -41,9 +41,10 @@ def _GetDiskStatePath(disk): ...@@ -41,9 +41,10 @@ def _GetDiskStatePath(disk):
def _GetGenericAddParameters(): def _GetGenericAddParameters():
return ['--os-size=%s' % qa_config.get('os-size'), params = ['-B', '%s=%s' % (constants.BE_MEMORY, qa_config.get('mem'))]
'--swap-size=%s' % qa_config.get('swap-size'), for idx, size in enumerate(qa_config.get('disk')):
'--memory=%s' % qa_config.get('mem')] params.extend(["--disk", "%s:size=%s" % (idx, size)])
return params
def _DiskTest(node, disk_template): def _DiskTest(node, disk_template):
...@@ -153,22 +154,32 @@ def TestInstanceModify(instance): ...@@ -153,22 +154,32 @@ def TestInstanceModify(instance):
"""gnt-instance modify""" """gnt-instance modify"""
master = qa_config.GetMasterNode() 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_memory = qa_config.get('mem')
orig_bridge = qa_config.get('bridge', 'xen-br0') orig_bridge = qa_config.get('bridge', 'xen-br0')
args = [ args = [
["--memory", "128"], ["-B", "%s=128" % constants.BE_MEMORY],
["--memory", str(orig_memory)], ["-B", "%s=%s" % (constants.BE_MEMORY, orig_memory)],
["--cpu", "2"], ["-B", "%s=2" % constants.BE_VCPUS],
["--cpu", "1"], ["-B", "%s=1" % constants.BE_VCPUS],
["--bridge", "xen-br1"], ["-B", "%s=%s" % (constants.BE_VCPUS, constants.VALUE_DEFAULT)],
["--bridge", orig_bridge],
["--kernel", "/dev/null"], ["-H", "%s=%s" % (constants.HV_KERNEL_PATH, test_kernel)],
["--kernel", "default"], ["-H", "%s=%s" % (constants.HV_KERNEL_PATH, constants.VALUE_DEFAULT)],
["--initrd", "/dev/null"], ["-H", "%s=%s" % (constants.HV_INITRD_PATH, test_initrd)],
["--initrd", "none"], ["-H", "%s=%s" % (constants.HV_INITRD_PATH, constants.VALUE_NONE)],
["--initrd", "default"], ["-H", "%s=%s" % (constants.HV_INITRD_PATH, constants.VALUE_DEFAULT)],
["--hvm-boot-order", "acn"],
["--hvm-boot-order", "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: for alist in args:
cmd = ['gnt-instance', 'modify'] + alist + [instance['name']] cmd = ['gnt-instance', 'modify'] + alist + [instance['name']]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment