From a754a90940f95059a7e754bb97ae86d95a9886b1 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Mon, 6 May 2019 16:50:03 -0700 Subject: [PATCH] Fix test_leauto_upgrades.sh on CentOS 6. (#7037) --- tests/letstest/scripts/test_leauto_upgrades.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/letstest/scripts/test_leauto_upgrades.sh b/tests/letstest/scripts/test_leauto_upgrades.sh index d5133ba38..8cc1748ed 100755 --- a/tests/letstest/scripts/test_leauto_upgrades.sh +++ b/tests/letstest/scripts/test_leauto_upgrades.sh @@ -15,8 +15,17 @@ if ! command -v git ; then exit 1 fi fi -# 0.33.x is the oldest version of letsencrypt-auto that works on Fedora 29+. -INITIAL_VERSION="0.33.1" +# If we're on a RHEL 6 based system, we can be confident Python is already +# installed because the package manager is written in Python. +if command -v python && [ $(python -V 2>&1 | cut -d" " -f 2 | cut -d. -f1,2 | sed 's/\.//') -eq 26 ]; then + # 0.20.0 is the latest version of letsencrypt-auto that doesn't install + # Python 3 on RHEL 6. + INITIAL_VERSION="0.20.0" + RUN_PYTHON3_TESTS=1 +else + # 0.33.x is the oldest version of letsencrypt-auto that works on Fedora 29+. + INITIAL_VERSION="0.33.1" +fi git checkout -f "v$INITIAL_VERSION" letsencrypt-auto if ! ./letsencrypt-auto -v --debug --version --no-self-upgrade 2>&1 | tail -n1 | grep "^certbot $INITIAL_VERSION$" ; then echo initial installation appeared to fail @@ -63,8 +72,7 @@ iQIDAQAB -----END PUBLIC KEY----- " -if [ $(python -V 2>&1 | cut -d" " -f 2 | cut -d. -f1,2 | sed 's/\.//') -eq 26 ]; then - RUN_PYTHON3_TESTS=1 +if [ "$RUN_PYTHON3_TESTS" = 1 ]; then if command -v python3; then echo "Didn't expect Python 3 to be installed!" exit 1