From 2095e9a15958df573aac63b25e66cc5e3422c6ee Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Tue, 11 Jul 2017 00:03:28 +0200 Subject: Allow ssh when testing via ansible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5a518242fec9c3434040bbfa0d725e16068cff25 Signed-off-by: Cédric Ollivier --- snaps/provisioning/tests/ansible_utils_tests.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/snaps/provisioning/tests/ansible_utils_tests.py b/snaps/provisioning/tests/ansible_utils_tests.py index 1cab8a6..4c8dea6 100644 --- a/snaps/provisioning/tests/ansible_utils_tests.py +++ b/snaps/provisioning/tests/ansible_utils_tests.py @@ -230,13 +230,13 @@ class AnsibleProvisioningTests(OSIntegrationTestCase): priv_ip = self.inst_creator.get_port_ip(self.port_1_name) self.assertTrue(check_dhcp_lease(self.nova, vm, priv_ip)) - # Block until VM's ssh port has been opened - self.assertTrue(self.inst_creator.vm_ssh_active(block=True)) - # Apply Security Group self.inst_creator.add_security_group( self.sec_grp_creator.get_security_group()) + # Block until VM's ssh port has been opened + self.assertTrue(self.inst_creator.vm_ssh_active(block=True)) + ssh_client = self.inst_creator.ssh_client() self.assertIsNotNone(ssh_client) out = ssh_client.exec_command('pwd')[1].channel.in_buffer.read(1024) @@ -282,6 +282,10 @@ class AnsibleProvisioningTests(OSIntegrationTestCase): priv_ip = self.inst_creator.get_port_ip(self.port_1_name) self.assertTrue(check_dhcp_lease(self.nova, vm, priv_ip)) + # Apply Security Group + self.inst_creator.add_security_group( + self.sec_grp_creator.get_security_group()) + # Block until VM's ssh port has been opened self.assertTrue(self.inst_creator.vm_ssh_active(block=True)) -- cgit 1.2.3-korg