Your message dated Mon, 23 May 2022 13:51:18 +0000
with message-id <[email protected]>
and subject line Bug#1010881: fixed in libcloud 3.4.1-4
has caused the Debian Bug report #1010881,
regarding libcloud: Autopkgtest failure when no network or 
https_proxy/http_proxy set
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1010881: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1010881
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libcloud
Version: 3.4.1-2
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu kinetic ubuntu-patch

Dear Maintainer,

Since the move to 3.4.1, libcloud fails autopkgtest when either:
 * Internet access is not available
 * http_proxy or https_proxy is set

In Ubuntu, the attached patch was applied to achieve the following:

  * Disable test that requires access to the Internet.
  * Applied patches forwarded upstream to fix failures when HTTP proxy
    variables are set (LP: #1972888)


Thanks for considering the patch.


-- System Information:
Debian Release: bookworm/sid
  APT prefers jammy-updates
  APT policy: (500, 'jammy-updates'), (500, 'jammy-security'), (500, 'jammy')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.15.0-27-generic (SMP w/4 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru 
libcloud-3.4.1/debian/patches/43b71091ebd159570302b695f0a244f4d0a7e497.patch 
libcloud-3.4.1/debian/patches/43b71091ebd159570302b695f0a244f4d0a7e497.patch
--- 
libcloud-3.4.1/debian/patches/43b71091ebd159570302b695f0a244f4d0a7e497.patch    
    1970-01-01 01:00:00.000000000 +0100
+++ 
libcloud-3.4.1/debian/patches/43b71091ebd159570302b695f0a244f4d0a7e497.patch    
    2022-05-11 15:51:43.000000000 +0200
@@ -0,0 +1,49 @@
+Description: stop HTTP server (thread) properly
+ test/test_http.py: stop HTTP server (thread) properly
+
+ The HttpLayerTestCase test class creates a HTTPServer instance and runs
+ it in a separate thread.
+
+ After running all the test-cases, we attempt to close the server and the
+ thread by killing the thread. Unfortunately, the code that does that is
+ unreachable because the tear-down member function is called tearDownCls
+ intead of tearDownClass.
+
+ Moreover, there is no threading.Thread.kill function. This was undetected
+ because the code was unreachable.
+
+ The proper way to clean things up is to:
+
+ 1. Stop the HTTP server using HTTPServer.shutdown()
+ 2. Release the resources using HTTPServer.server_close()
+ 3. Join the thread using threading.Thread.join()
+
+ The original patch from upstream was missing the call to
+ HTTPServer.server_close(), which was added later.
+
+ This patch is not strictly necessary to fix the tests but subsequent patches
+ depend on tearDownClass being spelled properly.
+Author: Olivier Gayot <[email protected]>
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libcloud/+bug/1972888
+Forwarded: https://github.com/apache/libcloud/pull/1690
+Applied-Upstream: 
https://github.com/apache/libcloud/pull/1690/commits/43b71091ebd159570302b695f0a244f4d0a7e497
+Last-Update: 2022-05-11
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: b/libcloud/test/test_http.py
+===================================================================
+--- a/libcloud/test/test_http.py       2022-05-11 17:11:36.733859740 +0200
++++ b/libcloud/test/test_http.py       2022-05-11 17:11:36.729859732 +0200
+@@ -116,8 +116,10 @@
+         cls.mock_server_thread.start()
+ 
+     @classmethod
+-    def tearDownCls(cls):
+-        cls.mock_server_thread.kill()
++    def tearDownClass(cls):
++        cls.mock_server.shutdown()
++        cls.mock_server.server_close()
++        cls.mock_server_thread.join()
+ 
+     def test_prepared_request_empty_body_chunked_encoding_not_used(self):
+         connection = LibcloudConnection(host=self.listen_host, 
port=self.listen_port)
diff -Nru 
libcloud-3.4.1/debian/patches/83bd562337abdda4b1ba6706999b13aa358bdd28.patch 
libcloud-3.4.1/debian/patches/83bd562337abdda4b1ba6706999b13aa358bdd28.patch
--- 
libcloud-3.4.1/debian/patches/83bd562337abdda4b1ba6706999b13aa358bdd28.patch    
    1970-01-01 01:00:00.000000000 +0100
+++ 
libcloud-3.4.1/debian/patches/83bd562337abdda4b1ba6706999b13aa358bdd28.patch    
    2022-05-11 15:51:43.000000000 +0200
@@ -0,0 +1,46 @@
+Description: test/test_http.py: also backup/restore HTTP proxy settings
+
+ The HttpLayerTestCase class relies on the LibcloudConnection class -
+ which honors https_proxy and http_proxy variables.
+
+ Since the tests expect connections to the loopback interface (e.g.,
+ 127.0.0.1), we need to clear the http_proxy and https_proxy
+ variables before running the tests. Later on, we need to restore the
+ variables just like we did in test/test_connection.py
+Author: Olivier Gayot <[email protected]>
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libcloud/+bug/1972888
+Forwarded: https://github.com/apache/libcloud/pull/1692
+Applied-Upstream: 
https://github.com/apache/libcloud/commit/83bd562337abdda4b1ba6706999b13aa358bdd28
+Last-Update: 2022-05-11
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: b/libcloud/test/test_http.py
+===================================================================
+--- a/libcloud/test/test_http.py       2022-05-11 17:11:36.729859732 +0200
++++ b/libcloud/test/test_http.py       2022-05-11 17:14:49.406276318 +0200
+@@ -115,12 +115,25 @@
+         cls.mock_server_thread.setDaemon(True)
+         cls.mock_server_thread.start()
+ 
++        cls.orig_http_proxy = os.environ.pop("http_proxy", None)
++        cls.orig_https_proxy = os.environ.pop("https_proxy", None)
++
+     @classmethod
+     def tearDownClass(cls):
+         cls.mock_server.shutdown()
+         cls.mock_server.server_close()
+         cls.mock_server_thread.join()
+ 
++        if cls.orig_http_proxy:
++            os.environ["http_proxy"] = cls.orig_http_proxy
++        elif "http_proxy" in os.environ:
++            del os.environ["http_proxy"]
++
++        if cls.orig_https_proxy:
++            os.environ["https_proxy"] = cls.orig_https_proxy
++        elif "https_proxy" in os.environ:
++            del os.environ["https_proxy"]
++
+     def test_prepared_request_empty_body_chunked_encoding_not_used(self):
+         connection = LibcloudConnection(host=self.listen_host, 
port=self.listen_port)
+         connection.prepared_request(method='GET', 
url='/test/prepared-request-1', body='', stream=True)
diff -Nru 
libcloud-3.4.1/debian/patches/950e2a57a17c796264b647fd08353dd2e57d42ae.patch 
libcloud-3.4.1/debian/patches/950e2a57a17c796264b647fd08353dd2e57d42ae.patch
--- 
libcloud-3.4.1/debian/patches/950e2a57a17c796264b647fd08353dd2e57d42ae.patch    
    1970-01-01 01:00:00.000000000 +0100
+++ 
libcloud-3.4.1/debian/patches/950e2a57a17c796264b647fd08353dd2e57d42ae.patch    
    2022-05-11 15:51:43.000000000 +0200
@@ -0,0 +1,41 @@
+Description: test/test_connection.py: do not clear http_proxy unconditionally
+ The tearDownClass function from BaseConnectionClassTestCase used to
+ clear the http_proxy environment variable unconditionally. This can have
+ unexpected side effects since subsequent tests run with no http_proxy
+ set even if it was inherited from the environment when pytest was
+ started.
+
+ Also, the http_proxy variable is already restored to its saved value (or
+ cleared if there was no value to save) in the tearDown function after
+ each test is executed, so there seems to be no reason to attempt to
+ clear it again.
+
+ Likewise, the libcloud.common.base.ALLOW_PATH_DOUBLE_SLASHES variable is
+ already reset to False after each test is executed so there is no reason
+ to set it to False again after all tests from the TestCase have
+ executed.
+Author: Olivier Gayot <[email protected]>
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libcloud/+bug/1972888
+Forwarded: https://github.com/apache/libcloud/pull/1692
+Applied-Upstream: 
https://github.com/apache/libcloud/commit/950e2a57a17c796264b647fd08353dd2e57d42ae
+Last-Update: 2022-05-11
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: b/libcloud/test/test_connection.py
+===================================================================
+--- a/libcloud/test/test_connection.py 2022-05-11 15:54:57.283262641 +0200
++++ b/libcloud/test/test_connection.py 2022-05-11 15:55:18.027343574 +0200
+@@ -52,13 +52,6 @@
+ 
+         libcloud.common.base.ALLOW_PATH_DOUBLE_SLASHES = False
+ 
+-    @classmethod
+-    def tearDownClass(cls):
+-        if 'http_proxy' in os.environ:
+-            del os.environ['http_proxy']
+-
+-        libcloud.common.base.ALLOW_PATH_DOUBLE_SLASHES = False
+-
+     def test_parse_proxy_url(self):
+         conn = LibcloudBaseConnection()
+ 
diff -Nru 
libcloud-3.4.1/debian/patches/95753dadf64128f10b75c07b9944d04101ad89b8.patch 
libcloud-3.4.1/debian/patches/95753dadf64128f10b75c07b9944d04101ad89b8.patch
--- 
libcloud-3.4.1/debian/patches/95753dadf64128f10b75c07b9944d04101ad89b8.patch    
    1970-01-01 01:00:00.000000000 +0100
+++ 
libcloud-3.4.1/debian/patches/95753dadf64128f10b75c07b9944d04101ad89b8.patch    
    2022-05-11 15:51:43.000000000 +0200
@@ -0,0 +1,54 @@
+Description: test/test_connection.py: allow tests to run if https_proxy is set
+ We have code in setUp & tearDown functions to make tests run properly if
+ the http_proxy variable is already present in the environment when
+ running tests.
+
+ The code backs up the http_proxy variable, clears it, and restores it
+ after the tests have run.
+
+ However, we would also need to handle the HTTPS counterpart, the
+ https_proxy variable. Running tests with this variable set currently
+ fails with:
+
+       self.assertIsNone(conn.proxy_scheme)
+ E       AssertionError: 'http' is not None
+
+ libcloud/test/test_connection.py:127: AssertionError
+
+ This patch adds the same logic that we have for HTTP, but for the HTTPS
+ counterpart.
+Author: Olivier Gayot <[email protected]>
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libcloud/+bug/1972888
+Forwarded: https://github.com/apache/libcloud/pull/1692
+Applied-Upstream: 
https://github.com/apache/libcloud/commit/95753dadf64128f10b75c07b9944d04101ad89b8
+Last-Update: 2022-05-11
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: b/libcloud/test/test_connection.py
+===================================================================
+--- a/libcloud/test/test_connection.py 2022-05-11 17:11:20.405830655 +0200
++++ b/libcloud/test/test_connection.py 2022-05-11 17:11:20.401830648 +0200
+@@ -42,14 +42,20 @@
+ class BaseConnectionClassTestCase(unittest.TestCase):
+ 
+     def setUp(self):
+-        self.orig_proxy = os.environ.pop('http_proxy', None)
++        self.orig_http_proxy = os.environ.pop("http_proxy", None)
++        self.orig_https_proxy = os.environ.pop("https_proxy", None)
+ 
+     def tearDown(self):
+-        if self.orig_proxy:
+-            os.environ['http_proxy'] = self.orig_proxy
++        if self.orig_http_proxy:
++            os.environ["http_proxy"] = self.orig_http_proxy
+         elif 'http_proxy' in os.environ:
+             del os.environ['http_proxy']
+ 
++        if self.orig_https_proxy:
++            os.environ["https_proxy"] = self.orig_https_proxy
++        elif "https_proxy" in os.environ:
++            del os.environ["https_proxy"]
++
+         libcloud.common.base.ALLOW_PATH_DOUBLE_SLASHES = False
+ 
+     def test_parse_proxy_url(self):
diff -Nru libcloud-3.4.1/debian/patches/disable-online-test.patch 
libcloud-3.4.1/debian/patches/disable-online-test.patch
--- libcloud-3.4.1/debian/patches/disable-online-test.patch     1970-01-01 
01:00:00.000000000 +0100
+++ libcloud-3.4.1/debian/patches/disable-online-test.patch     2022-05-11 
15:51:43.000000000 +0200
@@ -0,0 +1,28 @@
+Description: Disable tests that require to be online
+Author: Olivier Gayot <[email protected]>
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libcloud/+bug/1972888
+Forwarded: not-needed
+Last-Update: 2022-05-11
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: b/libcloud/test/compute/test_ovh.py
+===================================================================
+--- a/libcloud/test/compute/test_ovh.py        2022-05-11 17:11:46.085876879 
+0200
++++ b/libcloud/test/compute/test_ovh.py        2022-05-11 17:11:46.081876871 
+0200
+@@ -16,6 +16,8 @@
+ import unittest
+ from mock import patch
+ 
++import pytest
++
+ from libcloud.utils.py3 import httplib
+ from libcloud.common.exceptions import BaseHTTPError
+ from libcloud.http import LibcloudConnection
+@@ -162,6 +164,7 @@
+         driver = OvhNodeDriver(*OVH_PARAMS, region='ca')
+         self.assertEqual(driver.connection.host, 'ca.api.ovh.com')
+ 
++    @pytest.mark.skip("Requires access to the Internet")
+     def test_list_nodes_invalid_region(self):
+         OvhNodeDriver.connectionCls.conn_class = LibcloudConnection
+         driver = OvhNodeDriver(*OVH_PARAMS, region='invalid')
diff -Nru libcloud-3.4.1/debian/patches/series 
libcloud-3.4.1/debian/patches/series
--- libcloud-3.4.1/debian/patches/series        1970-01-01 01:00:00.000000000 
+0100
+++ libcloud-3.4.1/debian/patches/series        2022-05-11 15:51:43.000000000 
+0200
@@ -0,0 +1,5 @@
+950e2a57a17c796264b647fd08353dd2e57d42ae.patch
+95753dadf64128f10b75c07b9944d04101ad89b8.patch
+43b71091ebd159570302b695f0a244f4d0a7e497.patch
+83bd562337abdda4b1ba6706999b13aa358bdd28.patch
+disable-online-test.patch

--- End Message ---
--- Begin Message ---
Source: libcloud
Source-Version: 3.4.1-4
Done: Benjamin Drung <[email protected]>

We believe that the bug you reported is fixed in the latest version of
libcloud, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Benjamin Drung <[email protected]> (supplier of updated libcloud package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Mon, 23 May 2022 14:15:55 +0200
Source: libcloud
Built-For-Profiles: noudeb
Architecture: source
Version: 3.4.1-4
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Team <[email protected]>
Changed-By: Benjamin Drung <[email protected]>
Closes: 1010881
Changes:
 libcloud (3.4.1-4) unstable; urgency=medium
 .
   * Team upload.
 .
   [ Olivier Gayot ]
   * Added patches to fix autopkgtest failure when HTTP proxy
     variables are set. Also disable tests that require access to the Internet.
     Closes: #1010881
 .
   [ Benjamin Drung ]
   * Run all succeeding test cases again.
Checksums-Sha1:
 3b1c3eb2c80809a3c59c8334aa03df4beca7f046 2673 libcloud_3.4.1-4.dsc
 d6c07f1aa345639748999eb20b5b53fb68e3f310 2445638 libcloud_3.4.1.orig.tar.gz
 2aaafcfc1507d5889d3b9fa50e6e49afdd89021c 988 libcloud_3.4.1.orig.tar.gz.asc
 f515e50989fd43f9d180d129117a58f2caad47e8 21544 libcloud_3.4.1-4.debian.tar.xz
 99cb253f8388490529329efe61f1aaca9ad35006 8339 libcloud_3.4.1-4_source.buildinfo
Checksums-Sha256:
 729ce8e68a805b3081e7dc340ebdc98ccb2566511643c8d838519838d8f1bec2 2673 
libcloud_3.4.1-4.dsc
 88f18da0cf3fac0af723e743fb741d9d1be251881edab7a5a0d1629955b5011b 2445638 
libcloud_3.4.1.orig.tar.gz
 0bb632d6c785ca1a1b8d38d75844b272a34fecc82b25d4e890b1861d48c5c64e 988 
libcloud_3.4.1.orig.tar.gz.asc
 27ca45148112cce0a3ca99d2571f86a983dbfc31a086054c63de38557f36f250 21544 
libcloud_3.4.1-4.debian.tar.xz
 f9bfd9c5927aebeedeaba6c7e0f97b562d5024756095ffd784d16dcd483478d4 8339 
libcloud_3.4.1-4_source.buildinfo
Files:
 b0bfc16c92ea5cd244be91209237d5e4 2673 python optional libcloud_3.4.1-4.dsc
 d47b2d3c763a6565f04884e5c1118e38 2445638 python optional 
libcloud_3.4.1.orig.tar.gz
 d1a2d0fa1f0702ed8f2228e233200c83 988 python optional 
libcloud_3.4.1.orig.tar.gz.asc
 04d8b6ff1683108ad6d021884ed73962 21544 python optional 
libcloud_3.4.1-4.debian.tar.xz
 4b0dbb1a8c8531fcae3fe5ec28f1861d 8339 python optional 
libcloud_3.4.1-4_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJGBAEBCgAwFiEE5/q3CzlQJ15towl13YzVpd6MfnoFAmKLipgSHGJkcnVuZ0B1
YnVudHUuY29tAAoJEN2M1aXejH56wYoP/i4nuOjysHDf/Ewj3PHSMVYMA8lRfdNI
ZiojCPKXN0G+ahl/ElNftRUtpPHm53m8cm79/kRZ76jzCA+drnQjRtBBpTpCJ8go
BQ2y5TNk8bZ3a3xtJIe91BTtErcWjD9/sz+IjyHD4CtrYzywpnxSPvfk6wKkWppH
r0w4+xBrDDSdkgmsfCFNX1M+tE79fYnfkQlbsL4SNn44vSQkEl0NXrJkiX4kxmuZ
M4q9XEiP4vy1LvegB+pd5AsooZ2B/AjP331NB8s4GdTfCnOPgW7sS+eGECPdHcGN
aBdyDl5DZALxn/yrW2mzQEZaWd1whLiyYOQ7G4ahA9nhR5whxtx4bIO8O2GNjURd
IGJYfDWATnseY5+xty7ncDXRKifodFl8BekatC0uTbLWaSVmdtRqVCMB0bgbZZiQ
0/mD49lx52G+k5XgL/gTpkMA+n2BY/LMVa08Nal2YEKWsPN2IYN45um1IfANijq3
7Fdfl4U+mHWYcbFYtZlKXm0dtjiMxzfC4OoOUED+9bnawElgHqz1PDX23A7ILAYy
Jsg7J88+mmU0WXtl38ec1j8H/e/TX0KBwtG2qVzpPF7B5v7JlG7BgZfB/5DGzFAD
nBDAtoOQhJWThuKafho+VjY2YlWKFa1CvU1yjtWQ1nz1WkOF0YVREzFviGiCLkqD
Ifo0PzSbKV7r
=PWCj
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to