[ARVADOS] updated: 1.1.4-534-g3813e892b
Git user
git at public.curoverse.com
Mon Jul 2 11:11:43 EDT 2018
Summary of changes:
sdk/python/tests/test_keep_client.py | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
via 3813e892be7f3136e5b14580e7ee64d6c786bf8e (commit)
from 4a2dc82a1acce855151928abe0030e1dd7dbf728 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 3813e892be7f3136e5b14580e7ee64d6c786bf8e
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Mon Jul 2 11:10:20 2018 -0400
13547: Test insecure-tls flag passed through to pycurl.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/sdk/python/tests/test_keep_client.py b/sdk/python/tests/test_keep_client.py
index 7c9ff735a..a7b79933b 100644
--- a/sdk/python/tests/test_keep_client.py
+++ b/sdk/python/tests/test_keep_client.py
@@ -319,6 +319,29 @@ class KeepClientServiceTestCase(unittest.TestCase, tutil.ApiClientMock):
self.assertEqual('100::1', service.hostname)
self.assertEqual(10, service.port)
+ def test_insecure_disables_tls_verify(self):
+ api_client = self.mock_keep_services(count=1)
+ force_timeout = socket.timeout("timed out")
+
+ api_client.insecure = True
+ with tutil.mock_keep_responses(b'foo', 200) as mock:
+ keep_client = arvados.KeepClient(api_client=api_client)
+ keep_client.get('acbd18db4cc2f85cedef654fccc4a4d8+3')
+ self.assertEqual(
+ mock.responses[0].getopt(pycurl.SSL_VERIFYPEER),
+ 0)
+
+ api_client.insecure = False
+ with tutil.mock_keep_responses(b'foo', 200) as mock:
+ keep_client = arvados.KeepClient(api_client=api_client)
+ keep_client.get('acbd18db4cc2f85cedef654fccc4a4d8+3')
+ # getopt()==None here means we didn't change the
+ # default. If we were using real pycurl instead of a mock,
+ # it would return the default value 1.
+ self.assertEqual(
+ mock.responses[0].getopt(pycurl.SSL_VERIFYPEER),
+ None)
+
# test_*_timeout verify that KeepClient instructs pycurl to use
# the appropriate connection and read timeouts. They don't care
# whether pycurl actually exhibits the expected timeout behavior
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list