Forward-port: Fix two problems in QA scripts
authorMichael Hanselmann <hansmi@google.com>
Fri, 6 Jun 2008 09:32:24 +0000 (09:32 +0000)
committerMichael Hanselmann <hansmi@google.com>
Fri, 6 Jun 2008 09:32:24 +0000 (09:32 +0000)
- Failover back to original node in instance failure test
- Exclude secondary node from list of potential nodes in
  replace-disks test

Reviewed-by: iustinp

qa/ganeti-qa.py
qa/qa_instance.py

index 3278c1a..599eabb 100755 (executable)
@@ -211,7 +211,7 @@ def RunHardwareFailureTests(instance, pnode, snode):
     RunTest(qa_instance.TestInstanceFailover, instance)
 
   if qa_config.TestEnabled('instance-replace-disks'):
-    othernode = qa_config.AcquireNode(exclude=pnode)
+    othernode = qa_config.AcquireNode(exclude=[pnode, snode])
     try:
       RunTest(qa_instance.TestReplaceDisks,
               instance, pnode, snode, othernode)
index ae35bf9..b2e8f46 100644 (file)
@@ -142,6 +142,11 @@ def TestInstanceFailover(instance):
   AssertEqual(StartSSH(master['primary'],
                        utils.ShellQuoteArgs(cmd)).wait(), 0)
 
+  # ... and back
+  cmd = ['gnt-instance', 'failover', '--force', instance['name']]
+  AssertEqual(StartSSH(master['primary'],
+                       utils.ShellQuoteArgs(cmd)).wait(), 0)
+
 
 @qa_utils.DefineHook('instance-info')
 def TestInstanceInfo(instance):