yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #78631
[Bug 1829962] Re: base url is not normalized when get resource uri from href
Reviewed: https://review.opendev.org/660569
Committed: https://git.openstack.org/cgit/openstack/neutron-tempest-plugin/commit/?id=74e760a46e6c2260b6b048271c3b759641290efb
Submitter: Zuul
Branch: master
commit 74e760a46e6c2260b6b048271c3b759641290efb
Author: zheng.yong <yong.zheng@xxxxxxxxxxxx>
Date: Wed May 22 14:16:14 2019 +0800
Normalize url without port with schema default port
In function get_bare_url, it will assert url startswith base_url,
if base_url is 'http://neutron.openstack.svc.cluster.local:80/',
while url is 'http://neutron.openstack.svc.cluster.local/v2.0/router/...',
it will raise error. here need to add default schema port 80 to url to
fix this problem.
Change-Id: I44d623d3d0d96711f7ca93fc24b40c024dd86446
Closes-Bug: #1829962
** Changed in: neutron
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1829962
Title:
base url is not normalized when get resource uri from href
Status in neutron:
Fix Released
Bug description:
Run tempest of branch stable/newton, we got an error:
Traceback (most recent call last):
File "/var/lib/rally/.rally/verification/verifier-ac5467f6-3226-414c-8e16-4a04d0be0ce3/.venv/lib/python2.7/site-packages/neutron/tests/tempest/api/test_networks.py", line 199, in test_list_pagination_page_reverse_with_href_links
self._test_list_pagination_page_reverse_with_href_links()
File "/var/lib/rally/.rally/verification/verifier-ac5467f6-3226-414c-8e16-4a04d0be0ce3/.venv/lib/python2.7/site-packages/neutron/tests/tempest/api/base.py", line 520, in inner
return f(self, *args, **kwargs)
File "/var/lib/rally/.rally/verification/verifier-ac5467f6-3226-414c-8e16-4a04d0be0ce3/.venv/lib/python2.7/site-packages/neutron/tests/tempest/api/base.py", line 511, in inner
return f(self, *args, **kwargs)
File "/var/lib/rally/.rally/verification/verifier-ac5467f6-3226-414c-8e16-4a04d0be0ce3/.venv/lib/python2.7/site-packages/neutron/tests/tempest/api/base.py", line 720, in _test_list_pagination_page_reverse_with_href_links
uri = self.get_bare_url(prev_links['previous'])
File "/var/lib/rally/.rally/verification/verifier-ac5467f6-3226-414c-8e16-4a04d0be0ce3/.venv/lib/python2.7/site-packages/neutron/tests/tempest/api/base.py", line 567, in get_bare_url
self.assertTrue(url.startswith(base_url))
File "/var/lib/rally/.rally/verification/verifier-ac5467f6-3226-414c-8e16-4a04d0be0ce3/.venv/lib/python2.7/site-packages/unittest2/case.py", line 702, in assertTrue
raise self.failureException(msg)
AssertionError: False is not true
this error is because of assert error of self.assertTrue(url.startswith(base_url))
here base_url is 'http://neutron.openstack.svc.cluster.local:80/'
while url is 'http://neutron.openstack.svc.cluster.local/v2.0/router/...'
To resolve this problem, maybe we should normalize base_url and url before assert.
function get_bare_url is rehomed to project neutron-tempest-plugin of
branch master, located at https://github.com/openstack/neutron-
tempest-plugin/blob/master/neutron_tempest_plugin/api/base.py#L1112.
we should fix it.
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1829962/+subscriptions
References