From 5da7333450dcee518b43bddb755d579e34bf271d Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Fri, 27 Jul 2018 22:34:59 +0000 Subject: [PATCH] Test propagate_uplink_status on create port Depends-On: Ie8260c332e24c1880f9f82e6b6dacca8415be842 Change-Id: Iffffb177990c8f615d962ad35b58ecf425143e37 Related-Bug: #1722720 --- .zuul.yaml | 3 ++- neutron_tempest_plugin/api/test_ports.py | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.zuul.yaml b/.zuul.yaml index bd8619f1..7d7fa5ef 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -16,7 +16,7 @@ tox_envlist: all devstack_localrc: TEMPEST_PLUGINS: /opt/stack/neutron-tempest-plugin - NETWORK_API_EXTENSIONS: address-scope,agent,allowed-address-pairs,auto-allocated-topology,availability_zone,binding,default-subnetpools,dhcp_agent_scheduler,dns-domain-ports,dns-integration,dvr,empty-string-filtering,ext-gw-mode,external-net,extra_dhcp_opt,extraroute,filter-validation,fip-port-details,flavors,ip-substring-filtering,l3-flavors,l3-ha,l3_agent_scheduler,logging,metering,multi-provider,net-mtu,net-mtu-writable,network-ip-availability,network_availability_zone,pagination,port-security,project-id,provider,qos,qos-bw-minimum-ingress,qos-fip,quotas,quota_details,rbac-policies,router,router_availability_zone,security-group,port-mac-address-regenerate,port-security-groups-filtering,segment,service-type,sorting,standard-attr-description,standard-attr-revisions,standard-attr-segment,standard-attr-timestamp,standard-attr-tag,subnet_allocation,trunk,trunk-details + NETWORK_API_EXTENSIONS: address-scope,agent,allowed-address-pairs,auto-allocated-topology,availability_zone,binding,default-subnetpools,dhcp_agent_scheduler,dns-domain-ports,dns-integration,dvr,empty-string-filtering,ext-gw-mode,external-net,extra_dhcp_opt,extraroute,filter-validation,fip-port-details,flavors,ip-substring-filtering,l3-flavors,l3-ha,l3_agent_scheduler,logging,metering,multi-provider,net-mtu,net-mtu-writable,network-ip-availability,network_availability_zone,pagination,port-security,project-id,provider,qos,qos-bw-minimum-ingress,qos-fip,quotas,quota_details,rbac-policies,router,router_availability_zone,security-group,port-mac-address-regenerate,port-security-groups-filtering,segment,service-type,sorting,standard-attr-description,standard-attr-revisions,standard-attr-segment,standard-attr-timestamp,standard-attr-tag,subnet_allocation,trunk,trunk-details,uplink-status-propagation devstack_plugins: neutron: git://git.openstack.org/openstack/neutron.git neutron-tempest-plugin: git://git.openstack.org/openstack/neutron-tempest-plugin.git @@ -27,6 +27,7 @@ neutron-qos: true neutron-segments: true neutron-trunk: true + neutron-uplink-status-propagation: true devstack_local_conf: post-config: $NEUTRON_CONF: diff --git a/neutron_tempest_plugin/api/test_ports.py b/neutron_tempest_plugin/api/test_ports.py index 3b877c2b..52783b98 100644 --- a/neutron_tempest_plugin/api/test_ports.py +++ b/neutron_tempest_plugin/api/test_ports.py @@ -134,6 +134,28 @@ class PortsTestJSON(base.BaseNetworkTest): expected = [s['id'], s['id']] self.assertEqual(expected, subnets) + @decorators.idempotent_id('9700828d-86eb-4f21-9fa3-da487a2d77f2') + @utils.requires_ext(extension="uplink-status-propagation", + service="network") + def test_create_port_with_propagate_uplink_status(self): + body = self.create_port(self.network, propagate_uplink_status=True) + self.assertTrue(body['propagate_uplink_status']) + body = self.client.list_ports(id=body['id'])['ports'][0] + self.assertTrue(body['propagate_uplink_status']) + body = self.client.show_port(body['id'])['port'] + self.assertTrue(body['propagate_uplink_status']) + + @decorators.idempotent_id('c396a880-0c7b-409d-a80b-800a3d09bdc4') + @utils.requires_ext(extension="uplink-status-propagation", + service="network") + def test_create_port_without_propagate_uplink_status(self): + body = self.create_port(self.network) + self.assertFalse(body['propagate_uplink_status']) + body = self.client.list_ports(id=body['id'])['ports'][0] + self.assertFalse(body['propagate_uplink_status']) + body = self.client.show_port(body['id'])['port'] + self.assertFalse(body['propagate_uplink_status']) + class PortsSearchCriteriaTest(base.BaseSearchCriteriaTest):