From: Cédric Ollivier Date: Mon, 10 Jul 2017 22:03:28 +0000 (+0200) Subject: Allow ssh when testing via ansible X-Git-Tag: opnfv-5.0.0~77^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=2095e9a15958df573aac63b25e66cc5e3422c6ee;p=snaps.git Allow ssh when testing via ansible Change-Id: I5a518242fec9c3434040bbfa0d725e16068cff25 Signed-off-by: Cédric Ollivier --- 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))