IMPALA-7629: Re-enable erroneously disabled TestClientSsl tests. The fix for IMPALA-6990 had a bug, disabling some tests erroneously. With this change, the tests run on Ubuntu16:04 like so:
tests/custom_cluster/test_client_ssl.py::TestClientSsl::test_ssl[] PASSED tests/custom_cluster/test_client_ssl.py::TestClientSsl::test_tls_ecdh[] PASSED tests/custom_cluster/test_client_ssl.py::TestClientSsl::test_tls_v12[] PASSED tests/custom_cluster/test_client_ssl.py::TestClientSsl::test_wildcard_ssl[] xfail tests/custom_cluster/test_client_ssl.py::TestClientSsl::test_wildcard_san_ssl[] xfail The xfails are all "Inconsistent wildcard support on target platforms". On centos7: custom_cluster/test_client_ssl.py::TestClientSsl::test_ssl[] PASSED custom_cluster/test_client_ssl.py::TestClientSsl::test_tls_ecdh[] SKIPPED custom_cluster/test_client_ssl.py::TestClientSsl::test_tls_v12[] SKIPPED custom_cluster/test_client_ssl.py::TestClientSsl::test_wildcard_ssl[] xfail custom_cluster/test_client_ssl.py::TestClientSsl::test_wildcard_san_ssl[] xfail On centos6: custom_cluster/test_client_ssl.py::TestClientSsl::test_ssl[] PASSED custom_cluster/test_client_ssl.py::TestClientSsl::test_tls_ecdh[] SKIPPED custom_cluster/test_client_ssl.py::TestClientSsl::test_tls_v12[] SKIPPED custom_cluster/test_client_ssl.py::TestClientSsl::test_wildcard_ssl[] SKIPPED custom_cluster/test_client_ssl.py::TestClientSsl::test_wildcard_san_ssl[] SKIPPED I used "curl --silent https://.../consoleText | grep test_client_ssl | sed -e 's/\[.*\]/[]/'" to extract these from Jenkins output. Change-Id: I64879b8af39f967b0059797e7b36421ce0e58bed Reviewed-on: http://gerrit.cloudera.org:8080/11530 Reviewed-by: Philip Zeyliger <phi...@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Project: http://git-wip-us.apache.org/repos/asf/impala/repo Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/d3cf6d32 Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/d3cf6d32 Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/d3cf6d32 Branch: refs/heads/master Commit: d3cf6d325779fff4ab0ba9db53411c510aa0f717 Parents: ade399c Author: Philip Zeyliger <phi...@cloudera.com> Authored: Wed Sep 26 15:50:47 2018 -0700 Committer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Committed: Tue Oct 2 01:54:41 2018 +0000 ---------------------------------------------------------------------- tests/custom_cluster/test_client_ssl.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/impala/blob/d3cf6d32/tests/custom_cluster/test_client_ssl.py ---------------------------------------------------------------------- diff --git a/tests/custom_cluster/test_client_ssl.py b/tests/custom_cluster/test_client_ssl.py index 81afd52..b6f7e04 100644 --- a/tests/custom_cluster/test_client_ssl.py +++ b/tests/custom_cluster/test_client_ssl.py @@ -32,11 +32,14 @@ from tests.shell.util import run_impala_shell_cmd, run_impala_shell_cmd_no_expec REQUIRED_MIN_OPENSSL_VERSION = 0x10001000L REQUIRED_MIN_PYTHON_VERSION_FOR_TLSV12 = (2,7,9) -SKIP_SSL_MSG = "Legacy OpenSSL module detected" -HAS_LEGACY_OPENSSL = getattr(ssl, "OPENSSL_VERSION_NUMBER", None) -if HAS_LEGACY_OPENSSL is not None: +_openssl_version_number = getattr(ssl, "OPENSSL_VERSION_NUMBER", None) +if _openssl_version_number is None: + SKIP_SSL_MSG = "Legacy OpenSSL module detected" +elif _openssl_version_number < REQUIRED_MIN_OPENSSL_VERSION: SKIP_SSL_MSG = "Only have OpenSSL version %X, but test requires %X" % ( ssl.OPENSSL_VERSION_NUMBER, REQUIRED_MIN_OPENSSL_VERSION) +else: + SKIP_SSL_MSG = None class TestClientSsl(CustomClusterTestSuite): """Tests for a client using SSL (particularly, the Impala Shell) """ @@ -119,7 +122,7 @@ class TestClientSsl(CustomClusterTestSuite): @CustomClusterTestSuite.with_args(impalad_args=TLS_ECDH_ARGS, statestored_args=TLS_ECDH_ARGS, catalogd_args=TLS_ECDH_ARGS) - @pytest.mark.skipif(HAS_LEGACY_OPENSSL, reason=SKIP_SSL_MSG) + @pytest.mark.skipif(SKIP_SSL_MSG is not None, reason=SKIP_SSL_MSG) @pytest.mark.skipif(sys.version_info < REQUIRED_MIN_PYTHON_VERSION_FOR_TLSV12, reason="Working around IMPALA-7628. TODO: is the right workaround?") def test_tls_ecdh(self, vector): @@ -140,7 +143,7 @@ class TestClientSsl(CustomClusterTestSuite): @CustomClusterTestSuite.with_args(impalad_args=TLS_V12_ARGS, statestored_args=TLS_V12_ARGS, catalogd_args=TLS_V12_ARGS) - @pytest.mark.skipif(HAS_LEGACY_OPENSSL, reason=SKIP_SSL_MSG) + @pytest.mark.skipif(SKIP_SSL_MSG is not None, reason=SKIP_SSL_MSG) @pytest.mark.skipif(sys.version_info < REQUIRED_MIN_PYTHON_VERSION_FOR_TLSV12, \ reason="Python version too old to allow Thrift client to use TLSv1.2") def test_tls_v12(self, vector): @@ -150,7 +153,7 @@ class TestClientSsl(CustomClusterTestSuite): @CustomClusterTestSuite.with_args(impalad_args=SSL_WILDCARD_ARGS, statestored_args=SSL_WILDCARD_ARGS, catalogd_args=SSL_WILDCARD_ARGS) - @pytest.mark.skipif(HAS_LEGACY_OPENSSL, reason=SKIP_SSL_MSG) + @pytest.mark.skipif(SKIP_SSL_MSG is not None, reason=SKIP_SSL_MSG) @pytest.mark.xfail(run=True, reason="Inconsistent wildcard support on target platforms") def test_wildcard_ssl(self, vector): """ Test for IMPALA-3159: Test with a certificate which has a wildcard for the @@ -164,7 +167,7 @@ class TestClientSsl(CustomClusterTestSuite): @CustomClusterTestSuite.with_args(impalad_args=SSL_WILDCARD_SAN_ARGS, statestored_args=SSL_WILDCARD_SAN_ARGS, catalogd_args=SSL_WILDCARD_SAN_ARGS) - @pytest.mark.skipif(HAS_LEGACY_OPENSSL, reason=SKIP_SSL_MSG) + @pytest.mark.skipif(SKIP_SSL_MSG is not None, reason=SKIP_SSL_MSG) @pytest.mark.xfail(run=True, reason="Inconsistent wildcard support on target platforms") def test_wildcard_san_ssl(self, vector): """ Test for IMPALA-3159: Test with a certificate which has a wildcard as a SAN. """