all test_extension_driver_port_security require port-security extension

Bug #1542892 reported by Mathieu Losmede
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Mathieu Losmede

Bug Description

2 tests are not checking if port-security extension is enable or not. then fail if not enabled.

 neutron.tests.api.admin.test_extension_driver_port_security_admin.PortSecurityAdminTests.test_create_port_security_false_on_shared_network
 neutron.tests.api.test_extension_driver_port_security.PortSecTest.test_allow_address_pairs

below trace of failing test when port-security is not enabled but run anyway :

Traceback (most recent call last):
  File "neutron/tests/api/test_extension_driver_port_security.py", line 147, in test_allow_address_pairs
    port = self.create_port(network=network, port_security_enabled=False)
  File "neutron/tests/api/base.py", line 290, in create_port
    **kwargs)
  File "neutron/tests/tempest/services/network/json/network_client.py", line 148, in _create
    resp, body = self.post(uri, post_data)
  File "neutron/.tox/api-constraints/local/lib/python2.7/site-packages/tempest_lib/common/rest_client.py", line 259, in post
    return self.request('POST', url, extra_headers, headers, body)
  File "neutron/.tox/api-constraints/local/lib/python2.7/site-packages/tempest_lib/common/rest_client.py", line 639, in request
    resp, resp_body)
  File "neutron/.tox/api-constraints/local/lib/python2.7/site-packages/tempest_lib/common/rest_client.py", line 697, in _error_checker
    raise exceptions.BadRequest(resp_body, resp=resp)
tempest_lib.exceptions.BadRequest: Bad request
Details: {u'detail': u'', u'message': u"Unrecognized attribute(s) 'port_security_enabled'", u'type': u'HTTPBadRequest'}

summary: - all test_extension_driver_port_security require extension port-security
+ all test_extension_driver_port_security require port-security extension
description: updated
Revision history for this message
Nate Johnston (nate-johnston) wrote :

I don't get the same failure running 'tox -e api' or 'tox -e api-constraints'. How are you running these tests?

Revision history for this message
Mathieu Losmede (m-losmede-o) wrote :

You may have port-security extension enabled. Check with "neutron ext-list".
you will experience that kind of error only when this extension is not enabled... Or I missed something. I'll check at the api-server side to grab error in relation with this.

Revision history for this message
Assaf Muller (amuller) wrote :

We actually have this problem with all optional API extensions. When deciding if to run a test you either skip by checking if the API extension is loaded via 'neutron ext-list', or by checking the current tempest.conf. The Tempest way is the second option, and by default Devstack enables all neutron extensions in tempest.conf. This means that if you install Neutron without any advanced services, QoS, ml2 port security etc, and you use the default tempest.conf that comes from Devstack, a ton of tests will fail instead of be skipped.

Changed in neutron:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/278624

Changed in neutron:
assignee: nobody → Mathieu Losmede (m-losmede-o)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/278624
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=f846519e5af6efa5007896c7ac75d13b415c3f53
Submitter: Jenkins
Branch: master

commit f846519e5af6efa5007896c7ac75d13b415c3f53
Author: malos <email address hidden>
Date: Wed Feb 10 21:35:01 2016 +0100

    Add extension requirement in port-security api test

    if port-security extension is not enabled in neutron, 2 tests run and fail.
    Even if port-security is not part of the tempest.conf api_extensions list.

    Change-Id: I7c15bff96ea976841400e8df93d0c1cb74049bce
    Closes-bug: #1542892

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/283047

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/liberty)

Reviewed: https://review.openstack.org/283047
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=67ab87305d48c6f02b823fc611a1ec21336aa919
Submitter: Jenkins
Branch: stable/liberty

commit 67ab87305d48c6f02b823fc611a1ec21336aa919
Author: malos <email address hidden>
Date: Wed Feb 10 21:35:01 2016 +0100

    Add extension requirement in port-security api test

    if port-security extension is not enabled in neutron, 2 tests run and fail.
    Even if port-security is not part of the tempest.conf api_extensions list.

    Change-Id: I7c15bff96ea976841400e8df93d0c1cb74049bce
    Closes-bug: #1542892
    (cherry picked from commit f846519e5af6efa5007896c7ac75d13b415c3f53)

tags: added: in-stable-liberty
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.