]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
heat tests : Fixup IHA functional test
authorSteven Hardy <shardy@redhat.com>
Thu, 20 Sep 2012 15:02:27 +0000 (16:02 +0100)
committerSteven Hardy <shardy@redhat.com>
Thu, 20 Sep 2012 16:57:45 +0000 (17:57 +0100)
Add more prints to monitor progress and ensure
the halt sudo command works by using the new utils
function, workaround paramiko SSH issue

Ref #246

Change-Id: I656925e61b878a9f2eabfbd65bee796d9d8ee54d
Signed-off-by: Steven Hardy <shardy@redhat.com>
heat/tests/functional/test_WordPress_Single_Instance_With_IHA.py

index 19b783b49093e52c24a68299125f4932d14e03d2..24e74b0959b77df9d2d0876447f1c5c2b697cb52 100644 (file)
@@ -65,7 +65,7 @@ class WordPressIHAFunctionalTest(unittest.TestCase):
         # Now shut down the instance via SSH, and wait for HA to reprovision
         # note it may not come back on the same IP
         stdin, stdout, stderr =\
-            self.WikiDatabase.get_ssh_client().exec_command('sudo /sbin/halt')
+            self.WikiDatabase.exec_sudo_command('/sbin/halt')
 
         # Now poll the stack events, as the current WikiDatabase instance
         # should be replaced with a new one
@@ -74,6 +74,8 @@ class WordPressIHAFunctionalTest(unittest.TestCase):
         tries = 0
         while (tries <= 500):
                 pollids = self.stack.instance_phys_ids()
+                print "Waiting for Instance to be replaced %s/%s %s" %\
+                      (tries, 500, pollids)
                 if (len(pollids) == 2):
                     self.assertTrue(pollids[1] != phys_res_ids[0])
                     print "Instance replaced, new ID = %s" % pollids[1]
@@ -85,6 +87,11 @@ class WordPressIHAFunctionalTest(unittest.TestCase):
         self.assertTrue(tries < 500)
 
         # Create a new Instance object and wait for boot
+        # It seems to be necessary to close the old WikiDatabase
+        # instance SSH transport, or paramiko throws an exception
+        # when the SSH daemon starts on the new instance if it comes
+        # up on the same IP address, suspect paramiko bug, TBC
+        self.WikiDatabase.close_ssh_client()
         self.WikiDatabaseNew = util.Instance(self, 'WikiDatabase')
         self.WikiDatabaseNew.wait_for_boot()
         self.WikiDatabaseNew.check_cfntools()