diff options
| author | Zuul <zuul@review.opendev.org> | 2020-07-29 18:47:32 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2020-07-29 18:47:32 +0000 |
| commit | 3b9f03ec6dc14ca3b1603728ad076ac63a8a5e2f (patch) | |
| tree | 03e77bf4ee298f253cf545e12253cfa168208630 /tempest/api/network | |
| parent | 2ff32b34b2dcefe187cd957f6c98815fc75bf896 (diff) | |
| parent | 4810d887ffe0038b44adf1be1d906a841769b074 (diff) | |
| download | tempest-3b9f03ec6dc14ca3b1603728ad076ac63a8a5e2f.tar.gz | |
Merge "Adding description for testcases - network part1"
Diffstat (limited to 'tempest/api/network')
| -rw-r--r-- | tempest/api/network/admin/test_floating_ips_admin_actions.py | 10 | ||||
| -rw-r--r-- | tempest/api/network/admin/test_negative_quotas.py | 1 | ||||
| -rw-r--r-- | tempest/api/network/admin/test_ports.py | 5 | ||||
| -rw-r--r-- | tempest/api/network/admin/test_quotas.py | 2 | ||||
| -rw-r--r-- | tempest/api/network/admin/test_routers_negative.py | 2 | ||||
| -rw-r--r-- | tempest/api/network/test_extensions.py | 2 | ||||
| -rw-r--r-- | tempest/api/network/test_floating_ips.py | 17 | ||||
| -rw-r--r-- | tempest/api/network/test_ports.py | 29 | ||||
| -rw-r--r-- | tempest/api/network/test_tags.py | 4 |
9 files changed, 66 insertions, 6 deletions
diff --git a/tempest/api/network/admin/test_floating_ips_admin_actions.py b/tempest/api/network/admin/test_floating_ips_admin_actions.py index 7d410194e..ad7dfb396 100644 --- a/tempest/api/network/admin/test_floating_ips_admin_actions.py +++ b/tempest/api/network/admin/test_floating_ips_admin_actions.py @@ -23,6 +23,8 @@ CONF = config.CONF class FloatingIPAdminTestJSON(base.BaseAdminNetworkTest): + """Test floating ips""" + credentials = ['primary', 'alt', 'admin'] @classmethod @@ -55,6 +57,13 @@ class FloatingIPAdminTestJSON(base.BaseAdminNetworkTest): @decorators.idempotent_id('64f2100b-5471-4ded-b46c-ddeeeb4f231b') def test_list_floating_ips_from_admin_and_nonadmin(self): + """Test listing floating ips from admin and non admin users + + This test performs below operations: + 1. Create couple floating ips for admin and non-admin users. + 2. Verify if admin can access all floating ips including other user + and non-admin user can only access its own floating ips. + """ # Create floating ip from admin user floating_ip_admin = self.admin_floating_ips_client.create_floatingip( floating_network_id=self.ext_net_id) @@ -90,6 +99,7 @@ class FloatingIPAdminTestJSON(base.BaseAdminNetworkTest): @decorators.idempotent_id('32727cc3-abe2-4485-a16e-48f2d54c14f2') def test_create_list_show_floating_ip_with_tenant_id_by_admin(self): + """Verify if admin can create/list/show floating ip with tenant id""" # Creates a floating IP body = self.admin_floating_ips_client.create_floatingip( floating_network_id=self.ext_net_id, diff --git a/tempest/api/network/admin/test_negative_quotas.py b/tempest/api/network/admin/test_negative_quotas.py index 3562d6fbf..190d9e37d 100644 --- a/tempest/api/network/admin/test_negative_quotas.py +++ b/tempest/api/network/admin/test_negative_quotas.py @@ -53,6 +53,7 @@ class QuotasNegativeTest(base.BaseAdminNetworkTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('644f4e1b-1bf9-4af0-9fd8-eb56ac0f51cf') def test_network_quota_exceeding(self): + """Test creating network when exceeding network quota will fail""" # Set the network quota to two self.admin_quotas_client.update_quotas(self.project['id'], network=2) diff --git a/tempest/api/network/admin/test_ports.py b/tempest/api/network/admin/test_ports.py index 289e57725..51f285756 100644 --- a/tempest/api/network/admin/test_ports.py +++ b/tempest/api/network/admin/test_ports.py @@ -24,6 +24,7 @@ CONF = config.CONF class PortsAdminExtendedAttrsTestJSON(base.BaseAdminNetworkTest): + """Test extended attributes of ports""" @classmethod def setup_clients(cls): @@ -41,6 +42,7 @@ class PortsAdminExtendedAttrsTestJSON(base.BaseAdminNetworkTest): @decorators.idempotent_id('8e8569c1-9ac7-44db-8bc1-f5fb2814f29b') @utils.services('compute') def test_create_port_binding_ext_attr(self): + """Test creating port with extended attribute""" post_body = {"network_id": self.network['id'], "binding:host_id": self.host_id, "name": data_utils.rand_name(self.__class__.__name__)} @@ -56,6 +58,7 @@ class PortsAdminExtendedAttrsTestJSON(base.BaseAdminNetworkTest): @decorators.idempotent_id('6f6c412c-711f-444d-8502-0ac30fbf5dd5') @utils.services('compute') def test_update_port_binding_ext_attr(self): + """Test updating port's extended attribute""" post_body = {"network_id": self.network['id'], "name": data_utils.rand_name(self.__class__.__name__)} body = self.admin_ports_client.create_port(**post_body) @@ -73,6 +76,7 @@ class PortsAdminExtendedAttrsTestJSON(base.BaseAdminNetworkTest): @decorators.idempotent_id('1c82a44a-6c6e-48ff-89e1-abe7eaf8f9f8') @utils.services('compute') def test_list_ports_binding_ext_attr(self): + """Test updating and listing port's extended attribute""" # Create a new port post_body = {"network_id": self.network['id'], "name": data_utils.rand_name(self.__class__.__name__)} @@ -101,6 +105,7 @@ class PortsAdminExtendedAttrsTestJSON(base.BaseAdminNetworkTest): @decorators.idempotent_id('b54ac0ff-35fc-4c79-9ca3-c7dbd4ea4f13') def test_show_port_binding_ext_attr(self): + """Test showing port's extended attribute""" body = self.admin_ports_client.create_port( name=data_utils.rand_name(self.__class__.__name__), network_id=self.network['id']) diff --git a/tempest/api/network/admin/test_quotas.py b/tempest/api/network/admin/test_quotas.py index 8b7bfb1b9..d8db29873 100644 --- a/tempest/api/network/admin/test_quotas.py +++ b/tempest/api/network/admin/test_quotas.py @@ -89,6 +89,7 @@ class QuotasTest(base.BaseAdminNetworkTest): @decorators.idempotent_id('2390f766-836d-40ef-9aeb-e810d78207fb') def test_quotas(self): + """Test update/list/show/reset of network quotas""" new_quotas = {'network': 0, 'port': 0} self._check_quotas(new_quotas) @@ -96,6 +97,7 @@ class QuotasTest(base.BaseAdminNetworkTest): 'quota_details', 'network'), 'Quota details extension not enabled.') @decorators.idempotent_id('7b05ec5f-bf44-43cb-b28f-ddd72a824288') def test_show_quota_details(self): + """Test showing network quota details""" # Show quota details for an existing project quota_details = self.admin_quotas_client.show_quota_details( self.admin_quotas_client.tenant_id)['quota'] diff --git a/tempest/api/network/admin/test_routers_negative.py b/tempest/api/network/admin/test_routers_negative.py index f605945c8..914c0467c 100644 --- a/tempest/api/network/admin/test_routers_negative.py +++ b/tempest/api/network/admin/test_routers_negative.py @@ -27,6 +27,7 @@ CONF = config.CONF class RoutersAdminNegativeTest(base.BaseAdminNetworkTest): + """Admin negative tests of routers""" @classmethod def skip_checks(cls): @@ -41,6 +42,7 @@ class RoutersAdminNegativeTest(base.BaseAdminNetworkTest): @testtools.skipUnless(CONF.network.public_network_id, 'The public_network_id option must be specified.') def test_router_set_gateway_used_ip_returns_409(self): + """Test creating router with gateway set to used ip should fail""" # At first create a address from public_network_id port = self.admin_ports_client.create_port( name=data_utils.rand_name(self.__class__.__name__), diff --git a/tempest/api/network/test_extensions.py b/tempest/api/network/test_extensions.py index 4804adaab..e116d7c15 100644 --- a/tempest/api/network/test_extensions.py +++ b/tempest/api/network/test_extensions.py @@ -32,7 +32,7 @@ class ExtensionsTestJSON(base.BaseNetworkTest): @decorators.attr(type='smoke') @decorators.idempotent_id('ef28c7e6-e646-4979-9d67-deb207bc5564') def test_list_show_extensions(self): - # List available extensions for the project + """List available extensions and show the detail of each extension""" expected_alias = ['security-group', 'l3_agent_scheduler', 'ext-gw-mode', 'binding', 'quotas', 'agent', 'dhcp_agent_scheduler', 'provider', diff --git a/tempest/api/network/test_floating_ips.py b/tempest/api/network/test_floating_ips.py index abcbbf766..c32d3c107 100644 --- a/tempest/api/network/test_floating_ips.py +++ b/tempest/api/network/test_floating_ips.py @@ -73,6 +73,7 @@ class FloatingIPTestJSON(base.BaseNetworkTest): @decorators.attr(type='smoke') @decorators.idempotent_id('62595970-ab1c-4b7f-8fcc-fddfe55e8718') def test_create_list_show_update_delete_floating_ip(self): + """Test create/list/show/update/delete floating ip""" # Creates a floating IP body = self.floating_ips_client.create_floatingip( floating_network_id=self.ext_net_id, @@ -133,6 +134,14 @@ class FloatingIPTestJSON(base.BaseNetworkTest): @decorators.idempotent_id('e1f6bffd-442f-4668-b30e-df13f2705e77') def test_floating_ip_delete_port(self): + """Test deleting floating ip's port + + 1. Create a floating ip + 2. Create a port + 3. Update the floating ip's port_id to the created port + 4. Delete the port + 5. Verify that the port details are cleared from the floating ip + """ # Create a floating IP body = self.floating_ips_client.create_floatingip( floating_network_id=self.ext_net_id) @@ -163,6 +172,7 @@ class FloatingIPTestJSON(base.BaseNetworkTest): @decorators.idempotent_id('1bb2f731-fe5a-4b8c-8409-799ade1bed4d') def test_floating_ip_update_different_router(self): + """Test associating a floating ip to a port on different router""" # Associate a floating IP to a port on a router body = self.floating_ips_client.create_floatingip( floating_network_id=self.ext_net_id, @@ -211,6 +221,7 @@ class FloatingIPTestJSON(base.BaseNetworkTest): @decorators.attr(type='smoke') @decorators.idempotent_id('36de4bd0-f09c-43e3-a8e1-1decc1ffd3a5') def test_create_floating_ip_specifying_a_fixed_ip_address(self): + """Test creating floating ip with specified fixed ip""" body = self.floating_ips_client.create_floatingip( floating_network_id=self.ext_net_id, port_id=self.ports[1]['id'], @@ -230,6 +241,12 @@ class FloatingIPTestJSON(base.BaseNetworkTest): @decorators.idempotent_id('45c4c683-ea97-41ef-9c51-5e9802f2f3d7') def test_create_update_floatingip_with_port_multiple_ip_address(self): + """Test updating floating ip's fixed_ips to another ip of same port + + First we create a port with 2 fixed ips, then we create a floating ip + with one of the fixed ips, and then we update the floating ip to + another fixed ip of that port. + """ # Find out ips that can be used for tests list_ips = net_utils.get_unused_ip_addresses( self.ports_client, diff --git a/tempest/api/network/test_ports.py b/tempest/api/network/test_ports.py index c4ad72088..c6d049a65 100644 --- a/tempest/api/network/test_ports.py +++ b/tempest/api/network/test_ports.py @@ -70,6 +70,7 @@ class PortsTestJSON(sec_base.BaseSecGroupTest): @decorators.attr(type='smoke') @decorators.idempotent_id('c72c1c0c-2193-4aca-aaa4-b1442640f51c') def test_create_update_delete_port(self): + """Test creating, updating and deleting port""" # Verify port creation body = self.ports_client.create_port( network_id=self.network['id'], @@ -89,6 +90,7 @@ class PortsTestJSON(sec_base.BaseSecGroupTest): @decorators.idempotent_id('67f1b811-f8db-43e2-86bd-72c074d4a42c') def test_create_bulk_port(self): + """Test creating multiple ports in a single request""" network1 = self.network network2 = self._create_network() network_list = [network1['id'], network2['id']] @@ -107,6 +109,7 @@ class PortsTestJSON(sec_base.BaseSecGroupTest): @decorators.attr(type='smoke') @decorators.idempotent_id('0435f278-40ae-48cb-a404-b8a087bc09b1') def test_create_port_in_allowed_allocation_pools(self): + """Test creating port in allowed allocation pools""" network = self._create_network() net_id = network['id'] address = self.cidr @@ -136,7 +139,7 @@ class PortsTestJSON(sec_base.BaseSecGroupTest): @decorators.attr(type='smoke') @decorators.idempotent_id('c9a685bd-e83f-499c-939f-9f7863ca259f') def test_show_port(self): - # Verify the details of port + """Verify the details of port""" body = self.ports_client.show_port(self.port['id']) port = body['port'] self.assertIn('id', port) @@ -152,7 +155,7 @@ class PortsTestJSON(sec_base.BaseSecGroupTest): @decorators.idempotent_id('45fcdaf2-dab0-4c13-ac6c-fcddfb579dbd') def test_show_port_fields(self): - # Verify specific fields of a port + """Verify specific fields of a port""" fields = ['id', 'mac_address'] body = self.ports_client.show_port(self.port['id'], fields=fields) @@ -164,7 +167,7 @@ class PortsTestJSON(sec_base.BaseSecGroupTest): @decorators.attr(type='smoke') @decorators.idempotent_id('cf95b358-3e92-4a29-a148-52445e1ac50e') def test_list_ports(self): - # Verify the port exists in the list of all ports + """Verify the port exists in the list of all ports""" body = self.ports_client.list_ports() ports = [port['id'] for port in body['ports'] if port['id'] == self.port['id']] @@ -172,6 +175,7 @@ class PortsTestJSON(sec_base.BaseSecGroupTest): @decorators.idempotent_id('e7fe260b-1e79-4dd3-86d9-bec6a7959fc5') def test_port_list_filter_by_ip(self): + """Test listing ports filtered by ip""" # Create network and subnet network = self._create_network() self._create_subnet(network) @@ -211,6 +215,7 @@ class PortsTestJSON(sec_base.BaseSecGroupTest): utils.is_extension_enabled('ip-substring-filtering', 'network'), 'ip-substring-filtering extension not enabled.') def test_port_list_filter_by_ip_substr(self): + """Test listing ports filtered by part of ip address string""" # Create network and subnet network = self._create_network() subnet = self._create_subnet(network) @@ -289,6 +294,7 @@ class PortsTestJSON(sec_base.BaseSecGroupTest): @decorators.idempotent_id('5ad01ed0-0e6e-4c5d-8194-232801b15c72') def test_port_list_filter_by_router_id(self): + """Test listing ports filtered by router id""" # Create a router network = self._create_network() self._create_subnet(network) @@ -313,7 +319,7 @@ class PortsTestJSON(sec_base.BaseSecGroupTest): @decorators.idempotent_id('ff7f117f-f034-4e0e-abff-ccef05c454b4') def test_list_ports_fields(self): - # Verify specific fields of ports + """Verify specific fields of ports""" fields = ['id', 'mac_address'] body = self.ports_client.list_ports(fields=fields) ports = body['ports'] @@ -324,6 +330,7 @@ class PortsTestJSON(sec_base.BaseSecGroupTest): @decorators.idempotent_id('63aeadd4-3b49-427f-a3b1-19ca81f06270') def test_create_update_port_with_second_ip(self): + """Test updating port from 2 fixed ips to 1 fixed ip and vice versa""" # Create a network with two subnets network = self._create_network() subnet_1 = self._create_subnet(network) @@ -410,6 +417,12 @@ class PortsTestJSON(sec_base.BaseSecGroupTest): utils.is_extension_enabled('security-group', 'network'), 'security-group extension not enabled.') def test_update_port_with_security_group_and_extra_attributes(self): + """Test updating port's security_group along with extra attributes + + First we create a port with one security group, and then we update the + port's security_group, in the same update request we also change + the port's fixed ips. + """ self._update_port_with_security_groups( [data_utils.rand_name('secgroup')]) @@ -418,12 +431,19 @@ class PortsTestJSON(sec_base.BaseSecGroupTest): utils.is_extension_enabled('security-group', 'network'), 'security-group extension not enabled.') def test_update_port_with_two_security_groups_and_extra_attributes(self): + """Test updating port with two security_groups and extra attributes + + First we create a port with one security group, and then we update the + port to two security_groups, in the same update request we also change + the port's fixed ips. + """ self._update_port_with_security_groups( [data_utils.rand_name('secgroup'), data_utils.rand_name('secgroup')]) @decorators.idempotent_id('13e95171-6cbd-489c-9d7c-3f9c58215c18') def test_create_show_delete_port_user_defined_mac(self): + """Test creating port with user defined mac address""" # Create a port for a legal mac body = self.ports_client.create_port( network_id=self.network['id'], @@ -450,6 +470,7 @@ class PortsTestJSON(sec_base.BaseSecGroupTest): utils.is_extension_enabled('security-group', 'network'), 'security-group extension not enabled.') def test_create_port_with_no_securitygroups(self): + """Test creating port without security groups""" network = self._create_network() self._create_subnet(network) port = self.create_port(network, security_groups=[]) diff --git a/tempest/api/network/test_tags.py b/tempest/api/network/test_tags.py index 2b9719af6..5219c34a1 100644 --- a/tempest/api/network/test_tags.py +++ b/tempest/api/network/test_tags.py @@ -51,7 +51,7 @@ class TagsTest(base.BaseNetworkTest): @decorators.idempotent_id('ee76bfaf-ac94-4d74-9ecc-4bbd4c583cb1') def test_create_list_show_update_delete_tags(self): - # Validate that creating a tag on a network resource works. + """Validate that creating a tag on a network resource works""" tag_name = data_utils.rand_name(self.__class__.__name__ + '-Tag') self.tags_client.create_tag('networks', self.network['id'], tag_name) self.addCleanup(self.tags_client.delete_all_tags, 'networks', @@ -158,6 +158,7 @@ class TagsExtTest(base.BaseNetworkTest): @decorators.idempotent_id('c6231efa-9a89-4adf-b050-2a3156b8a1d9') def test_create_check_list_and_delete_tags(self): + """Test tag operations on subnets/ports/routers/subnetpools""" tag_names = self._create_tags_for_each_resource() for i, resource in enumerate(self.SUPPORTED_RESOURCES): @@ -181,6 +182,7 @@ class TagsExtTest(base.BaseNetworkTest): @decorators.idempotent_id('663a90f5-f334-4b44-afe0-c5fc1d408791') def test_update_and_delete_all_tags(self): + """Test update/delete all tags on subnets/ports/routers/subnetpools""" self._create_tags_for_each_resource() for resource in self.SUPPORTED_RESOURCES: |
