Debian Patches

Status for libcloud/3.4.1-5

Patch Description Author Forwarded Bugs Origin Last update
0001-test-fix-test_ssh_client-on-big-endian-architectures.patch test: fix test_ssh_client on big-endian architectures
The tests test_consume_*_chunk_contains_no_utf8_character are meant to
ensure support for non-UTF-8 characters. To do so, we use UTF-8
characters and compare their binary representation after being fed to
paramiko.

Unfortunately, UTF-32 is affected by endianness, resulting in failed
tests on big-endian architectures.

Fixed by checking the endianness and comparing the UTF-32 characters to
their respective binary representation.
Olivier Gayot <olivier.gayot@canonical.com> no upstream, https://github.com/apache/libcloud/commit/df060de6ea325cba2b6411780728705252543bc3 2022-05-12
0002-Use-tuple-to-compare-versions-for-test-against-Param.patch Use tuple to compare versions for test against Paramiko =?utf-8?b?IkjDpXZhcmQgRi4gQWFzZW4i?= <havard.f.aasen@pfft.no> yes 2022-05-14
0003-test-test_http.py-stop-HTTP-server-thread-properly.patch 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. Join the thread using threading.Thread.join()

The original patch from upstream was missing the call to
HTTPServer.server_close(), which was added later.
Olivier Gayot <olivier.gayot@canonical.com> no upstream, https://github.com/apache/libcloud/commits/43b71091ebd159570302b695f0a244f4d0a7e497 2022-05-10
0008-tests-adjust-retry-timeouts.patch Alleviate race conditions in test_retry_* The retry tests (test_retry_*) are inherently racy because they assume mock side effects
will always finish before the timeout. If for some reason the execution is a bit slow,
this can lead to the timeout beating the mocks, and the tests will fail. Adjust these tests
to alleviate this issue.
Nick Rosbrook <nick.rosbrook@canonical.com> yes 2022-06-02
0004-test-test_connection.py-do-not-clear-http_proxy-unco.patch 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.
Olivier Gayot <olivier.gayot@canonical.com> no upstream, https://github.com/apache/libcloud/commit/950e2a57a17c796264b647fd08353dd2e57d42ae 2022-05-11
0005-test-test_connection.py-allow-tests-to-run-if-https_.patch 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.
Olivier Gayot <olivier.gayot@canonical.com> no upstream, https://github.com/apache/libcloud/commit/95753dadf64128f10b75c07b9944d04101ad89b8 2022-05-11
0006-test-test_http.py-also-backup-restore-HTTP-proxy-set.patch 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
Olivier Gayot <olivier.gayot@canonical.com> no upstream, https://github.com/apache/libcloud/commit/83bd562337abdda4b1ba6706999b13aa358bdd28 2022-05-11
0007-tests-add-way-to-skip-tests-that-require-access-to-t.patch tests: add way to skip tests that require access to the network/Internet

This patch introduces two new variables which allow to skip some of the
tests run:

* NO_INTERNET -> skips the tests that require access to the Internet
* NO_NETWORK -> skips the tests that require the network to be up.

NO_NETWORK implies NO_INTERNET.

Tests that are skipped by NO_NETWORK include tests that bind sockets to
the loopback interface.

As for the two tests that are skipped with NO_INTERNET, they
respectively:

* send DNS queries and expect a NXDOMAIN response
* attempt to send packets to 10.255.255.1 and expect a timeout
(requires a default route)
Olivier Gayot <olivier.gayot@canonical.com> no upstream, https://github.com/apache/libcloud/commit/e07170fc256197c254af1ff19efee926d5b4212a 2022-05-20

All known versions for source package 'libcloud'

Links