summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-07-11 00:03:28 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2017-07-11 00:03:28 +0200
commit2095e9a15958df573aac63b25e66cc5e3422c6ee (patch)
treeaa699c2b1343ca63d08c8bd1cadbbe3259abcabf
parent4ad9342789eb54b91147533691e99270ccd9cca1 (diff)
Allow ssh when testing via ansible
Change-Id: I5a518242fec9c3434040bbfa0d725e16068cff25 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
-rw-r--r--snaps/provisioning/tests/ansible_utils_tests.py10
1 files 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))