Merge "Use ipv4 subnet in Heat scenario tests"
This commit is contained in:
@@ -172,6 +172,12 @@ class HeatIntegrationTest(testscenarios.WithScenarios,
|
||||
if net['name'] == net_name:
|
||||
return net
|
||||
|
||||
def _get_subnet_by_version(self, network, ip_version=4):
|
||||
for subnet_id in self.net['subnets']:
|
||||
subnet_info = self.network_client.show_subnet(subnet_id)
|
||||
if subnet_info['subnet']['ip_version'] == ip_version:
|
||||
return subnet_id
|
||||
|
||||
@staticmethod
|
||||
def _stack_output(stack, output_key):
|
||||
"""Return a stack output value for a given key."""
|
||||
|
||||
@@ -25,6 +25,7 @@ class ScenarioTestsBase(test.HeatIntegrationTest):
|
||||
if not self.conf.fixed_network_name:
|
||||
raise self.skipException("No default network configured to test")
|
||||
self.net = self._get_network()
|
||||
self.subnet_v4 = self._get_subnet_by_version(self.net)
|
||||
|
||||
if not self.conf.image_ref:
|
||||
raise self.skipException("No image configured to test")
|
||||
|
||||
@@ -106,6 +106,8 @@ resources:
|
||||
floating_network: { get_param: external_network_id }
|
||||
port_id:
|
||||
{ get_attr: [test_pool, vip, 'port_id'] }
|
||||
fixed_ip_address:
|
||||
{ get_attr: [test_pool, vip, 'address'] }
|
||||
|
||||
LBaaS:
|
||||
type: OS::Neutron::LoadBalancer
|
||||
|
||||
@@ -55,7 +55,7 @@ class NeutronLoadBalancerTest(scenario_base.ScenarioTestsBase):
|
||||
'key_name': self.keypair_name,
|
||||
'flavor': self.conf.minimal_instance_type,
|
||||
'image': self.conf.image_ref,
|
||||
'private_subnet_id': self.net['subnets'][0],
|
||||
'private_subnet_id': self.subnet_v4,
|
||||
'external_network_id': self.public_net['id'],
|
||||
'timeout': self.conf.build_timeout
|
||||
}
|
||||
|
||||
@@ -91,11 +91,11 @@ class CfnInitIntegrationTest(scenario_base.ScenarioTestsBase):
|
||||
via generated keypair.
|
||||
"""
|
||||
parameters = {
|
||||
"key_name": self.keypair_name,
|
||||
"flavor": self.conf.instance_type,
|
||||
"image": self.conf.image_ref,
|
||||
"timeout": self.conf.build_timeout,
|
||||
"subnet": self.net["subnets"][0],
|
||||
'key_name': self.keypair_name,
|
||||
'flavor': self.conf.instance_type,
|
||||
'image': self.conf.image_ref,
|
||||
'timeout': self.conf.build_timeout,
|
||||
'subnet': self.subnet_v4,
|
||||
}
|
||||
|
||||
# Launch stack
|
||||
|
||||
Reference in New Issue
Block a user