diff --git a/qa/qa-sample.json b/qa/qa-sample.json index f60c5964a38b3244bd2d7f5d66bdc13e4cdcb46a..ab76bbe40cdcda86279588eab0ef738ef01de1ac 100644 --- a/qa/qa-sample.json +++ b/qa/qa-sample.json @@ -96,7 +96,8 @@ "burnin-in-parallel": false, "burnin-check-instances": false, "burnin-rename": "xen-test-rename", - "burnin-reboot": true + "burnin-reboot": true, + "reboot-types": ["soft", "hard", "full"] }, "# vim: set syntax=javascript :": null diff --git a/qa/qa_cluster.py b/qa/qa_cluster.py index 8b53a09c0aba14ad60d23d4340282278b15dd854..e2a672e1ed8f5018a3aa336f94f29479626db665 100644 --- a/qa/qa_cluster.py +++ b/qa/qa_cluster.py @@ -232,6 +232,7 @@ def TestClusterBurnin(): check_inst = options.get('burnin-check-instances', False) do_rename = options.get('burnin-rename', '') do_reboot = options.get('burnin-reboot', True) + reboot_types = options.get("reboot-types", constants.REBOOT_TYPES) # Get as many instances as we need instances = [] @@ -263,6 +264,8 @@ def TestClusterBurnin(): cmd.append('--rename=%s' % do_rename) if not do_reboot: cmd.append('--no-reboot') + else: + cmd.append('--reboot-types=%s' % ",".join(reboot_types)) cmd += [inst['name'] for inst in instances] AssertEqual(StartSSH(master['primary'], utils.ShellQuoteArgs(cmd)).wait(), 0) diff --git a/qa/qa_instance.py b/qa/qa_instance.py index 72b69de2628bceb806b81e18700f351690ceda0b..2f18add3d1db314c7e6ad127f592c438ac7945e3 100644 --- a/qa/qa_instance.py +++ b/qa/qa_instance.py @@ -111,9 +111,11 @@ def TestInstanceReboot(instance): """gnt-instance reboot""" master = qa_config.GetMasterNode() - for reboottype in ["soft", "hard", "full"]: - cmd = ['gnt-instance', 'reboot', '--type=%s' % reboottype, - instance['name']] + options = qa_config.get('options', {}) + reboot_types = options.get("reboot-types", constants.REBOOT_TYPES) + + for rtype in reboot_types: + cmd = ['gnt-instance', 'reboot', '--type=%s' % rtype, instance['name']] AssertEqual(StartSSH(master['primary'], utils.ShellQuoteArgs(cmd)).wait(), 0) diff --git a/tools/burnin b/tools/burnin index 17e58500105a558eac84964b9af246346bb5ec15..4a0f567e28c37d2e7087212f75486174220b7ca6 100755 --- a/tools/burnin +++ b/tools/burnin @@ -157,6 +157,8 @@ OPTIONS = [ cli.cli_option("--no-reboot", dest="do_reboot", help="Skip instance reboot", action="store_false", 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", help="Skip disk activation/deactivation", action="store_false", default=True), @@ -482,6 +484,14 @@ class Burner(object): if 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) def GetState(self): @@ -815,7 +825,7 @@ class Burner(object): for instance in self.instances: Log("instance %s", instance, indent=1) ops = [] - for reboot_type in constants.REBOOT_TYPES: + for reboot_type in self.opts.reboot_types: op = opcodes.OpRebootInstance(instance_name=instance, reboot_type=reboot_type, ignore_secondaries=False)