Merge "Add IPv6 port API test class and basic test"
diff --git a/neutron_tempest_plugin/api/test_ports.py b/neutron_tempest_plugin/api/test_ports.py
index 3168953..f1dfe5c 100644
--- a/neutron_tempest_plugin/api/test_ports.py
+++ b/neutron_tempest_plugin/api/test_ports.py
@@ -61,6 +61,20 @@
body = self.client.list_ports(id=body['port']['id'])['ports'][0]
self.assertEqual('d2', body['description'])
+ @decorators.idempotent_id('3ae162e8-ff00-490c-a423-6a88e48f1ed6')
+ def test_create_update_port_security(self):
+ body = self.create_port(self.network,
+ port_security_enabled=True)
+ self.assertTrue(body['port_security_enabled'])
+ body = self.client.list_ports(id=body['id'])['ports'][0]
+ self.assertTrue(body['port_security_enabled'])
+ body = self.client.update_port(body['id'],
+ port_security_enabled=False,
+ security_groups=[])
+ self.assertFalse(body['port']['port_security_enabled'])
+ body = self.client.list_ports(id=body['port']['id'])['ports'][0]
+ self.assertFalse(body['port_security_enabled'])
+
@decorators.idempotent_id('539fbefe-fb36-48aa-9a53-8c5fbd44e492')
@utils.requires_ext(extension="dns-integration",
service="network")
diff --git a/neutron_tempest_plugin/api/test_routers_negative.py b/neutron_tempest_plugin/api/test_routers_negative.py
index 8700761..86d58e2 100644
--- a/neutron_tempest_plugin/api/test_routers_negative.py
+++ b/neutron_tempest_plugin/api/test_routers_negative.py
@@ -19,6 +19,10 @@
import testtools
from neutron_tempest_plugin.api import base_routers as base
+from neutron_tempest_plugin import config
+
+
+CONF = config.CONF
class RoutersNegativeTestBase(base.BaseRouterTest):
@@ -88,6 +92,23 @@
self.client.add_router_interface_with_port_id,
self.router['id'], invalid_id)
+ @decorators.attr(type='negative')
+ @decorators.idempotent_id('dad7a8ba-2726-11eb-82dd-74e5f9e2a801')
+ def test_remove_associated_ports(self):
+ self.client.update_router(
+ self.router['id'],
+ external_gateway_info={
+ 'network_id': CONF.network.public_network_id})
+ network = self.create_network()
+ subnet = self.create_subnet(network)
+ self.create_router_interface(self.router['id'], subnet['id'])
+ port_ids = [
+ item['id'] for item in self.admin_client.list_ports(
+ device_id=self.router['id'])['ports']]
+ for port_id in port_ids:
+ with testtools.ExpectedException(lib_exc.Conflict):
+ self.admin_client.delete_port(port_id)
+
class DvrRoutersNegativeTest(RoutersNegativeTestBase):
diff --git a/neutron_tempest_plugin/scenario/base.py b/neutron_tempest_plugin/scenario/base.py
index 752e536..127701c 100644
--- a/neutron_tempest_plugin/scenario/base.py
+++ b/neutron_tempest_plugin/scenario/base.py
@@ -205,7 +205,6 @@
else:
router = cls.create_admin_router(**kwargs)
LOG.debug("Created router %s", router['name'])
- cls.routers.append(router)
return router
@removals.remove(version='Stein',