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
diff options
context:
space:
mode:
Diffstat (limited to 'tests/letstest/scripts/test_sdists.sh')
-rwxr-xr-xtests/letstest/scripts/test_sdists.sh40
1 files changed, 33 insertions, 7 deletions
diff --git a/tests/letstest/scripts/test_sdists.sh b/tests/letstest/scripts/test_sdists.sh
index 0b9a91ffd..204f55d55 100755
--- a/tests/letstest/scripts/test_sdists.sh
+++ b/tests/letstest/scripts/test_sdists.sh
@@ -1,20 +1,46 @@
#!/bin/sh -xe
cd letsencrypt
-./certbot-auto --os-packages-only -n --debug
+
+# 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
+ # RHEL/CentOS 6 will need a special treatment, so we need to detect that environment
+ RUN_RHEL6_TESTS=1
+fi
+
+letsencrypt-auto-source/letsencrypt-auto --install-only -n --debug
+
+if [ "$RUN_RHEL6_TESTS" = 1 ]; then
+ # Enable the SCL Python 3.6 installed by letsencrypt-auto bootstrap
+ PATH="/opt/rh/rh-python36/root/usr/bin:$PATH"
+fi
PLUGINS="certbot-apache certbot-nginx"
-PYTHON=$(command -v python2.7 || command -v python27 || command -v python2 || command -v python)
+PYTHON_MAJOR_VERSION=$(/opt/eff.org/certbot/venv/bin/python --version 2>&1 | cut -d" " -f 2 | cut -d. -f1)
TEMP_DIR=$(mktemp -d)
-VERSION=$(letsencrypt-auto-source/version.py)
-export VENV_ARGS="-p $PYTHON"
+
+if [ "$PYTHON_MAJOR_VERSION" = "3" ]; then
+ # Some distros like Fedora may only have an executable named python3 installed.
+ PYTHON_NAME="python3"
+ VENV_PATH="venv3"
+ VENV_SCRIPT="tools/venv3.py"
+else
+ PYTHON_NAME="python"
+ VENV_SCRIPT="tools/venv.py"
+ VENV_PATH="venv"
+fi
+
+VERSION=$("$PYTHON_NAME" letsencrypt-auto-source/version.py)
# setup venv
-tools/_venv_common.py --requirement letsencrypt-auto-source/pieces/dependency-requirements.txt
-. ./venv/bin/activate
+"$VENV_SCRIPT" --requirement letsencrypt-auto-source/pieces/dependency-requirements.txt
+. "$VENV_PATH/bin/activate"
+# pytest is needed to run tests on some of our packages so we install a pinned version here.
+tools/pip_install.py pytest
# build sdists
-for pkg_dir in acme . $PLUGINS; do
+for pkg_dir in acme certbot $PLUGINS; do
cd $pkg_dir
python setup.py clean
rm -rf build dist