1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-02-04 07:11:49 +00:00
ansible-podman-collections/tests/integration/targets/podman_pod/tasks/resource-limit.yml
Sergey b987120fa0
Add new options to pod module (#745)
Fix #742

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-16 14:50:47 +03:00

43 lines
1.3 KiB
YAML

- name: Test podman_pod for limiting resources
block:
- name: Set variables for limiting resources
set_fact:
limit:
blkio_weight: 123
cpuset_mems: '0-1'
cpu_shares: 1024
device_write_bps: ['/dev/zero:1048576']
shm_size: 1G
- name: Create pod for limiting resources
containers.podman.podman_pod:
executable: "{{ test_executable | default('podman') }}"
name: limited-pod
state: created
blkio_weight: "{{ limit.blkio_weight }}"
cpuset_mems: "{{ limit.cpuset_mems }}"
cpu_shares: "{{ limit.cpu_shares }}"
device_write_bps: "{{ limit.device_write_bps }}"
shm_size: "{{ limit.shm_size }}"
- name: Get information on pod for limiting resources
containers.podman.podman_pod_info:
executable: "{{ test_executable | default('podman') }}"
name: limited-pod
register: pod_info
- name: Check if the result is as expected
assert:
that:
- item.blkio_weight == limit.blkio_weight
- item.cpuset_mems == limit.cpuset_mems
- item.cpu_shares == limit.cpu_shares
with_items: "{{ pod_info.pods }}"
always:
- name: Cleanup
containers.podman.podman_pod:
executable: "{{ test_executable | default('podman') }}"
name: limited-pod
state: absent