← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1829962] [NEW] base url is not normalized when get resource uri from href

 

Public bug reported:

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.

** Affects: neutron
     Importance: Undecided
         Status: New

** Description changed:

  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)
+   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 #1112. we should
+ plugin/blob/master/neutron_tempest_plugin/api/base.py#L1112. we should
  fix it.

-- 
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:
  New

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


Follow ups