Don't use Tempest internal methods

All changed methods are clearly internal methods of Tempest, and the
Tempest commit 64e6b4457c748f74bfb4fbf3860ab65b65ae9beb has removed
the internal methods and now the gate issue happens.
This patch makes this project to use better ones instead.

Note: Also had to pull in some fixes from the followup cherry-pick to
make this actually pass well enough to merge.

Related-Bug: #1667824
Change-Id: I901baea1010f05f393919e5ecdd16dc1b322b213
(cherry picked from commit 6ea36282f4)
This commit is contained in:
Ken'ichi Ohmichi 2017-02-24 15:04:22 -08:00 committed by Michael Johnson
parent d4c3607a78
commit 58836c2693
1 changed files with 10 additions and 6 deletions

View File

@ -65,9 +65,6 @@ class BaseTestCase(manager.NetworkScenarioTest):
self.server_ips = {}
self.server_fixed_ips = {}
self._create_security_group_for_test()
self._set_net_and_subnet()
mgr = self.get_client_manager()
auth_provider = mgr.auth_provider
@ -84,6 +81,10 @@ class BaseTestCase(manager.NetworkScenarioTest):
health_monitors_client.HealthMonitorsClient(
*self.client_args))
self.tenant_id = self.load_balancers_client.tenant_id
self._create_security_group_for_test()
self._set_net_and_subnet()
# admin network client needed for assigning octavia port to flip
admin_manager = credentials_factory.AdminManager()
admin_manager.auth_provider.fill_credentials()
@ -111,12 +112,14 @@ class BaseTestCase(manager.NetworkScenarioTest):
fallback in absence of tenant networking.
"""
try:
tenant_net = self._list_networks(tenant_id=self.tenant_id)[0]
tenant_net = self.admin_manager.networks_client.list_networks(
tenant_id=self.tenant_id)['networks'][0]
except IndexError:
tenant_net = None
if tenant_net:
tenant_subnet = self._list_subnets(tenant_id=self.tenant_id)[0]
tenant_subnet = self.admin_manager.subnets_client.list_subnets(
tenant_id=self.tenant_id)['subnets'][0]
self.subnet = tenant_subnet
self.network = tenant_net
else:
@ -126,7 +129,8 @@ class BaseTestCase(manager.NetworkScenarioTest):
# with the fixed network is the one we want. In the future, we
# should instead pull a subnet id from config, which is set by
# devstack/admin/etc.
subnet = self._list_subnets(network_id=self.network['id'])[0]
subnet = self.admin_manager.subnets_client.list_subnets(
network_id=self.network['id'])['subnets'][0]
self.subnet = subnet
def _create_security_group_for_test(self):