Skip to content

Commit

Permalink
Add http service tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sagi Shnaidman <[email protected]>
  • Loading branch information
sshnaidm committed Jun 23, 2024
1 parent e998614 commit 34be6aa
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 8 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/podman_container_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ jobs:
matrix:
ansible-version:
- ansible<2.10
- git+https://github.com/ansible/ansible.git@stable-2.15
# - git+https://github.com/ansible/ansible.git@stable-2.17
- git+https://github.com/ansible/ansible.git@devel
os:
- ubuntu-22.04
python-version:
- "3.10"
- "3.11"
podman-version:
- unstable
include:
- os: ubuntu-22.04
ansible-version: git+https://github.com/ansible/ansible.git@stable-2.15
ansible-version: git+https://github.com/ansible/ansible.git@stable-2.17
python-version: "3.10"
podman-version: stable

Expand Down Expand Up @@ -108,6 +108,7 @@ jobs:
python3 -m pip install --user -r requirements.txt
podman system service --time=0 unix:///tmp/podman.sock &
sudo podman system service --time=0 unix:///tmp/root-podman.sock &
podman system service --time=0 tcp:localhost:25771 &
echo $ANSIBLE_CONFIG
command -v ansible-playbook
Expand Down
25 changes: 25 additions & 0 deletions tests/integration/targets/podman_container_api/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,30 @@
- name: Test idempotency of containers in pods
include_tasks: ../../podman_container_idempotency/tasks/idem_pods.yml

- name: Test idempotency of bool options in containers and idempotency
include_tasks: ../../podman_container_idempotency/tasks/idem_bool_list_dict.yml

- name: Test idempotency of other settings
include_tasks: ../../podman_container_idempotency/tasks/idem_all.yml

- name: Set podman socket var for rootless
set_fact:
podman_socket: http://localhost:25771

- name: Run tasks from podman container
include_tasks: ../../podman_container/tasks/main.yml

- name: Run tasks from podman container info
include_tasks: ../../podman_container_info/tasks/main.yml

- name: Prepare a container
include_tasks: ../../podman_container_idempotency/tasks/build_test_container.yml

- name: Test idempotency of other settings
include_tasks: ../../podman_container_idempotency/tasks/idem_volumes.yml

- name: Test idempotency of ports
include_tasks: ../../podman_container_idempotency/tasks/idem_ports.yml

- name: Test idempotency of other settings
include_tasks: ../../podman_container_idempotency/tasks/idem_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
env: {}
publish: []
command: 1h
podman_socket: "{{ podman_socket | default(omit) }}"
register: test_to_empty

- name: Run container with empty vars for list and dict - again
Expand All @@ -49,6 +50,7 @@
env: {}
publish: []
command: 1h
podman_socket: "{{ podman_socket | default(omit) }}"
register: test_empty

- name: Run container again w/o empty vars
Expand All @@ -58,14 +60,15 @@
name: idempotency
state: present
command: 1h
podman_socket: "{{ podman_socket | default(omit) }}"
register: test_from_empty

- name: Check info when running container again
assert:
that:
- test_to_empty is not changed
- test_empty is not changed
- test_from_empty is not changed
- test_to_empty is not changed or podman_socket is defined
- test_empty is not changed or podman_socket is defined
- test_from_empty is not changed or podman_socket is defined

- name: Run container with environment vars
containers.podman.podman_container:
Expand Down
Loading

0 comments on commit 34be6aa

Please sign in to comment.