NetApp unittest fails if environment has http proxy setting

Bug #1223145 reported by Huang Zhiteng on 2013-09-10
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Low
Navneet

Bug Description

Most of NetApp unittest would fail sadly if there was a http proxy set in the environment. The HTTP request to 127.0.0.1 would be sent to proxy.

======================================================================
FAIL: cinder.tests.test_netapp.NetAppDirect7modeISCSIDriverTestCase_NV.test_connect
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''-1
  stderr
  stdout

pythonlogging:'': {{{
Requested unified config: ontap_7mode and iscsi
NetApp driver of family ontap_7mode and protocol iscsi loaded
}}}

Traceback (most recent call last):
  File "/opt/stack/cinder/cinder/tests/test_netapp.py", line 542, in test_connect
    self.driver.check_for_setup_error()
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 158, in check_for_setup_error
    self._get_lun_list()
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 1040, in _get_lun_list
    luns = self._get_vol_luns(None)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 1049, in _get_vol_luns
    result = self.client.invoke_successfully(api, True)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 213, in invoke_successfully
    result = self.invoke_elem(na_element, enable_tunneling)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 199, in invoke_elem
    raise NaApiError(e.code, e.msg)
NaApiError: NetApp api failed. Reason - 404:Not Found

======================================================================
FAIL: cinder.tests.test_netapp.NetAppDirect7modeISCSIDriverTestCase_NV.test_create_destroy
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''-1
  stderr
  stdout

pythonlogging:'': {{{
Requested unified config: ontap_7mode and iscsi
NetApp driver of family ontap_7mode and protocol iscsi loaded
}}}

Traceback (most recent call last):
  File "/opt/stack/cinder/cinder/tests/test_netapp.py", line 545, in test_create_destroy
    self.driver.create_volume(self.volume)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 174, in create_volume
    self._create_lun_on_eligible_vol(name, size, metadata, extra_specs)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 916, in _create_lun_on_eligible_vol
    volume = self._get_avl_volume_by_size(req_size)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 933, in _get_avl_volume_by_size
    res = self.client.invoke_successfully(vol_request, True)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 213, in invoke_successfully
    result = self.invoke_elem(na_element, enable_tunneling)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 199, in invoke_elem
    raise NaApiError(e.code, e.msg)
NaApiError: NetApp api failed. Reason - 404:Not Found

======================================================================
FAIL: cinder.tests.test_netapp.NetAppDirect7modeISCSIDriverTestCase_NV.test_create_fail_on_select_vol
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''-1
  stderr
  stdout

pythonlogging:'': {{{
Requested unified config: ontap_7mode and iscsi
NetApp driver of family ontap_7mode and protocol iscsi loaded
}}}

Traceback (most recent call last):
  File "/opt/stack/cinder/cinder/tests/test_netapp.py", line 1092, in test_create_fail_on_select_vol
    self.driver.create_volume(self.volume)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 174, in create_volume
    self._create_lun_on_eligible_vol(name, size, metadata, extra_specs)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 916, in _create_lun_on_eligible_vol
    volume = self._get_avl_volume_by_size(req_size)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 933, in _get_avl_volume_by_size
    res = self.client.invoke_successfully(vol_request, True)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 213, in invoke_successfully
    result = self.invoke_elem(na_element, enable_tunneling)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 199, in invoke_elem
    raise NaApiError(e.code, e.msg)
NaApiError: NetApp api failed. Reason - 404:Not Found

======================================================================
FAIL: cinder.tests.test_netapp.NetAppDirect7modeISCSIDriverTestCase_NV.test_create_on_select_vol
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''-1
  stderr
  stdout

pythonlogging:'': {{{
Requested unified config: ontap_7mode and iscsi
NetApp driver of family ontap_7mode and protocol iscsi loaded
}}}

Traceback (most recent call last):
  File "/opt/stack/cinder/cinder/tests/test_netapp.py", line 1084, in test_create_on_select_vol
    self.driver.create_volume(self.volume)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 174, in create_volume
    self._create_lun_on_eligible_vol(name, size, metadata, extra_specs)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 916, in _create_lun_on_eligible_vol
    volume = self._get_avl_volume_by_size(req_size)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 933, in _get_avl_volume_by_size
    res = self.client.invoke_successfully(vol_request, True)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 213, in invoke_successfully
    result = self.invoke_elem(na_element, enable_tunneling)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 199, in invoke_elem
    raise NaApiError(e.code, e.msg)
NaApiError: NetApp api failed. Reason - 404:Not Found

======================================================================
FAIL: cinder.tests.test_netapp.NetAppDirect7modeISCSIDriverTestCase_NV.test_create_vol_snapshot_destroy
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''-1
  stderr
  stdout

pythonlogging:'': {{{
Requested unified config: ontap_7mode and iscsi
NetApp driver of family ontap_7mode and protocol iscsi loaded
}}}

Traceback (most recent call last):
  File "/opt/stack/cinder/cinder/tests/test_netapp.py", line 549, in test_create_vol_snapshot_destroy
    self.driver.create_volume(self.volume)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 174, in create_volume
    self._create_lun_on_eligible_vol(name, size, metadata, extra_specs)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 916, in _create_lun_on_eligible_vol
    volume = self._get_avl_volume_by_size(req_size)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 933, in _get_avl_volume_by_size
    res = self.client.invoke_successfully(vol_request, True)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 213, in invoke_successfully
    result = self.invoke_elem(na_element, enable_tunneling)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 199, in invoke_elem
    raise NaApiError(e.code, e.msg)
NaApiError: NetApp api failed. Reason - 404:Not Found

======================================================================
FAIL: cinder.tests.test_netapp.NetAppDirect7modeISCSIDriverTestCase_NV.test_fail_cloned_volume_creation
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''-1
  stderr
  stdout

pythonlogging:'': {{{
Requested unified config: ontap_7mode and iscsi
NetApp driver of family ontap_7mode and protocol iscsi loaded
}}}

Traceback (most recent call last):
  File "/opt/stack/cinder/cinder/tests/test_netapp.py", line 588, in test_fail_cloned_volume_creation
    self.driver.create_volume(self.volume)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 174, in create_volume
    self._create_lun_on_eligible_vol(name, size, metadata, extra_specs)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 916, in _create_lun_on_eligible_vol
    volume = self._get_avl_volume_by_size(req_size)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 933, in _get_avl_volume_by_size
    res = self.client.invoke_successfully(vol_request, True)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 213, in invoke_successfully
    result = self.invoke_elem(na_element, enable_tunneling)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 199, in invoke_elem
    raise NaApiError(e.code, e.msg)
NaApiError: NetApp api failed. Reason - 404:Not Found

======================================================================
FAIL: cinder.tests.test_netapp.NetAppDirect7modeISCSIDriverTestCase_NV.test_fail_create_vol
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''-1
  stderr
  stdout

pythonlogging:'': {{{
Requested unified config: ontap_7mode and iscsi
NetApp driver of family ontap_7mode and protocol iscsi loaded
}}}

Traceback (most recent call last):
  File "/opt/stack/cinder/cinder/tests/test_netapp.py", line 613, in test_fail_create_vol
    self.driver.create_volume, self.vol_fail)
  File "/opt/stack/cinder/.venv/lib/python2.7/site-packages/testtools/testcase.py", line 394, in assertRaises
    self.assertThat(our_callable, matcher)
  File "/opt/stack/cinder/.venv/lib/python2.7/site-packages/testtools/testcase.py", line 406, in assertThat
    mismatch = matcher.match(matchee)
  File "/opt/stack/cinder/.venv/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 99, in match
    mismatch = self.exception_matcher.match(exc_info)
  File "/opt/stack/cinder/.venv/lib/python2.7/site-packages/testtools/matchers/_higherorder.py", line 61, in match
    mismatch = matcher.match(matchee)
  File "/opt/stack/cinder/.venv/lib/python2.7/site-packages/testtools/testcase.py", line 386, in match
    reraise(*matchee)
  File "/opt/stack/cinder/.venv/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 92, in match
    result = matchee()
  File "/opt/stack/cinder/.venv/lib/python2.7/site-packages/testtools/testcase.py", line 867, in __call__
    return self._callable_object(*self._args, **self._kwargs)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 174, in create_volume
    self._create_lun_on_eligible_vol(name, size, metadata, extra_specs)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 916, in _create_lun_on_eligible_vol
    volume = self._get_avl_volume_by_size(req_size)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 933, in _get_avl_volume_by_size
    res = self.client.invoke_successfully(vol_request, True)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 213, in invoke_successfully
    result = self.invoke_elem(na_element, enable_tunneling)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 199, in invoke_elem
    raise NaApiError(e.code, e.msg)
NaApiError: NetApp api failed. Reason - 404:Not Found

======================================================================
FAIL: cinder.tests.test_netapp.NetAppDirect7modeISCSIDriverTestCase_NV.test_fail_vol_from_snapshot_creation
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''-1
  stderr
  stdout

pythonlogging:'': {{{
Requested unified config: ontap_7mode and iscsi
NetApp driver of family ontap_7mode and protocol iscsi loaded
}}}

Traceback (most recent call last):
  File "/opt/stack/cinder/cinder/tests/test_netapp.py", line 571, in test_fail_vol_from_snapshot_creation
    self.driver.create_volume(self.volume)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 174, in create_volume
    self._create_lun_on_eligible_vol(name, size, metadata, extra_specs)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 916, in _create_lun_on_eligible_vol
    volume = self._get_avl_volume_by_size(req_size)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 933, in _get_avl_volume_by_size
    res = self.client.invoke_successfully(vol_request, True)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 213, in invoke_successfully
    result = self.invoke_elem(na_element, enable_tunneling)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 199, in invoke_elem
    raise NaApiError(e.code, e.msg)
NaApiError: NetApp api failed. Reason - 404:Not Found

======================================================================
FAIL: cinder.tests.test_netapp.NetAppDirect7modeISCSIDriverTestCase_NV.test_map_by_creating_igroup
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''-1
  stderr
  stdout

pythonlogging:'': {{{
Requested unified config: ontap_7mode and iscsi
NetApp driver of family ontap_7mode and protocol iscsi loaded
}}}

Traceback (most recent call last):
  File "/opt/stack/cinder/cinder/tests/test_netapp.py", line 599, in test_map_by_creating_igroup
    self.driver.create_volume(self.volume)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 174, in create_volume
    self._create_lun_on_eligible_vol(name, size, metadata, extra_specs)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 916, in _create_lun_on_eligible_vol
    volume = self._get_avl_volume_by_size(req_size)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 933, in _get_avl_volume_by_size
    res = self.client.invoke_successfully(vol_request, True)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 213, in invoke_successfully
    result = self.invoke_elem(na_element, enable_tunneling)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 199, in invoke_elem
    raise NaApiError(e.code, e.msg)
NaApiError: NetApp api failed. Reason - 404:Not Found

======================================================================
FAIL: cinder.tests.test_netapp.NetAppDirect7modeISCSIDriverTestCase_NV.test_map_unmap
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''-1
  stderr
  stdout

pythonlogging:'': {{{
Requested unified config: ontap_7mode and iscsi
NetApp driver of family ontap_7mode and protocol iscsi loaded
}}}

Traceback (most recent call last):
  File "/opt/stack/cinder/cinder/tests/test_netapp.py", line 556, in test_map_unmap
    self.driver.create_volume(self.volume)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 174, in create_volume
    self._create_lun_on_eligible_vol(name, size, metadata, extra_specs)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 916, in _create_lun_on_eligible_vol
    volume = self._get_avl_volume_by_size(req_size)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/iscsi.py", line 933, in _get_avl_volume_by_size
    res = self.client.invoke_successfully(vol_request, True)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 213, in invoke_successfully
    result = self.invoke_elem(na_element, enable_tunneling)
  File "/opt/stack/cinder/cinder/volume/drivers/netapp/api.py", line 199, in invoke_elem
    raise NaApiError(e.code, e.msg)
NaApiError: NetApp api failed. Reason - 404:Not Found

Ran 13 tests in 4.296s

Changed in cinder:
status: New → Triaged
importance: Undecided → Low
Ben Swartzlander (bswartz) wrote :

Winston, can you add some instructions to reproduce these test failures? How exactly did you specify the HTTP proxy?

Ollie Leahy (oliver-leahy-l) wrote :

If I have a web proxy configured as below I see the issue as described.

$ env | grep http
http_proxy=http://www-proxy.example.com:8080/
https_proxy=https://www-proxy.example.com:8080/

Navneet (singn) on 2013-10-25
Changed in cinder:
assignee: nobody → Navneet (singn)

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

Changed in cinder:
status: Triaged → In Progress

Reviewed: https://review.openstack.org/54086
Committed: http://github.com/openstack/cinder/commit/6e3955e4cf2eaacd11adbc8df68e9d5d5e081f8f
Submitter: Jenkins
Branch: master

commit 6e3955e4cf2eaacd11adbc8df68e9d5d5e081f8f
Author: Navneet Singh <email address hidden>
Date: Tue Oct 22 01:41:11 2013 +0530

    NetApp unit test fail fix for http_proxy

    The environment having http_proxy settings caused
    the unit tests to fail with 404 error. This fix
    handles both situations with proxy or without
    proxy settings.

    Change-Id: I791a45adff654305db9f1fb6f039e91b11ba88d8
    Closes-Bug:#1223145

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-12-04
Changed in cinder:
milestone: none → icehouse-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2014-04-17
Changed in cinder:
milestone: icehouse-1 → 2014.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers