mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
CI: add extra VMs for certain tests (#5713)
* Remove superfluous VM.
* Add extra VM group.
* More platforms, add scripts.
* [REVERT THIS] Shrink matrix to only the tests we are interested in.
* Fix some tests.
* Skip snap tests on Ubuntu VMs for now.
* Skip xfs_quota tests on Alpine VMs due to ansible.posix.mount failing.
* Revert "[REVERT THIS] Shrink matrix to only the tests we are interested in."
This reverts commit 2e98e163db
.
* Stick to Alpine and Ubuntu 22.04 for now.
This commit is contained in:
parent
77fde030cd
commit
1f49241481
20 changed files with 83 additions and 42 deletions
|
@ -7,12 +7,21 @@
|
|||
command: "dd if=/dev/zero of={{ remote_tmp_dir }}/img{{ item }} bs=1M count=10"
|
||||
with_sequence: 'count=2'
|
||||
|
||||
- name: "Show next free loop device"
|
||||
command: "losetup -f"
|
||||
register: loop_device1
|
||||
|
||||
- name: "Create loop device for file"
|
||||
command: "losetup --show -f {{ remote_tmp_dir }}/img{{ item }}"
|
||||
with_sequence: 'count=2'
|
||||
register: loop_devices
|
||||
command: "losetup -f {{ remote_tmp_dir }}/img1"
|
||||
|
||||
- name: "Show next free loop device"
|
||||
command: "losetup -f"
|
||||
register: loop_device2
|
||||
|
||||
- name: "Create loop device for file"
|
||||
command: "losetup -f {{ remote_tmp_dir }}/img2"
|
||||
|
||||
- name: "Affect name on disk to work on"
|
||||
set_fact:
|
||||
loop_device1: "{{ loop_devices.results[0] }}"
|
||||
loop_device2: "{{ loop_devices.results[1] }}"
|
||||
loop_device1: "{{ loop_device1.stdout }}"
|
||||
loop_device2: "{{ loop_device2.stdout }}"
|
||||
|
|
|
@ -8,15 +8,16 @@
|
|||
vg: testvg
|
||||
state: absent
|
||||
|
||||
- name: Detach loop device
|
||||
command: "losetup -d {{ item.stdout }}"
|
||||
loop: "{{ loop_devices.results|default([]) }}"
|
||||
- name: Detach loop devices
|
||||
command: "losetup -d {{ item }}"
|
||||
loop:
|
||||
- "{{ loop_device1 | default('') }}"
|
||||
- "{{ loop_device2 | default('') }}"
|
||||
when:
|
||||
- item.stdout is defined
|
||||
- item.stdout is match("/dev/.*")
|
||||
- item != ''
|
||||
|
||||
- name: Remove device files
|
||||
file:
|
||||
path: "{{ remote_tmp_dir }}/img{{ item }}"
|
||||
state: absent
|
||||
with_sequence: 'count={{ loop_devices.results|length }}'
|
||||
with_sequence: 'count=2'
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
- name: "Create volume group on first disk"
|
||||
lvg:
|
||||
vg: testvg
|
||||
pvs: "{{ loop_device1.stdout }}"
|
||||
pvs: "{{ loop_device1 }}"
|
||||
|
||||
- name: "get lvm facts"
|
||||
setup:
|
||||
|
@ -16,14 +16,14 @@
|
|||
- name: "Assert the testvg span only on first disk"
|
||||
assert:
|
||||
that:
|
||||
- ansible_lvm.pvs[loop_device1.stdout].vg == "testvg"
|
||||
- 'loop_device2.stdout not in ansible_lvm.pvs or
|
||||
ansible_lvm.pvs[loop_device2.stdout].vg == ""'
|
||||
- ansible_lvm.pvs[loop_device1].vg == "testvg"
|
||||
- 'loop_device2 not in ansible_lvm.pvs or
|
||||
ansible_lvm.pvs[loop_device2].vg == ""'
|
||||
|
||||
- name: "Extend to second disk AND reduce from the first disk"
|
||||
lvg:
|
||||
vg: testvg
|
||||
pvs: "{{ loop_device2.stdout }}"
|
||||
pvs: "{{ loop_device2 }}"
|
||||
|
||||
- name: "get lvm facts"
|
||||
setup:
|
||||
|
@ -33,6 +33,6 @@
|
|||
- name: "Assert the testvg span only on first disk"
|
||||
assert:
|
||||
that:
|
||||
- 'loop_device1.stdout not in ansible_lvm.pvs or
|
||||
ansible_lvm.pvs[loop_device1.stdout].vg == ""'
|
||||
- ansible_lvm.pvs[loop_device2.stdout].vg == "testvg"
|
||||
- 'loop_device1 not in ansible_lvm.pvs or
|
||||
ansible_lvm.pvs[loop_device1].vg == ""'
|
||||
- ansible_lvm.pvs[loop_device2].vg == "testvg"
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
- name: Create volume group on disk device
|
||||
lvg:
|
||||
vg: testvg
|
||||
pvs: "{{ loop_device1.stdout }}"
|
||||
pvs: "{{ loop_device1 }}"
|
||||
|
||||
- name: Create the volume group again to verify idempotence
|
||||
lvg:
|
||||
vg: testvg
|
||||
pvs: "{{ loop_device1.stdout }}"
|
||||
pvs: "{{ loop_device1 }}"
|
||||
register: repeat_vg_create
|
||||
|
||||
- name: Do all assertions to verify expected results
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
- name: "Create volume group on first disk"
|
||||
lvg:
|
||||
vg: testvg
|
||||
pvs: "{{ loop_device1.stdout }}"
|
||||
pvs: "{{ loop_device1 }}"
|
||||
|
||||
- name: Gets current vg size
|
||||
shell: vgs -v testvg -o pv_size --noheading --units b | xargs
|
||||
|
@ -21,12 +21,12 @@
|
|||
command: "dd if=/dev/zero bs=8MiB count=1 of={{ remote_tmp_dir }}/img1 conv=notrunc oflag=append"
|
||||
|
||||
- name: "Reread size of file associated with loop_device1"
|
||||
command: "losetup -c {{ loop_device1.stdout }}"
|
||||
command: "losetup -c {{ loop_device1 }}"
|
||||
|
||||
- name: "Reruns lvg with pvresize:no"
|
||||
lvg:
|
||||
vg: testvg
|
||||
pvs: "{{ loop_device1.stdout }}"
|
||||
pvs: "{{ loop_device1 }}"
|
||||
pvresize: no
|
||||
register: cmd_result
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
|||
- name: "Reruns lvg with pvresize:yes and check_mode:yes"
|
||||
lvg:
|
||||
vg: testvg
|
||||
pvs: "{{ loop_device1.stdout }}"
|
||||
pvs: "{{ loop_device1 }}"
|
||||
pvresize: yes
|
||||
check_mode: yes
|
||||
register: cmd_result
|
||||
|
@ -68,7 +68,7 @@
|
|||
- name: "Reruns lvg with pvresize:yes"
|
||||
lvg:
|
||||
vg: testvg
|
||||
pvs: "{{ loop_device1.stdout }}"
|
||||
pvs: "{{ loop_device1 }}"
|
||||
pvresize: yes
|
||||
|
||||
- name: Gets current vg size
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue