Check API extension 'filter-validation'

Neutron is planing to employ a strict validation
against filter parameters [1]. The motivation is to align with the
OpenStack API guideline [2]. In particular, the API guideline
mentioned the following:

"... if the API supports query parameters and a request
contains an unknown or unsupported parameter, the server should
return a 400 Bad Request response. Invalid values in the request URL
should never be silently ignored, as the response may not match the
client’s expectation..."

After discussion with the API work group [3], the neutron team decides
to make a backward-incompatible change (with a config option to
rollback to the old API behavior).

This patch checks if 'filter-validation' is presented and assert
the old API behavior (silently ignore invalid parameter) if the
extension is not presented.

[1] https://bugs.launchpad.net/neutron/+bug/1749820
[2] http://specs.openstack.org/openstack/api-wg/guidelines/http/
    response-codes.html#failure-code-clarifications
[3] http://eavesdrop.openstack.org/meetings/api_sig/2018/
    api_sig.2018-03-15-16.00.log.html#l-120

Change-Id: Ia6881832bf686525b018613af91e683e6f0b2470
diff --git a/tempest/api/network/admin/test_external_network_extension.py b/tempest/api/network/admin/test_external_network_extension.py
index 39d03e7..7e8cc8e 100644
--- a/tempest/api/network/admin/test_external_network_extension.py
+++ b/tempest/api/network/admin/test_external_network_extension.py
@@ -13,6 +13,7 @@
 import testtools
 
 from tempest.api.network import base
+from tempest.common import utils
 from tempest import config
 from tempest.lib.common.utils import data_utils
 from tempest.lib.common.utils import test_utils
@@ -95,7 +96,6 @@
         self.assertEqual(self.network['id'], show_net['id'])
         self.assertFalse(show_net['router:external'])
 
-    @decorators.skip_because(bug="1749820")
     @decorators.idempotent_id('82068503-2cf2-4ed4-b3be-ecb89432e4bb')
     @testtools.skipUnless(CONF.network_feature_enabled.floating_ips,
                           'Floating ips are not availabled')
@@ -118,8 +118,15 @@
         self.addCleanup(test_utils.call_and_ignore_notfound_exc,
                         self.admin_floating_ips_client.delete_floatingip,
                         created_floating_ip['id'])
-        floatingip_list = self.admin_floating_ips_client.list_floatingips(
-            network=external_network['id'])
+        if utils.is_extension_enabled('filter-validation', 'network'):
+            floatingip_list = self.admin_floating_ips_client.list_floatingips(
+                floating_network_id=external_network['id'])
+        else:
+            # NOTE(hongbin): This is for testing the backward-compatibility
+            # of neutron API although the parameter is a wrong filter
+            # for listing floating IPs.
+            floatingip_list = self.admin_floating_ips_client.list_floatingips(
+                invalid_filter=external_network['id'])
         self.assertIn(created_floating_ip['id'],
                       (f['id'] for f in floatingip_list['floatingips']))
         self.admin_networks_client.delete_network(external_network['id'])