Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/certbot/certbot.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrad Warren <bmw@eff.org>2020-12-02 20:44:27 +0300
committerBrad Warren <bmw@eff.org>2020-12-02 21:22:44 +0300
commite5113d5815a1118d0720e29424cb98ea06957b4d (patch)
treeb3a201c401e9c42eccf832a059b0ec8407e23d27 /tests
parentff3a07dca34350064bf9f8e9fbe93eda7482acc0 (diff)
Undo certbot-auto changes and remove centos6 tests
* Don't deprecate certbot-auto quite yet * Remove centos6 test farm tests * undo changes to test farm test scripts
Diffstat (limited to 'tests')
-rw-r--r--tests/letstest/auto_targets.yaml11
-rwxr-xr-xtests/letstest/scripts/test_leauto_upgrades.sh32
-rwxr-xr-xtests/letstest/scripts/test_letsencrypt_auto_certonly_standalone.sh58
-rw-r--r--tests/letstest/targets.yaml11
4 files changed, 79 insertions, 33 deletions
diff --git a/tests/letstest/auto_targets.yaml b/tests/letstest/auto_targets.yaml
index 76b3a3dc5..9d97c6a83 100644
--- a/tests/letstest/auto_targets.yaml
+++ b/tests/letstest/auto_targets.yaml
@@ -56,17 +56,6 @@ targets:
type: centos
virt: hvm
user: centos
- # centos6 requires EPEL repo added
- - ami: ami-1585c46a
- name: centos6
- type: centos
- virt: hvm
- user: centos
- userdata: |
- #cloud-config
- runcmd:
- - yum install -y epel-release
- - iptables -F
- ami: ami-01ca03df4a6012157
name: centos8
type: centos
diff --git a/tests/letstest/scripts/test_leauto_upgrades.sh b/tests/letstest/scripts/test_leauto_upgrades.sh
index 1eeafad21..51ff640c5 100755
--- a/tests/letstest/scripts/test_leauto_upgrades.sh
+++ b/tests/letstest/scripts/test_leauto_upgrades.sh
@@ -105,10 +105,15 @@ if ./letsencrypt-auto -v --debug --version | grep "WARNING: couldn't find Python
exit 1
fi
-# Since certbot-auto is deprecated, we expect it to leave existing Certbot
-# installations unmodified so we check for the same version that was initially
-# installed below.
-EXPECTED_VERSION="$INITIAL_VERSION"
+# On systems like Debian where certbot-auto is deprecated, we expect it to
+# leave existing Certbot installations unmodified so we check for the same
+# version that was initially installed below. Once certbot-auto is deprecated
+# on RHEL systems, we can unconditionally check for INITIAL_VERSION.
+if [ -f /etc/debian_version ]; then
+ EXPECTED_VERSION="$INITIAL_VERSION"
+else
+ EXPECTED_VERSION=$(grep -m1 LE_AUTO_VERSION certbot-auto | cut -d\" -f2)
+fi
if ! /opt/eff.org/certbot/venv/bin/letsencrypt --version 2>&1 | tail -n1 | grep "^certbot $EXPECTED_VERSION$" ; then
echo unexpected certbot version found
@@ -119,3 +124,22 @@ if ! diff letsencrypt-auto letsencrypt-auto-source/letsencrypt-auto ; then
echo letsencrypt-auto and letsencrypt-auto-source/letsencrypt-auto differ
exit 1
fi
+
+if [ "$RUN_RHEL6_TESTS" = 1 ]; then
+ # Add the SCL python release to PATH in order to resolve python3 command
+ PATH="/opt/rh/rh-python36/root/usr/bin:$PATH"
+ if ! command -v python3; then
+ echo "Python3 wasn't properly installed"
+ exit 1
+ fi
+ if [ "$(/opt/eff.org/certbot/venv/bin/python -V 2>&1 | cut -d" " -f 2 | cut -d. -f1)" != 3 ]; then
+ echo "Python3 wasn't used in venv!"
+ exit 1
+ fi
+
+ if [ "$("$PYTHON_NAME" tools/readlink.py $OLD_VENV_PATH)" != "/opt/eff.org/certbot/venv" ]; then
+ echo symlink from old venv path not properly created!
+ exit 1
+ fi
+fi
+echo upgrade appeared to be successful
diff --git a/tests/letstest/scripts/test_letsencrypt_auto_certonly_standalone.sh b/tests/letstest/scripts/test_letsencrypt_auto_certonly_standalone.sh
index fc5435916..15cf9ee1b 100755
--- a/tests/letstest/scripts/test_letsencrypt_auto_certonly_standalone.sh
+++ b/tests/letstest/scripts/test_letsencrypt_auto_certonly_standalone.sh
@@ -16,14 +16,58 @@ sudo chown root "$LE_AUTO_PATH"
sudo chmod 0755 "$LE_AUTO_PATH"
export PATH="$LE_AUTO_DIR:$PATH"
-# Since certbot-auto is deprecated, we expect certbot-auto to error and
-# refuse to install Certbot.
-set +o pipefail
-if ! letsencrypt-auto --debug --version | grep "Certbot cannot be installed."; then
- echo "letsencrypt-auto didn't report being uninstallable."
+# On systems like Debian where certbot-auto is deprecated, we expect
+# certbot-auto to error and refuse to install Certbot. Once certbot-auto is
+# deprecated on RHEL systems, we can unconditionally run this code.
+if [ -f /etc/debian_version ]; then
+ set +o pipefail
+ if ! letsencrypt-auto --debug --version | grep "Certbot cannot be installed."; then
+ echo "letsencrypt-auto didn't report being uninstallable."
+ exit 1
+ fi
+ if [ ${PIPESTATUS[0]} != 1 ]; then
+ echo "letsencrypt-auto didn't exit with status 1 as expected"
+ exit 1
+ fi
+ # letsencrypt-auto is deprecated and cannot be installed on this system so
+ # we cannot run the rest of this test.
+ exit 0
+fi
+
+letsencrypt-auto --os-packages-only --debug --version
+
+# This script sets the environment variables PYTHON_NAME, VENV_PATH, and
+# VENV_SCRIPT based on the version of Python available on the system. For
+# instance, Fedora uses Python 3 and Python 2 is not installed.
+. tests/letstest/scripts/set_python_envvars.sh
+
+# Create a venv-like layout at the old virtual environment path to test that a
+# symlink is properly created when letsencrypt-auto runs.
+HOME=${HOME:-~root}
+XDG_DATA_HOME=${XDG_DATA_HOME:-~/.local/share}
+OLD_VENV_BIN="$XDG_DATA_HOME/letsencrypt/bin"
+mkdir -p "$OLD_VENV_BIN"
+touch "$OLD_VENV_BIN/letsencrypt"
+
+letsencrypt-auto certonly --no-self-upgrade -v --standalone --debug \
+ --text --agree-tos \
+ --renew-by-default --redirect \
+ --register-unsafely-without-email \
+ --domain $PUBLIC_HOSTNAME --server $BOULDER_URL
+
+LINK_PATH=$("$PYTHON_NAME" tools/readlink.py ${XDG_DATA_HOME:-~/.local/share}/letsencrypt)
+if [ "$LINK_PATH" != "/opt/eff.org/certbot/venv" ]; then
+ echo symlink from old venv path not properly created!
exit 1
fi
-if [ ${PIPESTATUS[0]} != 1 ]; then
- echo "letsencrypt-auto didn't exit with status 1 as expected"
+
+if ! letsencrypt-auto --help --no-self-upgrade | grep -F "letsencrypt-auto [SUBCOMMAND]"; then
+ echo "letsencrypt-auto not included in help output!"
+ exit 1
+fi
+
+OUTPUT_LEN=$(letsencrypt-auto --install-only --no-self-upgrade --quiet 2>&1 | wc -c)
+if [ "$OUTPUT_LEN" != 0 ]; then
+ echo letsencrypt-auto produced unexpected output!
exit 1
fi
diff --git a/tests/letstest/targets.yaml b/tests/letstest/targets.yaml
index 29edd1552..97c775f6c 100644
--- a/tests/letstest/targets.yaml
+++ b/tests/letstest/targets.yaml
@@ -52,17 +52,6 @@ targets:
type: centos
virt: hvm
user: centos
- # centos6 requires EPEL repo added
- - ami: ami-1585c46a
- name: centos6
- type: centos
- virt: hvm
- user: centos
- userdata: |
- #cloud-config
- runcmd:
- - yum install -y epel-release
- - iptables -F
- ami: ami-01ca03df4a6012157
name: centos8
type: centos