diff options
author | Steven Pisarski <s.pisarski@cablelabs.com> | 2017-07-10 18:36:54 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-07-10 18:36:54 +0000 |
commit | 4ad9342789eb54b91147533691e99270ccd9cca1 (patch) | |
tree | 263771bcdf3ef69c573062672682e6e557a9c410 | |
parent | e9aefb62e3e2942084b3845c08d3b0362271b852 (diff) | |
parent | 552e9c7a67ad4f07579385c2fada52f52cf5c532 (diff) |
Merge "Changed validation logic to check for DHCP lease before SSH connection."
-rw-r--r-- | snaps/provisioning/tests/ansible_utils_tests.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/snaps/provisioning/tests/ansible_utils_tests.py b/snaps/provisioning/tests/ansible_utils_tests.py index 83e34ca..1cab8a6 100644 --- a/snaps/provisioning/tests/ansible_utils_tests.py +++ b/snaps/provisioning/tests/ansible_utils_tests.py @@ -27,7 +27,8 @@ from snaps.openstack import create_router from snaps.openstack.create_security_group import ( SecurityGroupRuleSettings, Direction, Protocol, OpenStackSecurityGroup, SecurityGroupSettings) -from snaps.openstack.tests import openstack_tests, create_instance_tests +from snaps.openstack.tests import openstack_tests +from snaps.openstack.tests.create_instance_tests import check_dhcp_lease from snaps.openstack.tests.os_source_file_test import OSIntegrationTestCase from snaps.openstack.utils import nova_utils from snaps.provisioning import ansible_utils @@ -226,13 +227,12 @@ class AnsibleProvisioningTests(OSIntegrationTestCase): """ vm = self.inst_creator.create(block=True) + 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)) - priv_ip = self.inst_creator.get_port_ip(self.port_1_name) - self.assertTrue(create_instance_tests.check_dhcp_lease( - self.nova, vm, priv_ip)) - # Apply Security Group self.inst_creator.add_security_group( self.sec_grp_creator.get_security_group()) @@ -279,13 +279,12 @@ class AnsibleProvisioningTests(OSIntegrationTestCase): """ vm = self.inst_creator.create(block=True) + 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)) - priv_ip = self.inst_creator.get_port_ip(self.port_1_name) - self.assertTrue(create_instance_tests.check_dhcp_lease( - self.nova, vm, priv_ip)) - # Apply Security Group self.inst_creator.add_security_group( self.sec_grp_creator.get_security_group()) |