[Debian-ha-maintainers] Bug#874026: pcs: Fix autopkgtest to work when proxy is set in the test environment

Steve Langasek steve.langasek at canonical.com
Sat Sep 2 07:28:29 UTC 2017


Package: pcs
Version: 0.9.159-3
Severity: normal
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu artful ubuntu-patch autopkgtest

The latest pcs package has been failing its autopkgtests on Ubuntu's
infrastructure, because Ubuntu's test environment uses a global http proxy
for communicating to the Internet, and the test suite doesn't expect this:

FAIL: test_connection_error (pcs.test.test_lib_external.NodeCommunicatorTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/usr/lib/python2.7/dist-packages/pcs/test/test_lib_external.py", line 928, in test_connection_error
    self.fixture_report_item_list_debug(expected_url, "")
  File "/usr/lib/python2.7/dist-packages/pcs/test/tools/assertions.py", line 255, in assert_report_item_list_equal
    __find_report_info(report_info_list, report_item)
  File "/usr/lib/python2.7/dist-packages/pcs/test/tools/assertions.py", line 293, in __find_report_info
    else "  No report is expected!"
AssertionError: Unexpected report given: 
(u'WARNING', u'NODE_COMMUNICATION_PROXY_IS_SET', {}, None) 
expected reports are: 
(u'DEBUG', u'NODE_COMMUNICATION_NOT_CONNECTED', {u'node': u'test_host', u'reason': u'expected reason'})
(u'DEBUG', u'NODE_COMMUNICATION_DEBUG_INFO', {u'data': u'', u'target': u'https://test_host:2224/test_request'})

----------------------------------------------------------------------

http://autopkgtest.ubuntu.com/packages/p/pcs/artful/amd64
https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac/autopkgtest-artful/artful/amd64/p/pcs/20170807_065104_85842@/log.gz

This is simple enough to fix by unsetting the http_proxy and https_proxy
variables before calling the test runner.  Please consider applying the
attached patch, which has been uploaded to Ubuntu.

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
diff -Nru pcs-0.9.159/debian/tests/testsuite-pcs pcs-0.9.159/debian/tests/testsuite-pcs
--- pcs-0.9.159/debian/tests/testsuite-pcs	2017-09-01 21:12:48.000000000 -0700
+++ pcs-0.9.159/debian/tests/testsuite-pcs	2017-09-01 22:12:03.000000000 -0700
@@ -1,6 +1,8 @@
 #!/bin/sh
 
 set -e
+unset http_proxy
+unset https_proxy
 
 cat >>/etc/hosts <<EOF
 


More information about the Debian-ha-maintainers mailing list