diff --git a/qa/ganeti-qa.py b/qa/ganeti-qa.py index 5e25d4cc7c4a6e6e5231dae742e4dc5b75f1b291..01614e0246cc2ad5c21d36670b4219a61fc6abe6 100755 --- a/qa/ganeti-qa.py +++ b/qa/ganeti-qa.py @@ -143,6 +143,9 @@ def RunCommonInstanceTests(instance): if qa_config.TestEnabled('instance-modify'): RunTest(qa_instance.TestInstanceModify, instance) + if qa_config.TestEnabled('instance-console'): + RunTest(qa_instance.TestInstanceConsole, instance) + if qa_config.TestEnabled('instance-reinstall'): RunTest(qa_instance.TestInstanceShutdown, instance) RunTest(qa_instance.TestInstanceReinstall, instance) diff --git a/qa/qa-sample.yaml b/qa/qa-sample.yaml index 41fe8cee961a02f7d4087f18aa0970f9396e5838..c4aedf9843413ed132a64856cd874d8b2c10580e 100644 --- a/qa/qa-sample.yaml +++ b/qa/qa-sample.yaml @@ -64,6 +64,10 @@ tests: instance-automatic-restart: False instance-consecutive-failures: False + # This test might fail with certain hypervisor types, depending on whether + # they support the `gnt-instance console' command. + instance-console: False + # Make sure not to include the disk(s) required for Dom0 to be included in # the volume group used for instances. Otherwise the whole system may stop # working until restarted. diff --git a/qa/qa_instance.py b/qa/qa_instance.py index d839631275feb85ff0c8373bbe5e47c22639b2b4..d6de305cd82f5164dd3c231e52c06c8e068fc122 100644 --- a/qa/qa_instance.py +++ b/qa/qa_instance.py @@ -184,6 +184,16 @@ def TestInstanceList(): utils.ShellQuoteArgs(cmd)).wait(), 0) +@qa_utils.DefineHook('instance-console') +def TestInstanceConsole(instance): + """gnt-instance console""" + master = qa_config.GetMasterNode() + + cmd = ['gnt-instance', 'console', '--show-cmd', instance['name']] + AssertEqual(StartSSH(master['primary'], + utils.ShellQuoteArgs(cmd)).wait(), 0) + + @qa_utils.DefineHook('backup-export') def TestInstanceExport(instance, node): """gnt-backup export"""