vmware-nsx/vmware_nsx_tempest/services/lbaas/l7rules_client.py
Alex Kang 2065418288 tempest: lbaas l7 switching scenario tests
1. add lbaas l7 switching clients
2. enhance to delete l7 resources if present
3. enhance NSX-v scenario to support l7 switching testing
   3.1 check floatingip assiged to server before ping test
       NSX-v3 can take 500+ second to assign floatingip to VM
   3.2 enhance test_lbaas_round_robin to support l7 test
   3.3 test_lbaas_l7_switching_ops only test URL starts_with
       validation.
4. l7_switching_ops requires around 2000 seconds. When run test
   set OS_TEST_TIMEOUT=2400 to avoid fixture timeout.
5. add CONF.nsxv.bugs_to_resolve to skip tests that can not be
   run at sepcific NSX plugin environment.
6. doc/README-LBaaS.rst describes limitation and how to run
   tests at different plugin's and backends.

Change-Id: Ib2ee4ce57d45882d76e25ce7b7bba3d825bf34ab
2016-10-18 13:12:28 +00:00

59 lines
2.3 KiB
Python

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from tempest.lib.services.network import base
class L7RulesClient(base.BaseNetworkClient):
resource = 'rule'
resource_plural = 'rules'
resource_base_path = '/lbaas/l7policies/%s/rules'
resource_object_path = '/lbaas/l7policies/%s/rules/%s'
def create_l7rule(self, policy_id, **kwargs):
uri = self.resource_base_path % policy_id
post_data = {self.resource: kwargs}
return self.create_resource(uri, post_data)
def update_l7rule(self, policy_id, rule_id, **kwargs):
uri = self.resource_object_path % (policy_id, rule_id)
post_data = {self.resource: kwargs}
return self.update_resource(uri, post_data)
def show_l7rule(self, policy_id, rule_id, **fields):
uri = self.resource_object_path % (policy_id, rule_id)
return self.show_resource(uri, **fields)
def delete_l7rule(self, policy_id, rule_id):
uri = self.resource_object_path % (policy_id, rule_id)
return self.delete_resource(uri)
def list_l7rules(self, policy_id, **filters):
uri = self.resource_base_path % policy_id
return self.list_resources(uri, **filters)
def get_client(client_mgr):
"""create a lbaas l7rules client from manager or networks_client"""
manager = getattr(client_mgr, 'manager', client_mgr)
net_client = getattr(manager, 'networks_client')
try:
_params = manager.default_params_with_timeout_values.copy()
except Exception:
_params = {}
client = L7RulesClient(net_client.auth_provider,
net_client.service,
net_client.region,
net_client.endpoint_type,
**_params)
return client