<div dir="ltr">Please find details at <div><a href="https://bugs.launchpad.net/neutron/+bug/1441512">https://bugs.launchpad.net/neutron/+bug/1441512</a></div><div><br></div><div><p style="margin:0px 0px 1.2em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px">Tempest v2 api negative tests for invalid or empty tenantid fails as tenant id is not validated at plugin layer.</p><p style="margin:0px 0px 1.2em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px">1. In Case of looging noop driver (no validation is done by driver ) ,<br>In test , create returns success whereas it excepts BadRequest.</p><p style="margin:0px 0px 1.2em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px">0} neutron_lbaas.tests.tempest.v2.api.test_members.MemberTestJSON.test_create_member_empty_tenant_id [0.590837s] ... FAILED</p><p style="margin:0px 0px 1.2em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px">Captured traceback:<br>~~~~~~~~~~~~~~~~~~~<br>    Traceback (most recent call last):<br>      File "neutron_lbaas/tests/tempest/v2/api/test_members.py", line 244, in test_create_member_empty_tenant_id<br>        self.pool_id, **member_opts)<br>      File "/opt/stack/neutron-lbaas/.tox/tempest/local/lib/python2.7/site-packages/testtools/testcase.py", line 422, in assertRaises<br>        self.assertThat(our_callable, matcher)<br>      File "/opt/stack/neutron-lbaas/.tox/tempest/local/lib/python2.7/site-packages/testtools/testcase.py", line 435, in assertThat<br>        raise mismatch_error<br>    testtools.matchers._impl.MismatchError: <bound method type._create_member of <class 'neutron_lbaas.tests.tempest.v2.api.test_members.MemberTestJSON'>> returned {u'protocol_port': 80, u'weight': 1, u'admin_state_up': True, u'subnet_id': u'e20c013e-33d0-4752-883d-b78bd45ef0ea', u'tenant_id': u'', u'address': u'127.0.0.1', u'id': u'3f8d811f-ab69-44f8-ae18-8fc20a94b228'}</p><p style="margin:0px 0px 1.2em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px">2.In case of if Backend Driver (Say NetScaler) ,driver is raising BadRequest .<br>==================================================================<br>       return self._callable_object(*self._args, **self._kwargs)<br>      File "neutron_lbaas/tests/tempest/v2/api/base.py", line 252, in _create_member<br>        member = cls.members_client.create_member(pool_id, **member_kwargs)<br>      File "neutron_lbaas/tests/tempest/v2/clients/members_client.py", line 51, in create_member<br>        resp, body = self.post(url, post_body)<br>      File "/opt/stack/neutron-lbaas/.tox/tempest/local/lib/python2.7/site-packages/tempest_lib/common/rest_client.py", line 252, in post<br>        return self.request('POST', url, extra_headers, headers, body)<br>      File "/opt/stack/neutron-lbaas/.tox/tempest/src/tempest/tempest/common/service_client.py", line 83, in request<br>        raise exceptions.ServerFault(ex)<br>    tempest.exceptions.ServerFault: Got server fault<br>    Details: Got server fault<br>    Details: An error happened in the driver<br>===================================================================</p><p style="margin:0px 0px 1.2em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px">Above behavior is observed as ,at plugin layer all Exceptions from Driver is raised as same Driver Exception.</p><p style="margin:0px 0px 1.2em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px">plugin.y<br>     def _call_driver_operation(self, context, driver_method, db_entity,<br>                               old_db_entity=None):<br>        manager_method = "%s.%s" % (driver_method.__self__.__class__.__name__,<br>                                    driver_method.__name__)<br>        LOG.info(_LI("Calling driver operation %s") % manager_method)<br>        try:<br>            if old_db_entity:<br>                driver_method(context, old_db_entity, db_entity)<br>            else:<br>                driver_method(context, db_entity)<br>        # catching and reraising agent issues<br>        except (lbaas_agentschedulerv2.NoEligibleLbaasAgent,<br>                lbaas_agentschedulerv2.NoActiveLbaasAgent) as no_agent:<br>            raise no_agent<br>        except Exception:<br>            LOG.exception(_LE("There was an error in the driver"))<br>            self._handle_driver_error(context, db_entity)<br>            raise loadbalancerv2.DriverError() #<-------------- bad request is raised as Driver Error</p><p style="margin:0px 0px 1.2em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px">Negative Testcases:-</p><p style="margin:0px 0px 1.2em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px">test_create_listener_invalid_tenant_id()<br>test_create_listener_invalid_empty_tenant_id()<br>test_create_member_invalid_tenant_id()<br>test_create_member_empty_tenant_id()</p><div><br></div><div><br></div>-- <br><div class="gmail_signature">Santosh</div>
</div></div>