| Server IP : 188.114.96.2 / Your IP : 104.23.243.200 Web Server : Apache/2.4.59 (Debian) System : Linux EDL-STRETCH 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64 User : edlftp ( 1002) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /opt/certbot/letsencrypt-auto-source/tests/ |
Upload File : |
#!/bin/bash # Start by making sure your system is up-to-date: yum update -y > /dev/null yum install -y centos-release-scl > /dev/null yum install -y python27 > /dev/null 2> /dev/null LE_AUTO="certbot/letsencrypt-auto-source/letsencrypt-auto" # we're going to modify env variables, so do this in a subshell ( source /opt/rh/python27/enable # ensure python 3 isn't installed python3 --version 2> /dev/null RESULT=$? if [ $RESULT -eq 0 ]; then error "Python3 is already installed." exit 1 fi # ensure python2.7 is available python2.7 --version 2> /dev/null RESULT=$? if [ $RESULT -ne 0 ]; then error "Python3 is not available." exit 1 fi # bootstrap, but don't install python 3. "$LE_AUTO" --no-self-upgrade -n > /dev/null 2> /dev/null # ensure python 3 isn't installed python3 --version 2> /dev/null RESULT=$? if [ $RESULT -eq 0 ]; then error "letsencrypt-auto installed Python3 even though Python2.7 is present." exit 1 fi echo "" echo "PASSED: Did not upgrade to Python3 when Python2.7 is present." ) # ensure python2.7 isn't available python2.7 --version 2> /dev/null RESULT=$? if [ $RESULT -eq 0 ]; then error "Python2.7 is still available." exit 1 fi # Skip self upgrade due to Python 3 not being available. if ! "$LE_AUTO" 2>&1 | grep -q "WARNING: couldn't find Python"; then echo "Python upgrade failure warning not printed!" exit 1 fi # bootstrap, this time installing python3 "$LE_AUTO" --no-self-upgrade -n > /dev/null 2> /dev/null # ensure python 3 is installed python3 --version > /dev/null RESULT=$? if [ $RESULT -ne 0 ]; then error "letsencrypt-auto failed to install Python3 when only Python2.6 is present." exit 1 fi echo "PASSED: Successfully upgraded to Python3 when only Python2.6 is present." echo "" export VENV_PATH=$(mktemp -d) "$LE_AUTO" -n --no-bootstrap --no-self-upgrade --version >/dev/null 2>&1 if [ "$($VENV_PATH/bin/python -V 2>&1 | cut -d" " -f2 | cut -d. -f1)" != 3 ]; then echo "Python 3 wasn't used with --no-bootstrap!" exit 1 fi unset VENV_PATH # test using python3 pytest -v -s certbot/letsencrypt-auto-source/tests