F5Networks / f5-openstack-lbaasv2-driver

F5 LBaaSv2 service provider driver for OpenStack Liberty and beyond
http://clouddocs.f5.com/products/openstack/lbaasv2-driver/master/
Apache License 2.0
21 stars 37 forks source link

Tempest test which reorders l7 policy fails when checking if the virtual server has the wrapper_policy #420

Closed pjbreaux closed 7 years ago

pjbreaux commented 7 years ago

This issue was found when testing against BIG-IP 11.5.4

Agent Version

9.2.0

OpenStack Release

Mitaka

Description

The test api/test_l7policy_update.py::L7PolicyRulesTestJSON::test_reorder_policies fails after the creation of a single policy, when it's checking that the virtual server has the proper wrapper policy. The tempest error is shown below:

Traceback (most recent call last):
  File "/home/testlab/f5-openstack-lbaasv2-driver/f5lbaasdriver/test/tempest/tests/api/test_l7policy_update.py", line 205, in test_reorder_policies
    self.check_virtual_server()
  File "/home/testlab/f5-openstack-lbaasv2-driver/f5lbaasdriver/test/tempest/tests/api/test_l7policy_update.py", line 96, in check_virtual_server
    assert self.bigip.virtual_server_has_policy(
_pytest.assertion.reinterpret.AssertionError: assert <bound method BigIpClient.virtual_server_has_policy of <f5lbaasdriver.test.tempest.services.clients.bigip_client.BigIpClient object at 0x7fb11333fe50>>('Project_eeac5559-3a10-496a-8ae9-1507106650ad', 'wrapper_policy', 'Project_f28630f935aa441da79b040053db6a57')
 +  where <bound method BigIpClient.virtual_server_has_policy of <f5lbaasdriver.test.tempest.services.clients.bigip_client.BigIpClient object at 0x7fb11333fe50>> = <f5lbaasdriver.test.tempest.services.clients.bigip_client.BigIpClient object at 0x7fb11333fe50>.virtual_server_has_policy
 +    where <f5lbaasdriver.test.tempest.services.clients.bigip_client.BigIpClient object at 0x7fb11333fe50> = <f5lbaasdriver.test.tempest.tests.api.test_l7policy_update.L7PolicyRulesTestJSON.test_reorder_policies[smoke] id=0x7fb112b50d10>.bigip
 +  and   'Project_f28630f935aa441da79b040053db6a57' = <f5lbaasdriver.test.tempest.tests.api.test_l7policy_update.L7PolicyRulesTestJSON.test_reorder_policies[smoke] id=0x7fb112b50d10>.partition

The first obvious sign of trouble in the agent log is shown in a traceback, which seems to jive with the tempest call failure. A 404 is returned when looking for the policies for the virtual server.

2017-02-03 09:46:36.736 28668 DEBUG root [req-3d03c72f-b8ab-43e3-9d23-03697379f36f 6efd853a04da466486acfc1564bd4786 f28630f935aa441da79b040053db6a57 - - -] get WITH uri: https://10.190.3.43:443/mgmt/tm/ltm/virtual/~Project_f28630f935aa441da79b040053db6a57~Project_eeac5559-3a10-496a-8ae9-1507106650ad/policies/ AND suffix:  AND kwargs: {} wrapper /usr/lib/python2.7/site-packages/icontrol/session.py:257
2017-02-03 09:46:36.743 28668 DEBUG root [req-3d03c72f-b8ab-43e3-9d23-03697379f36f 6efd853a04da466486acfc1564bd4786 f28630f935aa441da79b040053db6a57 - - -] RESPONSE::STATUS: 200 Content-Type: application/json Content-Encoding: None
Text: u'{"kind":"tm:ltm:virtual:policies:policiescollectionstate","selfLink":"https://localhost/mgmt/tm/ltm/virtual/~Project_f28630f935aa441da79b040053db6a57~Project_eeac5559-3a10-496a-8ae9-1507106650ad/policies?ver=11.5.4","policiesReference":{"link":"https://localhost/mgmt/tm/ltm/virtual/~Project_f28630f935aa441da79b040053db6a57~Project_eeac5559-3a10-496a-8ae9-1507106650ad/policies?ver=11.5.4","isSubcollection":true,"items":[{"kind":"tm:ltm:virtual:policies:policiesstate","name":"wrapper_policy","partition":"Project_f28630f935aa441da79b040053db6a57","fullPath":"/Project_f28630f935aa441da79b040053db6a57/wrapper_policy","generation":87,"selfLink":"https://localhost/mgmt/tm/ltm/virtual/~Project_f28630f935aa441da79b040053db6a57~Project_eeac5559-3a10-496a-8ae9-1507106650ad/policies/~Project_f28630f935aa441da79b040053db6a57~wrapper_policy?ver=11.5.4"}]}}' wrapper /usr/lib/python2.7/site-packages/icontrol/session.py:265
2017-02-03 09:46:36.744 28668 ERROR f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver [req-3d03c72f-b8ab-43e3-9d23-03697379f36f 6efd853a04da466486acfc1564bd4786 f28630f935aa441da79b040053db6a57 - - -] 404 Unexpected Error: Not Found for uri: https://10.190.3.43:443/mgmt/tm/ltm/virtual/~Project_f28630f935aa441da79b040053db6a57~Project_eeac5559-3a10-496a-8ae9-1507106650ad/policies/
Text: u'{"code":404,"message":"Object not found - /Project_f28630f935aa441da79b040053db6a57/wrapper_policy","errorStack":[]}'
2017-02-03 09:46:36.744 28668 ERROR f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver Traceback (most recent call last):
2017-02-03 09:46:36.744 28668 ERROR f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver   File "/usr/lib/python2.7/site-packages/f5_openstack_agent/lbaasv2/drivers/bigip/icontrol_driver.py", line 1216, in _common_service_handler
2017-02-03 09:46:36.744 28668 ERROR f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver     all_subnet_hints)
2017-02-03 09:46:36.744 28668 ERROR f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver   File "/usr/lib/python2.7/site-packages/f5_openstack_agent/lbaasv2/drivers/bigip/lbaas_builder.py", line 61, in assure_service
2017-02-03 09:46:36.744 28668 ERROR f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver     self._assure_l7policies_created(service)
2017-02-03 09:46:36.744 28668 ERROR f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver   File "/usr/lib/python2.7/site-packages/f5_openstack_agent/lbaasv2/drivers/bigip/lbaas_builder.py", line 415, in _assure_l7policies_created
2017-02-03 09:46:36.744 28668 ERROR f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver     raise f5_ex.L7PolicyCreationException(err.message)
2017-02-03 09:46:36.744 28668 ERROR f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver L7PolicyCreationException: 404 Unexpected Error: Not Found for uri: https://10.190.3.43:443/mgmt/tm/ltm/virtual/~Project_f28630f935aa441da79b040053db6a57~Project_eeac5559-3a10-496a-8ae9-1507106650ad/policies/
2017-02-03 09:46:36.744 28668 ERROR f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver Text: u'{"code":404,"message":"Object not found - /Project_f28630f935aa441da79b040053db6a57/wrapper_policy","errorStack":[]}'
2017-02-03 09:46:36.744 28668 ERROR f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver
pjbreaux commented 7 years ago

Two things fail here, one is that when we do a POST to the virtual to add the policy, it successfully adds the policy but produces a 404. The second is that when we do a GET on the policy that has been added, it also produces a 404, when the policy certainly exists. This is an sdk issue and should be handled properly there.

pjbreaux commented 7 years ago

The fix for this issue is dependent on a fix of sdk issue #968. We should bump the sdk version once this bugfix is in there. We could workaround the issue in the agent, but we have a great deal of precedent of dealing with these types of things in the sdk.

mattgreene commented 7 years ago

@pjbreaux: confirm this is resolved with the bump to 2.3.1 and close the issue.

jlongstaf commented 7 years ago

Recent test runs show passing in gumballs report. Closing this issue as resolved with changes to SDK.