Add QA tests for “gnt-instance reboot”
authorMichael Hanselmann <hansmi@google.com>
Fri, 30 May 2008 10:55:03 +0000 (10:55 +0000)
committerMichael Hanselmann <hansmi@google.com>
Fri, 30 May 2008 10:55:03 +0000 (10:55 +0000)
Reviewed-by: ultrotter

qa/ganeti-qa.py
qa/qa-sample.yaml
qa/qa_instance.py

index ab5c99d..f34339f 100755 (executable)
@@ -153,6 +153,9 @@ def RunCommonInstanceTests(instance):
     RunTest(qa_instance.TestInstanceReinstall, instance)
     RunTest(qa_instance.TestInstanceStartup, instance)
 
+  if qa_config.TestEnabled('instance-reboot'):
+    RunTest(qa_instance.TestInstanceReboot, instance)
+
   if qa_config.TestEnabled('tags'):
     RunTest(qa_tags.TestInstanceTags, instance)
 
index 39098a9..2f52d17 100644 (file)
@@ -66,6 +66,7 @@ tests:
   instance-export: True
   instance-import: True
   instance-reinstall: True
+  instance-reboot: True
   instance-shutdown: True
   instance-automatic-restart: False
   instance-consecutive-failures: False
index a0ed735..015ca4c 100644 (file)
@@ -121,6 +121,18 @@ def TestInstanceShutdown(instance):
                        utils.ShellQuoteArgs(cmd)).wait(), 0)
 
 
+@qa_utils.DefineHook('instance-reboot')
+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']]
+    AssertEqual(StartSSH(master['primary'],
+                         utils.ShellQuoteArgs(cmd)).wait(), 0)
+
+
 @qa_utils.DefineHook('instance-reinstall')
 def TestInstanceReinstall(instance):
   """gnt-instance reinstall"""