Commit d488adb6 authored by Michael Hanselmann's avatar Michael Hanselmann

QA: Test some instance parameters depending on hypervisor

For example, the “initrd_path” parameter is only available with xen-pvm,
whereas “boot_order” is only available with xen-hvm.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent e7b6183b
......@@ -259,6 +259,8 @@ def TestInstanceInfo(instance):
@InstanceCheck(INST_UP, INST_UP, FIRST_ARG)
def TestInstanceModify(instance):
"""gnt-instance modify"""
default_hv = qa_config.GetDefaultHypervisor()
# Assume /sbin/init exists on all systems
test_kernel = "/sbin/init"
test_initrd = test_kernel
......@@ -266,6 +268,7 @@ def TestInstanceModify(instance):
orig_maxmem = qa_config.get(constants.BE_MAXMEM)
orig_minmem = qa_config.get(constants.BE_MINMEM)
#orig_bridge = qa_config.get("bridge", "xen-br0")
args = [
["-B", "%s=128" % constants.BE_MINMEM],
["-B", "%s=128" % constants.BE_MAXMEM],
......@@ -279,18 +282,24 @@ def TestInstanceModify(instance):
["-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", "no_%s" % (constants.HV_INITRD_PATH, )],
["-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)],
]
if default_hv == constants.HT_XEN_PVM:
args.extend([
["-H", "%s=%s" % (constants.HV_INITRD_PATH, test_initrd)],
["-H", "no_%s" % (constants.HV_INITRD_PATH, )],
["-H", "%s=%s" % (constants.HV_INITRD_PATH, constants.VALUE_DEFAULT)],
])
elif default_hv == constants.HT_XEN_HVM:
args.extend([
["-H", "%s=acn" % constants.HV_BOOT_ORDER],
["-H", "%s=%s" % (constants.HV_BOOT_ORDER, constants.VALUE_DEFAULT)],
])
for alist in args:
AssertCommand(["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