Commit 1d693311 authored by Michael Hanselmann's avatar Michael Hanselmann

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
{
"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,
......
......@@ -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'],
......
......@@ -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):
......
......@@ -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']]
......
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