summaryrefslogtreecommitdiffstats
path: root/test/lib
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2021-01-08 01:29:31 +0100
committerMatt Clay <matt@mystile.com>2021-01-08 05:12:39 +0100
commit05ba49cbba9909086d88afd56f71b9f6abb334f9 (patch)
treeff68fc148e75dbc7c9f43066bcc722137e826aba /test/lib
parentFix example with the backwards counting in the sequence lookup plugin. (#73081) (diff)
downloadansible-05ba49cbba9909086d88afd56f71b9f6abb334f9.tar.xz
ansible-05ba49cbba9909086d88afd56f71b9f6abb334f9.zip
ansible-test - No virtualenv install on Python 3
Tests should use the Python built-in ``venv`` module on Python 3 instead of the standalone ``virtualenv`` module. On Python 2 the ``virtualenv`` module continues to be the only option. The version installed is either the OS packaged version or the last release to support Python 2, which is version 16.7.10.
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/ansible_test/_data/setup/remote.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/lib/ansible_test/_data/setup/remote.sh b/test/lib/ansible_test/_data/setup/remote.sh
index 93dead5d7e..a08b349229 100644
--- a/test/lib/ansible_test/_data/setup/remote.sh
+++ b/test/lib/ansible_test/_data/setup/remote.sh
@@ -19,6 +19,14 @@ install_pip () {
if [ "${platform}" = "freebsd" ]; then
py_version="$(echo "${python_version}" | tr -d '.')"
+ if [ "${py_version}" = "27" ]; then
+ # on Python 2.7 our only option is to use virtualenv
+ virtualenv_pkg="py27-virtualenv"
+ else
+ # on Python 3.x we'll use the built-in venv instead
+ virtualenv_pkg=""
+ fi
+
while true; do
env ASSUME_ALWAYS_YES=YES pkg bootstrap && \
pkg install -q -y \
@@ -27,8 +35,8 @@ if [ "${platform}" = "freebsd" ]; then
gtar \
"python${py_version}" \
"py${py_version}-Jinja2" \
- "py${py_version}-virtualenv" \
"py${py_version}-cryptography" \
+ ${virtualenv_pkg} \
sudo \
&& break
echo "Failed to install packages. Sleeping before trying again..."
@@ -49,7 +57,6 @@ elif [ "${platform}" = "rhel" ]; then
gcc \
python3-devel \
python3-jinja2 \
- python3-virtualenv \
python3-cryptography \
iptables \
&& break
@@ -109,7 +116,8 @@ elif [ "${platform}" = "aix" ]; then
python-jinja2 \
python-cryptography \
python-pip && \
- pip install --disable-pip-version-check --quiet virtualenv \
+ pip install --disable-pip-version-check --quiet \
+ 'virtualenv==16.7.10' \
&& break
echo "Failed to install packages. Sleeping before trying again..."
sleep 10