Commit 1d103c02 authored by Iustin Pop's avatar Iustin Pop
Browse files

QA, burnin: allow selection of reboot types



After some more investigation, only the soft reboot type fails for Xen
3.4 (due to the reboot/uptime time counter). As such, it's better to
allow selective testing, since we do want to test in general these
opcodes/the command line script.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarLuca Bigliardi <shammash@google.com>
parent 8178b322
...@@ -96,7 +96,8 @@ ...@@ -96,7 +96,8 @@
"burnin-in-parallel": false, "burnin-in-parallel": false,
"burnin-check-instances": false, "burnin-check-instances": false,
"burnin-rename": "xen-test-rename", "burnin-rename": "xen-test-rename",
"burnin-reboot": true "burnin-reboot": true,
"reboot-types": ["soft", "hard", "full"]
}, },
"# vim: set syntax=javascript :": null "# vim: set syntax=javascript :": null
......
...@@ -232,6 +232,7 @@ def TestClusterBurnin(): ...@@ -232,6 +232,7 @@ def TestClusterBurnin():
check_inst = options.get('burnin-check-instances', False) check_inst = options.get('burnin-check-instances', False)
do_rename = options.get('burnin-rename', '') do_rename = options.get('burnin-rename', '')
do_reboot = options.get('burnin-reboot', True) do_reboot = options.get('burnin-reboot', True)
reboot_types = options.get("reboot-types", constants.REBOOT_TYPES)
# Get as many instances as we need # Get as many instances as we need
instances = [] instances = []
...@@ -263,6 +264,8 @@ def TestClusterBurnin(): ...@@ -263,6 +264,8 @@ def TestClusterBurnin():
cmd.append('--rename=%s' % do_rename) cmd.append('--rename=%s' % do_rename)
if not do_reboot: if not do_reboot:
cmd.append('--no-reboot') cmd.append('--no-reboot')
else:
cmd.append('--reboot-types=%s' % ",".join(reboot_types))
cmd += [inst['name'] for inst in instances] cmd += [inst['name'] for inst in instances]
AssertEqual(StartSSH(master['primary'], AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0) utils.ShellQuoteArgs(cmd)).wait(), 0)
......
...@@ -111,9 +111,11 @@ def TestInstanceReboot(instance): ...@@ -111,9 +111,11 @@ def TestInstanceReboot(instance):
"""gnt-instance reboot""" """gnt-instance reboot"""
master = qa_config.GetMasterNode() master = qa_config.GetMasterNode()
for reboottype in ["soft", "hard", "full"]: options = qa_config.get('options', {})
cmd = ['gnt-instance', 'reboot', '--type=%s' % reboottype, reboot_types = options.get("reboot-types", constants.REBOOT_TYPES)
instance['name']]
for rtype in reboot_types:
cmd = ['gnt-instance', 'reboot', '--type=%s' % rtype, instance['name']]
AssertEqual(StartSSH(master['primary'], AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0) utils.ShellQuoteArgs(cmd)).wait(), 0)
......
...@@ -157,6 +157,8 @@ OPTIONS = [ ...@@ -157,6 +157,8 @@ OPTIONS = [
cli.cli_option("--no-reboot", dest="do_reboot", cli.cli_option("--no-reboot", dest="do_reboot",
help="Skip instance reboot", action="store_false", help="Skip instance reboot", action="store_false",
default=True), default=True),
cli.cli_option("--reboot-types", dest="reboot_types",
help="Specify the reboot types", default=None),
cli.cli_option("--no-activate-disks", dest="do_activate_disks", cli.cli_option("--no-activate-disks", dest="do_activate_disks",
help="Skip disk activation/deactivation", help="Skip disk activation/deactivation",
action="store_false", default=True), action="store_false", default=True),
...@@ -482,6 +484,14 @@ class Burner(object): ...@@ -482,6 +484,14 @@ class Burner(object):
if options.hypervisor: if options.hypervisor:
self.hypervisor, self.hvp = options.hypervisor self.hypervisor, self.hvp = options.hypervisor
if options.reboot_types is None:
options.reboot_types = constants.REBOOT_TYPES
else:
options.reboot_types = options.reboot_types.split(",")
rt_diff = set(options.reboot_types).difference(constants.REBOOT_TYPES)
if rt_diff:
Err("Invalid reboot types specified: %s" % utils.CommaJoin(rt_diff))
socket.setdefaulttimeout(options.net_timeout) socket.setdefaulttimeout(options.net_timeout)
def GetState(self): def GetState(self):
...@@ -815,7 +825,7 @@ class Burner(object): ...@@ -815,7 +825,7 @@ class Burner(object):
for instance in self.instances: for instance in self.instances:
Log("instance %s", instance, indent=1) Log("instance %s", instance, indent=1)
ops = [] ops = []
for reboot_type in constants.REBOOT_TYPES: for reboot_type in self.opts.reboot_types:
op = opcodes.OpRebootInstance(instance_name=instance, op = opcodes.OpRebootInstance(instance_name=instance,
reboot_type=reboot_type, reboot_type=reboot_type,
ignore_secondaries=False) ignore_secondaries=False)
......
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