From 9bba06d4b5331b2013483d5a11832a8a386a84a9 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Thu, 22 Apr 2021 17:24:22 -0700 Subject: [PATCH 1/6] PYTHON-2603 Standardize on rhel72-zseries, ubuntu1604-power8, and ubuntu1804-arm64 --- .evergreen/config.yml | 71 ++++++------------------------------------- 1 file changed, 9 insertions(+), 62 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index c678535fd4..f648683978 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -1606,10 +1606,6 @@ axes: batchtime: 10080 # 7 days variables: libmongocrypt_url: https://s3.amazonaws.com/mciuploads/libmongocrypt/rhel-70-64-bit/master/latest/libmongocrypt.tar.gz - - id: rhel71-power8-test - display_name: "RHEL 7.1 (POWER8)" - run_on: rhel71-power8-test - batchtime: 10080 # 7 days - id: rhel72-zseries-test display_name: "RHEL 7.2 (zSeries)" run_on: rhel72-zseries-test @@ -1635,12 +1631,6 @@ axes: batchtime: 10080 # 7 days variables: python3_binary: python3 - - id: ubuntu1604-arm64-small - display_name: "Ubuntu 16.04 (ARM64)" - run_on: ubuntu1604-arm64-small - batchtime: 10080 # 7 days - variables: - libmongocrypt_url: https://s3.amazonaws.com/mciuploads/libmongocrypt/ubuntu1604-arm64/master/latest/libmongocrypt.tar.gz - id: ubuntu1604-power8-test display_name: "Ubuntu 16.04 (POWER8)" run_on: ubuntu1604-power8-test @@ -2009,7 +1999,6 @@ buildvariants: platform: # OSes that support versions of MongoDB>=3.2 with SSL. - ubuntu-16.04 - - rhel71-power8-test auth-ssl: "*" display_name: "${platform} ${auth-ssl}" tasks: @@ -2027,14 +2016,8 @@ buildvariants: # MacOS introduced SSL support with MongoDB >= 3.2. # Older server versions (2.6, 3.0) are supported without SSL. - macos-1014 - auth: "*" - ssl: "*" - exclude_spec: - # No point testing with SSL without auth. - - platform: macos-1014 - auth: "noauth" - ssl: "ssl" - display_name: "${platform} ${auth} ${ssl}" + auth-ssl: "*" + display_name: "${platform} ${auth-ssl}" tasks: - ".latest" - ".4.4" @@ -2046,8 +2029,7 @@ buildvariants: rules: - if: platform: macos-1014 - auth: "*" - ssl: "nossl" + auth-ssl: "noauth-nossl" then: add_tasks: - ".3.0" @@ -2063,60 +2045,25 @@ buildvariants: display_name: "Encryption ${platform} ${auth} ${ssl}" tasks: *encryption-server-versions -- matrix_name: "test-os-requires-34-no-42plus" +# Test one server version (4.0) with zSeries, POWER8, and ARM. +- matrix_name: "test-different-cpu-architectures" matrix_spec: platform: - # OSes that support versions of MongoDB>=3.4 <4.2 with SSL. - - ubuntu1604-power8-test - - ubuntu1604-arm64-small - auth-ssl: "*" - display_name: "${platform} ${auth-ssl}" - tasks: - - ".4.0" - - ".3.6" - - ".3.4" - -- matrix_name: "test-os-requires-34" - matrix_spec: - platform: - # OSes that support versions of MongoDB>=3.4 with SSL. - rhel72-zseries-test - auth-ssl: "*" - display_name: "${platform} ${auth-ssl}" - tasks: - - ".latest" - - ".4.4" - - ".4.2" - - ".4.0" - - ".3.6" - - ".3.4" - -- matrix_name: "test-os-requires-42" - matrix_spec: - platform: - # OSes that support versions of MongoDB>=4.2 with SSL. + - ubuntu1604-power8-test - ubuntu1804-arm64-test auth-ssl: "*" display_name: "${platform} ${auth-ssl}" tasks: - - ".latest" - - ".4.4" - - ".4.2" + - ".4.0" - matrix_name: "tests-python-version-amazon1-test-ssl" matrix_spec: platform: awslinux python-version: &amazon1-pythons ["3.6", "3.7", "3.8", "3.9", "pypy3.6", "pypy3.7"] - auth: "*" - ssl: "*" + auth-ssl: "*" coverage: "*" - exclude_spec: - - platform: awslinux - python-version: "*" - auth: "noauth" - ssl: "ssl" - coverage: "*" - display_name: "${python-version} ${platform} ${auth} ${ssl} ${coverage}" + display_name: "${python-version} ${platform} ${auth-ssl} ${coverage}" tasks: *all-server-versions - matrix_name: "tests-pyopenssl" From 5d11eb9fb106b37f32b19c8fda2b1e407eef9587 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Thu, 22 Apr 2021 17:32:57 -0700 Subject: [PATCH 2/6] Revert macOS auth/ssl change --- .evergreen/config.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index f648683978..74a4da795c 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -2016,8 +2016,14 @@ buildvariants: # MacOS introduced SSL support with MongoDB >= 3.2. # Older server versions (2.6, 3.0) are supported without SSL. - macos-1014 - auth-ssl: "*" - display_name: "${platform} ${auth-ssl}" + auth: "*" + ssl: "*" + exclude_spec: + # No point testing with SSL without auth. + - platform: macos-1014 + auth: "noauth" + ssl: "ssl" + display_name: "${platform} ${auth} ${ssl}" tasks: - ".latest" - ".4.4" @@ -2029,7 +2035,8 @@ buildvariants: rules: - if: platform: macos-1014 - auth-ssl: "noauth-nossl" + auth: "*" + ssl: "nossl" then: add_tasks: - ".3.0" From f67cd1092f9895cff35423a1be6cfdc68a97beb8 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Fri, 23 Apr 2021 14:00:35 -0700 Subject: [PATCH 3/6] PYTHON-2603 Migrate to ubuntu1804 with MongoDB 4.2 --- .evergreen/config.yml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 74a4da795c..0072cb6543 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -1606,12 +1606,6 @@ axes: batchtime: 10080 # 7 days variables: libmongocrypt_url: https://s3.amazonaws.com/mciuploads/libmongocrypt/rhel-70-64-bit/master/latest/libmongocrypt.tar.gz - - id: rhel72-zseries-test - display_name: "RHEL 7.2 (zSeries)" - run_on: rhel72-zseries-test - batchtime: 10080 # 7 days - variables: - libmongocrypt_url: https://s3.amazonaws.com/mciuploads/libmongocrypt/rhel72-zseries-test/master/latest/libmongocrypt.tar.gz - id: ubuntu-16.04 display_name: "Ubuntu 16.04" run_on: ubuntu1604-test @@ -1631,13 +1625,17 @@ axes: batchtime: 10080 # 7 days variables: python3_binary: python3 - - id: ubuntu1604-power8-test - display_name: "Ubuntu 16.04 (POWER8)" - run_on: ubuntu1604-power8-test + - id: ubuntu1804-zseries + display_name: "Ubuntu 18.04 (zSeries)" + run_on: ubuntu1804-zseries-small + batchtime: 10080 # 7 days + - id: ubuntu1804-power8 + display_name: "Ubuntu 18.04 (POWER8)" + run_on: ubuntu1804-power8-small batchtime: 10080 # 7 days - - id: ubuntu1804-arm64-test + - id: ubuntu1804-arm64 display_name: "Ubuntu 18.04 (ARM64)" - run_on: ubuntu1804-arm64-test + run_on: ubuntu1804-arm64-small batchtime: 10080 # 7 days variables: libmongocrypt_url: https://s3.amazonaws.com/mciuploads/libmongocrypt/ubuntu1804-arm64/master/latest/libmongocrypt.tar.gz @@ -2052,17 +2050,17 @@ buildvariants: display_name: "Encryption ${platform} ${auth} ${ssl}" tasks: *encryption-server-versions -# Test one server version (4.0) with zSeries, POWER8, and ARM. +# Test one server version (4.2) with zSeries, POWER8, and ARM. - matrix_name: "test-different-cpu-architectures" matrix_spec: platform: - - rhel72-zseries-test - - ubuntu1604-power8-test - - ubuntu1804-arm64-test + - ubuntu1804-zseries # Ubuntu 18 or RHEL 8.x? + - ubuntu1804-power8 # Ubuntu 18 or RHEL 7? + - ubuntu1804-arm64 auth-ssl: "*" display_name: "${platform} ${auth-ssl}" tasks: - - ".4.0" + - ".4.2" - matrix_name: "tests-python-version-amazon1-test-ssl" matrix_spec: From 54cfaf84f431ade9aeb185a23b446b1ab5633eda Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Fri, 23 Apr 2021 14:45:19 -0700 Subject: [PATCH 4/6] Debug test_use_openssl_when_available --- .evergreen/run-tests.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index 7a78401264..58a0bfd717 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -18,6 +18,11 @@ else set +x fi +set -x +python3 -m pip list +python3 -c 'import pymongo.ssl_context' +python3 -c 'import pymongo.pyopenssl_context' + AUTH=${AUTH:-noauth} SSL=${SSL:-nossl} PYTHON_BINARY=${PYTHON_BINARY:-} From d198651a41445d3285e6074ceedc8a791b742755 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Fri, 23 Apr 2021 15:01:17 -0700 Subject: [PATCH 5/6] Revert "Debug test_use_openssl_when_available" This reverts commit 54cfaf84f431ade9aeb185a23b446b1ab5633eda. --- .evergreen/run-tests.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index 58a0bfd717..7a78401264 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -18,11 +18,6 @@ else set +x fi -set -x -python3 -m pip list -python3 -c 'import pymongo.ssl_context' -python3 -c 'import pymongo.pyopenssl_context' - AUTH=${AUTH:-noauth} SSL=${SSL:-nossl} PYTHON_BINARY=${PYTHON_BINARY:-} From db10aa2b1571890a1c1d4ca65d7f503bc1af8848 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Fri, 23 Apr 2021 15:02:14 -0700 Subject: [PATCH 6/6] PYTHON-2647 Fix test_use_openssl_when_available when service_identity<18.1 is installed --- test/test_ssl.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test_ssl.py b/test/test_ssl.py index 71ea142a27..430f9d576e 100644 --- a/test/test_ssl.py +++ b/test/test_ssl.py @@ -45,6 +45,8 @@ import OpenSSL import requests import service_identity + # Ensure service_identity>=18.1 is installed + from service_identity.pyopenssl import verify_ip_address from pymongo.ocsp_support import _load_trusted_ca_certs _HAVE_PYOPENSSL = True except ImportError: @@ -155,7 +157,7 @@ def test_config_ssl(self): ssl.CERT_REQUIRED) @unittest.skipUnless(_HAVE_PYOPENSSL, "PyOpenSSL is not available.") - def test_use_openssl_when_available(self): + def test_use_pyopenssl_when_available(self): self.assertTrue(_ssl.IS_PYOPENSSL) @unittest.skipUnless(_HAVE_PYOPENSSL, "Cannot test without PyOpenSSL")