summaryrefslogtreecommitdiff
path: root/heat/tests/openstack
diff options
context:
space:
mode:
authorJason Li <dl2017@att.com>2020-05-05 00:39:43 -0500
committerJason Li <dl2017@att.com>2020-05-06 09:43:51 -0500
commit4d11d3117a44f13a1271b9c018707d316d49100a (patch)
treea51718f9b94c5474e66ba79eb497c6e96ac9b229 /heat/tests/openstack
parent1067288b755dc7227331d4d2dc1e37576a56c1d4 (diff)
downloadheat-4d11d3117a44f13a1271b9c018707d316d49100a.tar.gz
Add propagate_uplink_status support to OS::Neutron::Port
This resource depends on Neutron API extension ``uplink-status-propagation`` and the default is ``False``. If this property is set to ``True``, the VF link state can follow that of PF. See release note at https://docs.openstack.org/releasenotes/neutron/stein.html. Change-Id: I46749f0458fd69e3f62d03e5b4648e1704750e15
Diffstat (limited to 'heat/tests/openstack')
-rw-r--r--heat/tests/openstack/neutron/test_neutron_port.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/heat/tests/openstack/neutron/test_neutron_port.py b/heat/tests/openstack/neutron/test_neutron_port.py
index 228273cde..2e534689a 100644
--- a/heat/tests/openstack/neutron/test_neutron_port.py
+++ b/heat/tests/openstack/neutron/test_neutron_port.py
@@ -67,6 +67,18 @@ resources:
'''
+neutron_port_propagate_ul_status_template = '''
+heat_template_version: 2015-04-30
+description: Template to test port Neutron resource
+resources:
+ port:
+ type: OS::Neutron::Port
+ properties:
+ network: abcd1234
+ propagate_uplink_status: True
+'''
+
+
class NeutronPortTest(common.HeatTestCase):
def setUp(self):
@@ -239,6 +251,34 @@ class NeutronPortTest(common.HeatTestCase):
'device_owner': ''
}})
+ def test_port_propagate_uplink_status(self):
+ t = template_format.parse(neutron_port_propagate_ul_status_template)
+ stack = utils.parse_stack(t)
+
+ self.find_mock.return_value = 'abcd1234'
+
+ self.create_mock.return_value = {'port': {
+ "status": "BUILD",
+ "id": "fc68ea2c-b60b-4b4f-bd82-94ec81110766"
+ }}
+
+ self.port_show_mock.return_value = {'port': {
+ "status": "ACTIVE",
+ "id": "fc68ea2c-b60b-4b4f-bd82-94ec81110766",
+ }}
+
+ port = stack['port']
+ scheduler.TaskRunner(port.create)()
+ self.create_mock.assert_called_once_with({'port': {
+ 'network_id': u'abcd1234',
+ 'propagate_uplink_status': True,
+ 'name': utils.PhysName(stack.name, 'port'),
+ 'admin_state_up': True,
+ 'binding:vnic_type': 'normal',
+ 'device_id': '',
+ 'device_owner': ''
+ }})
+
def test_missing_mac_address(self):
t = template_format.parse(neutron_port_with_address_pair_template)
t['resources']['port']['properties']['allowed_address_pairs'][0].pop(
@@ -579,6 +619,7 @@ class NeutronPortTest(common.HeatTestCase):
'ipv4_address_scope': None, 'description': '',
'subnets': [subnet_dict['id']],
'port_security_enabled': True,
+ 'propagate_uplink_status': True,
'tenant_id': '58a61fc3992944ce971404a2ece6ff98',
'tags': [], 'ipv6_address_scope': None,
'project_id': '58a61fc3992944ce971404a2ece6ff98',
@@ -882,6 +923,7 @@ class NeutronPortTest(common.HeatTestCase):
'tenant_id': '30f466e3d14b4251853899f9c26e2b66',
'binding:profile': {},
'port_security_enabled': True,
+ 'propagate_uplink_status': True,
'binding:vnic_type': 'normal',
'fixed_ips': [
{'subnet_id': '02d9608f-8f30-4611-ad02-69855c82457f',
@@ -901,6 +943,7 @@ class NeutronPortTest(common.HeatTestCase):
'admin_state_up': True,
'device_owner': '',
'port_security_enabled': True,
+ 'propagate_uplink_status': True,
'binding:vnic_type': 'normal',
'fixed_ips': [
{'subnet': '02d9608f-8f30-4611-ad02-69855c82457f',