Merge "Add tests to assert filter validation"

This commit is contained in:
Zuul 2018-09-07 19:55:35 +00:00 committed by Gerrit Code Review
commit 5f371ea030
5 changed files with 22 additions and 16 deletions

View File

@ -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,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-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-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
devstack_plugins:
neutron: git://git.openstack.org/openstack/neutron.git
neutron-tempest-plugin: git://git.openstack.org/openstack/neutron-tempest-plugin.git
@ -132,7 +132,7 @@
vars:
devstack_localrc:
Q_AGENT: linuxbridge
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,ext-gw-mode,external-net,extra_dhcp_opt,extraroute,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-fip,quotas,quota_details,rbac-policies,router,router_availability_zone,security-group,port-security-groups-filtering,segment,service-type,sorting,standard-attr-description,standard-attr-revisions,standard-attr-timestamp,standard-attr-tag,subnet_allocation,tag,tag-ext,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,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-fip,quotas,quota_details,rbac-policies,router,router_availability_zone,security-group,port-security-groups-filtering,segment,service-type,sorting,standard-attr-description,standard-attr-revisions,standard-attr-timestamp,standard-attr-tag,subnet_allocation,tag,tag-ext,trunk,trunk-details
devstack_local_conf:
post-config:
$NEUTRON_CONF:

View File

@ -1180,11 +1180,14 @@ class BaseSearchCriteriaTest(BaseNetworkTest):
expected_resources[:-1],
self._extract_resources(body))
def _test_list_validation_filters(self):
validation_args = {
'unknown_filter': 'value',
}
body = self.list_method(**validation_args)
resources = self._extract_resources(body)
for resource in resources:
self.assertIn(resource['name'], self.resource_names)
@tutils.requires_ext(extension="filter-validation", service="network")
def _test_list_validation_filters(
self, validation_args, filter_is_valid=True):
if not filter_is_valid:
self.assertRaises(lib_exc.BadRequest, self.list_method,
**validation_args)
else:
body = self.list_method(**validation_args)
resources = self._extract_resources(body)
for resource in resources:
self.assertIn(resource['name'], self.resource_names)

View File

@ -209,7 +209,8 @@ class NetworksSearchCriteriaTest(base.BaseSearchCriteriaTest):
def test_list_no_pagination_limit_0(self):
self._test_list_no_pagination_limit_0()
@decorators.skip_because(bug="1749820")
@decorators.idempotent_id('3574ec9b-a8b8-43e3-9c11-98f5875df6a9')
def test_list_validation_filters(self):
self._test_list_validation_filters()
self._test_list_validation_filters(self.list_kwargs)
self._test_list_validation_filters({
'unknown_filter': 'value'}, filter_is_valid=False)

View File

@ -414,7 +414,8 @@ class SubnetPoolsSearchCriteriaTest(base.BaseSearchCriteriaTest,
def test_list_no_pagination_limit_0(self):
self._test_list_no_pagination_limit_0()
@decorators.skip_because(bug="1749820")
@decorators.idempotent_id('27feb3f8-40f4-4e50-8cd2-7d0096a98682')
def test_list_validation_filters(self):
self._test_list_validation_filters()
self._test_list_validation_filters(self.list_kwargs)
self._test_list_validation_filters({
'unknown_filter': 'value'}, filter_is_valid=False)

View File

@ -64,7 +64,8 @@ class SubnetsSearchCriteriaTest(base.BaseSearchCriteriaTest):
def test_list_no_pagination_limit_0(self):
self._test_list_no_pagination_limit_0()
@decorators.skip_because(bug="1749820")
@decorators.idempotent_id('c0f9280b-9d81-4728-a967-6be22659d4c8')
def test_list_validation_filters(self):
self._test_list_validation_filters()
self._test_list_validation_filters(self.list_kwargs)
self._test_list_validation_filters({
'unknown_filter': 'value'}, filter_is_valid=False)