tests: cover port with existing sorting/pagination api tests
This is based on existing network api tests for the features that were
implemented in an extensible way.
Existing list_kwargs is decoupled from the base test class because they
are network test specific. Also removed generic handling for
create_method because each resource has its own signature for creation
methods, so it's easier to implement it per resource than trying to come
up with a generic solution.
Related-Bug: #1566514
Change-Id: I648851b48d0481c97054e1280b60a119b42dfd38
diff --git a/neutron/tests/tempest/api/base.py b/neutron/tests/tempest/api/base.py
index 033ac67..31d6c3a 100644
--- a/neutron/tests/tempest/api/base.py
+++ b/neutron/tests/tempest/api/base.py
@@ -488,26 +488,16 @@
# This should be defined by subclasses to reflect resource name to test
resource = None
- # also test a case when there are multiple resources with the same name
+ # NOTE(ihrachys): some names, like those starting with an underscore (_)
+ # are sorted differently depending on whether the plugin implements native
+ # sorting support, or not. So we avoid any such cases here, sticking to
+ # alphanumeric. Also test a case when there are multiple resources with the
+ # same name
resource_names = ('test1', 'abc1', 'test10', '123test') + ('test1',)
- list_kwargs = {'shared': False}
-
force_tenant_isolation = True
- @classmethod
- def resource_setup(cls):
- super(BaseSearchCriteriaTest, cls).resource_setup()
-
- cls.create_method = getattr(cls, 'create_%s' % cls.resource)
-
- # NOTE(ihrachys): some names, like those starting with an underscore
- # (_) are sorted differently depending on whether the plugin implements
- # native sorting support, or not. So we avoid any such cases here,
- # sticking to alphanumeric.
- for name in cls.resource_names:
- args = {'%s_name' % cls.resource: name}
- cls.create_method(**args)
+ list_kwargs = {}
def list_method(self, *args, **kwargs):
method = getattr(self.client, 'list_%ss' % self.resource)