mirror of
https://github.com/containers/ansible-podman-collections.git
synced 2026-02-04 07:11:49 +00:00
Fix yaml python dep in root tests (#96)
Use different python interpretators for root and rootless tests, as it's a problem in Ubuntu 18.
This commit is contained in:
parent
a38df046a4
commit
69b034b263
23 changed files with 102 additions and 29 deletions
8
.github/workflows/podman_container.yml
vendored
8
.github/workflows/podman_container.yml
vendored
|
|
@ -5,7 +5,8 @@ on:
|
|||
paths:
|
||||
- '.github/workflows/podman_container.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_container.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_container.yml'
|
||||
- 'plugins/modules/podman_container.py'
|
||||
- 'plugins/modules/podman_container_info.py'
|
||||
- 'tests/integration/targets/podman_container/**'
|
||||
|
|
@ -15,7 +16,8 @@ on:
|
|||
paths:
|
||||
- '.github/workflows/podman_container.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_container.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_container.yml'
|
||||
- 'plugins/modules/podman_container.py'
|
||||
- 'plugins/modules/podman_container_info.py'
|
||||
- 'tests/integration/targets/podman_container/**'
|
||||
|
|
@ -56,6 +58,8 @@ jobs:
|
|||
|
||||
- name: Upgrade pip and display Python and PIP versions
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python*-wheel python*-yaml
|
||||
python -m pip install --upgrade pip
|
||||
python -V
|
||||
pip --version
|
||||
|
|
|
|||
32
.github/workflows/podman_container_idem.yml
vendored
32
.github/workflows/podman_container_idem.yml
vendored
|
|
@ -3,22 +3,22 @@ name: Idempotency
|
|||
on:
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/podman_container.yml'
|
||||
- '.github/workflows/podman_container_idem.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_container.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_container_idempotency.yml'
|
||||
- 'plugins/modules/podman_container.py'
|
||||
- 'plugins/modules/podman_container_info.py'
|
||||
- 'tests/integration/targets/podman_container/**'
|
||||
- 'tests/integration/targets/podman_container_idempotency/**'
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/podman_container.yml'
|
||||
- '.github/workflows/podman_container_idem.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_container.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_container_idempotency.yml'
|
||||
- 'plugins/modules/podman_container.py'
|
||||
- 'plugins/modules/podman_container_info.py'
|
||||
- 'tests/integration/targets/podman_container/**'
|
||||
- 'tests/integration/targets/podman_container_idempotency/**'
|
||||
schedule:
|
||||
- cron: 4 0 * * * # Run daily at 0:03 UTC
|
||||
|
||||
|
|
@ -56,6 +56,8 @@ jobs:
|
|||
|
||||
- name: Upgrade pip and display Python and PIP versions
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python*-wheel python*-yaml
|
||||
python -m pip install --upgrade pip
|
||||
python -V
|
||||
pip --version
|
||||
|
|
@ -70,7 +72,8 @@ jobs:
|
|||
${{ runner.os }}-
|
||||
|
||||
- name: Install Ansible ${{ matrix.ansible-version }}
|
||||
run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}'
|
||||
run: |
|
||||
python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}'
|
||||
|
||||
- name: Build and install the collection tarball
|
||||
run: |
|
||||
|
|
@ -78,7 +81,7 @@ jobs:
|
|||
~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force
|
||||
~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz
|
||||
|
||||
- name: Run idempotency tests for podman container
|
||||
- name: Run preparing tests for podman container
|
||||
run: |
|
||||
export PATH=~/.local/bin:$PATH
|
||||
|
||||
|
|
@ -103,6 +106,15 @@ jobs:
|
|||
-i localhost, \
|
||||
-e ansible_connection=local \
|
||||
-e setup_python=false
|
||||
shell: bash
|
||||
|
||||
- name: Run idempotency tests for podman container
|
||||
run: |
|
||||
export PATH=~/.local/bin:$PATH
|
||||
if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then
|
||||
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg
|
||||
elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
|
||||
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg
|
||||
fi
|
||||
TEST2RUN=podman_container_idempotency ./ci/run_containers_tests.sh
|
||||
shell: bash
|
||||
|
|
|
|||
8
.github/workflows/podman_container_info.yml
vendored
8
.github/workflows/podman_container_info.yml
vendored
|
|
@ -5,7 +5,8 @@ on:
|
|||
paths:
|
||||
- '.github/workflows/podman_container_info.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_container_info.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_container_info.yml'
|
||||
- 'plugins/modules/podman_container.py'
|
||||
- 'plugins/modules/podman_container_info.py'
|
||||
- 'tests/integration/targets/podman_container_info/**'
|
||||
|
|
@ -15,7 +16,8 @@ on:
|
|||
paths:
|
||||
- '.github/workflows/podman_container_info.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_container_info.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_container_info.yml'
|
||||
- 'plugins/modules/podman_container.py'
|
||||
- 'plugins/modules/podman_container_info.py'
|
||||
- 'tests/integration/targets/podman_container_info/**'
|
||||
|
|
@ -56,6 +58,8 @@ jobs:
|
|||
|
||||
- name: Upgrade pip and display Python and PIP versions
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python*-wheel python*-yaml
|
||||
python -m pip install --upgrade pip
|
||||
python -V
|
||||
pip --version
|
||||
|
|
|
|||
8
.github/workflows/podman_image.yml
vendored
8
.github/workflows/podman_image.yml
vendored
|
|
@ -5,7 +5,8 @@ on:
|
|||
paths:
|
||||
- '.github/workflows/podman_image.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_image.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_image.yml'
|
||||
- 'plugins/modules/podman_image.py'
|
||||
- 'plugins/modules/podman_image_info.py'
|
||||
- 'tests/integration/targets/podman_image/**'
|
||||
|
|
@ -15,7 +16,8 @@ on:
|
|||
paths:
|
||||
- '.github/workflows/podman_image.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_image.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_image.yml'
|
||||
- 'plugins/modules/podman_image.py'
|
||||
- 'plugins/modules/podman_image_info.py'
|
||||
- 'tests/integration/targets/podman_image/**'
|
||||
|
|
@ -56,6 +58,8 @@ jobs:
|
|||
|
||||
- name: Upgrade pip and display Python and PIP versions
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python*-wheel python*-yaml
|
||||
python -m pip install --upgrade pip
|
||||
python -V
|
||||
pip --version
|
||||
|
|
|
|||
8
.github/workflows/podman_image_info.yml
vendored
8
.github/workflows/podman_image_info.yml
vendored
|
|
@ -5,7 +5,8 @@ on:
|
|||
paths:
|
||||
- '.github/workflows/podman_image_info.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_image_info.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_image_info.yml'
|
||||
- 'plugins/modules/podman_image.py'
|
||||
- 'plugins/modules/podman_image_info.py'
|
||||
- 'tests/integration/targets/podman_image_info/**'
|
||||
|
|
@ -15,7 +16,8 @@ on:
|
|||
paths:
|
||||
- '.github/workflows/podman_image_info.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_image_info.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_image_info.yml'
|
||||
- 'plugins/modules/podman_image.py'
|
||||
- 'plugins/modules/podman_image_info.py'
|
||||
- 'tests/integration/targets/podman_image_info/**'
|
||||
|
|
@ -56,6 +58,8 @@ jobs:
|
|||
|
||||
- name: Upgrade pip and display Python and PIP versions
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python*-wheel python*-yaml
|
||||
python -m pip install --upgrade pip
|
||||
python -V
|
||||
pip --version
|
||||
|
|
|
|||
8
.github/workflows/podman_network_info.yml
vendored
8
.github/workflows/podman_network_info.yml
vendored
|
|
@ -5,7 +5,8 @@ on:
|
|||
paths:
|
||||
- '.github/workflows/podman_network_info.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_network_info.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_network_info.yml'
|
||||
- 'plugins/modules/podman_network_info.py'
|
||||
- 'tests/integration/targets/podman_network_info/**'
|
||||
branches:
|
||||
|
|
@ -14,7 +15,8 @@ on:
|
|||
paths:
|
||||
- '.github/workflows/podman_network_info.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_network_info.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_network_info.yml'
|
||||
- 'plugins/modules/podman_network_info.py'
|
||||
- 'tests/integration/targets/podman_network_info/**'
|
||||
schedule:
|
||||
|
|
@ -54,6 +56,8 @@ jobs:
|
|||
|
||||
- name: Upgrade pip and display Python and PIP versions
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python*-wheel python*-yaml
|
||||
python -m pip install --upgrade pip
|
||||
python -V
|
||||
pip --version
|
||||
|
|
|
|||
8
.github/workflows/podman_pod.yml
vendored
8
.github/workflows/podman_pod.yml
vendored
|
|
@ -5,7 +5,8 @@ on:
|
|||
paths:
|
||||
- '.github/workflows/podman_pod.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_pod.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_pod.yml'
|
||||
- 'plugins/modules/podman_pod.py'
|
||||
- 'plugins/modules/podman_pod_info.py'
|
||||
- 'tests/integration/targets/podman_pod/**'
|
||||
|
|
@ -15,7 +16,8 @@ on:
|
|||
paths:
|
||||
- '.github/workflows/podman_pod.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_pod.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_pod.yml'
|
||||
- 'plugins/modules/podman_pod.py'
|
||||
- 'plugins/modules/podman_pod_info.py'
|
||||
- 'tests/integration/targets/podman_pod/**'
|
||||
|
|
@ -56,6 +58,8 @@ jobs:
|
|||
|
||||
- name: Upgrade pip and display Python and PIP versions
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python*-wheel python*-yaml
|
||||
python -m pip install --upgrade pip
|
||||
python -V
|
||||
pip --version
|
||||
|
|
|
|||
8
.github/workflows/podman_pod_info.yml
vendored
8
.github/workflows/podman_pod_info.yml
vendored
|
|
@ -5,7 +5,8 @@ on:
|
|||
paths:
|
||||
- '.github/workflows/podman_pod_info.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_pod_info.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_pod_info.yml'
|
||||
- 'plugins/modules/podman_pod.py'
|
||||
- 'plugins/modules/podman_pod_info.py'
|
||||
- 'tests/integration/targets/podman_pod_info/**'
|
||||
|
|
@ -15,7 +16,8 @@ on:
|
|||
paths:
|
||||
- '.github/workflows/podman_pod_info.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_pod_info.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_pod_info.yml'
|
||||
- 'plugins/modules/podman_pod.py'
|
||||
- 'plugins/modules/podman_pod_info.py'
|
||||
- 'tests/integration/targets/podman_pod_info/**'
|
||||
|
|
@ -56,6 +58,8 @@ jobs:
|
|||
|
||||
- name: Upgrade pip and display Python and PIP versions
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python*-wheel python*-yaml
|
||||
python -m pip install --upgrade pip
|
||||
python -V
|
||||
pip --version
|
||||
|
|
|
|||
8
.github/workflows/podman_volume.yml
vendored
8
.github/workflows/podman_volume.yml
vendored
|
|
@ -5,7 +5,8 @@ on:
|
|||
paths:
|
||||
- '.github/workflows/podman_volume.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_volume.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_volume.yml'
|
||||
- 'plugins/modules/podman_volume.py'
|
||||
- 'tests/integration/targets/podman_volume/**'
|
||||
branches:
|
||||
|
|
@ -14,7 +15,8 @@ on:
|
|||
paths:
|
||||
- '.github/workflows/podman_volume.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_volume.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_volume.yml'
|
||||
- 'plugins/modules/podman_volume.py'
|
||||
- 'tests/integration/targets/podman_volume/**'
|
||||
schedule:
|
||||
|
|
@ -54,6 +56,8 @@ jobs:
|
|||
|
||||
- name: Upgrade pip and display Python and PIP versions
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python*-wheel python*-yaml
|
||||
python -m pip install --upgrade pip
|
||||
python -V
|
||||
pip --version
|
||||
|
|
|
|||
8
.github/workflows/podman_volume_info.yml
vendored
8
.github/workflows/podman_volume_info.yml
vendored
|
|
@ -5,7 +5,8 @@ on:
|
|||
paths:
|
||||
- '.github/workflows/podman_volume_info.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_volume_info.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_volume_info.yml'
|
||||
- 'plugins/modules/podman_volume_info.py'
|
||||
- 'plugins/modules/podman_volume.py'
|
||||
- 'tests/integration/targets/podman_volume_info/**'
|
||||
|
|
@ -15,7 +16,8 @@ on:
|
|||
paths:
|
||||
- '.github/workflows/podman_volume_info.yml'
|
||||
- 'ci/*.yml'
|
||||
- 'ci/containers/podman_volume_info.yml'
|
||||
- 'ci/run_containers_tests.sh'
|
||||
- 'ci/playbooks/containers/podman_volume_info.yml'
|
||||
- 'plugins/modules/podman_volume_info.py'
|
||||
- 'plugins/modules/podman_volume.py'
|
||||
- 'tests/integration/targets/podman_volume_info/**'
|
||||
|
|
@ -56,6 +58,8 @@ jobs:
|
|||
|
||||
- name: Upgrade pip and display Python and PIP versions
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python*-wheel python*-yaml
|
||||
python -m pip install --upgrade pip
|
||||
python -V
|
||||
pip --version
|
||||
|
|
|
|||
|
|
@ -6,3 +6,4 @@
|
|||
name: podman_container
|
||||
vars:
|
||||
idem_image: idempotency_test
|
||||
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"
|
||||
|
|
|
|||
|
|
@ -6,3 +6,4 @@
|
|||
name: podman_container_idempotency
|
||||
vars:
|
||||
idem_image: idempotency_test
|
||||
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"
|
||||
|
|
|
|||
|
|
@ -4,3 +4,5 @@
|
|||
tasks:
|
||||
- include_role:
|
||||
name: podman_container_info
|
||||
vars:
|
||||
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"
|
||||
|
|
|
|||
|
|
@ -4,3 +4,5 @@
|
|||
tasks:
|
||||
- include_role:
|
||||
name: podman_image
|
||||
vars:
|
||||
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"
|
||||
|
|
|
|||
|
|
@ -4,3 +4,5 @@
|
|||
tasks:
|
||||
- include_role:
|
||||
name: podman_image_info
|
||||
vars:
|
||||
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"
|
||||
|
|
|
|||
|
|
@ -4,3 +4,5 @@
|
|||
tasks:
|
||||
- include_role:
|
||||
name: podman_network_info
|
||||
vars:
|
||||
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"
|
||||
|
|
|
|||
|
|
@ -6,3 +6,4 @@
|
|||
name: podman_pod
|
||||
vars:
|
||||
idem_image: idempotency_test
|
||||
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"
|
||||
|
|
|
|||
|
|
@ -4,3 +4,5 @@
|
|||
tasks:
|
||||
- include_role:
|
||||
name: podman_pod_info
|
||||
vars:
|
||||
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"
|
||||
|
|
|
|||
|
|
@ -4,3 +4,5 @@
|
|||
tasks:
|
||||
- include_role:
|
||||
name: podman_volume
|
||||
vars:
|
||||
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"
|
||||
|
|
|
|||
|
|
@ -4,3 +4,5 @@
|
|||
tasks:
|
||||
- include_role:
|
||||
name: podman_volume_info
|
||||
vars:
|
||||
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ CMD="ANSIBLE_ROLES_PATH=${CURWD}/../tests/integration/targets \
|
|||
${ANSIBLECMD:-ansible-playbook} \
|
||||
-i localhost, -c local --diff \
|
||||
ci/playbooks/containers/${TEST2RUN}.yml \
|
||||
-e ansible_python_interpreter=$(command -v python)"
|
||||
-e _ansible_python_interpreter=$(command -v python)"
|
||||
|
||||
bash -c "$CMD -vv" || exit_code=$?
|
||||
if [[ "$exit_code" != 0 ]]; then
|
||||
|
|
|
|||
|
|
@ -28,12 +28,16 @@
|
|||
|
||||
- name: Test idempotency for root containers
|
||||
include_tasks: root-podman.yml
|
||||
vars:
|
||||
ansible_python_interpreter: "/usr/bin/python"
|
||||
args:
|
||||
apply:
|
||||
become: true
|
||||
|
||||
- name: Test idempotency for root network containers
|
||||
include_tasks: root-podman-network.yml
|
||||
vars:
|
||||
ansible_python_interpreter: "/usr/bin/python"
|
||||
args:
|
||||
apply:
|
||||
become: true
|
||||
|
|
|
|||
|
|
@ -598,12 +598,16 @@
|
|||
|
||||
- name: Test idempotency for root pods
|
||||
include_tasks: root-pod.yml
|
||||
vars:
|
||||
ansible_python_interpreter: "/usr/bin/python"
|
||||
args:
|
||||
apply:
|
||||
become: true
|
||||
|
||||
- name: Test idempotency for root pods and networks
|
||||
include_tasks: net-pod.yml
|
||||
vars:
|
||||
ansible_python_interpreter: "/usr/bin/python"
|
||||
args:
|
||||
apply:
|
||||
become: true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue