1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02: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:
Felix Fontein 2022-12-21 07:31:46 +01:00 committed by GitHub
parent 77fde030cd
commit 1f49241481
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 83 additions and 42 deletions

View file

@ -189,6 +189,24 @@ stages:
- test: 3.5 - test: 3.5
## Remote ## Remote
- stage: Remote_devel_extra_vms
displayName: Remote devel extra VMs
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: devel/{0}
targets:
- name: Alpine 3.16
test: alpine/3.16
# - name: Fedora 36
# test: fedora/36
# - name: Ubuntu 20.04
# test: ubuntu/20.04
- name: Ubuntu 22.04
test: ubuntu/22.04
groups:
- vm
- stage: Remote_devel - stage: Remote_devel
displayName: Remote devel displayName: Remote devel
dependsOn: [] dependsOn: []
@ -203,8 +221,6 @@ stages:
test: rhel/7.9 test: rhel/7.9
- name: RHEL 9.0 - name: RHEL 9.0
test: rhel/9.0 test: rhel/9.0
- name: FreeBSD 12.3
test: freebsd/12.3
- name: FreeBSD 13.1 - name: FreeBSD 13.1
test: freebsd/13.1 test: freebsd/13.1
groups: groups:
@ -221,8 +237,8 @@ stages:
targets: targets:
- name: RHEL 9.0 - name: RHEL 9.0
test: rhel/9.0 test: rhel/9.0
- name: FreeBSD 13.1 - name: FreeBSD 12.3
test: freebsd/13.1 test: freebsd/12.3
groups: groups:
- 1 - 1
- 2 - 2
@ -459,6 +475,7 @@ stages:
- Units_2_12 - Units_2_12
- Units_2_13 - Units_2_13
- Units_2_14 - Units_2_14
- Remote_devel_extra_vms
- Remote_devel - Remote_devel
- Remote_2_11 - Remote_2_11
- Remote_2_12 - Remote_2_12

View file

@ -3,3 +3,4 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
azp/posix/1 azp/posix/1
azp/posix/vm

View file

@ -3,6 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
azp/posix/1 azp/posix/1
azp/posix/vm
destructive destructive
skip/aix skip/aix
skip/osx skip/osx

View file

@ -14,10 +14,14 @@
block: block:
- when: fstype == 'lvm' - when: fstype == 'lvm'
block: block:
- name: 'Show next free loop device'
ansible.builtin.command:
cmd: 'losetup -f'
register: loop_device_cmd
- name: 'Create a loop device for LVM' - name: 'Create a loop device for LVM'
ansible.builtin.command: ansible.builtin.command:
cmd: 'losetup --show -f {{ dev }}' cmd: 'losetup -f {{ dev }}'
register: loop_device_cmd
- name: 'Switch to loop device target for further tasks' - name: 'Switch to loop device target for further tasks'
ansible.builtin.set_fact: ansible.builtin.set_fact:

View file

@ -3,6 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
azp/posix/1 azp/posix/1
azp/posix/vm
destructive destructive
skip/docker # kernel modules not loadable skip/docker # kernel modules not loadable
skip/freebsd # no iptables/netfilter (Linux specific) skip/freebsd # no iptables/netfilter (Linux specific)

View file

@ -167,13 +167,12 @@
- name: "get security, raw and mangle tables states" - name: "get raw and mangle tables states"
iptables_state: iptables_state:
path: "{{ iptables_saved }}" path: "{{ iptables_saved }}"
state: saved state: saved
table: "{{ item }}" table: "{{ item }}"
loop: loop:
- security
- raw - raw
- mangle - mangle
changed_when: false changed_when: false
@ -198,8 +197,6 @@
- "'*nat' in iptables_state.saved" - "'*nat' in iptables_state.saved"
- "'raw' in iptables_state.tables" - "'raw' in iptables_state.tables"
- "'*raw' in iptables_state.saved" - "'*raw' in iptables_state.saved"
- "'security' in iptables_state.tables"
- "'*security' in iptables_state.saved"
quiet: yes quiet: yes
@ -233,17 +230,14 @@
- "'*mangle' in iptables_state.initial_state" - "'*mangle' in iptables_state.initial_state"
- "'*nat' in iptables_state.initial_state" - "'*nat' in iptables_state.initial_state"
- "'*raw' in iptables_state.initial_state" - "'*raw' in iptables_state.initial_state"
- "'*security' in iptables_state.initial_state"
- "'filter' in iptables_state.tables" - "'filter' in iptables_state.tables"
- "'mangle' not in iptables_state.tables" - "'mangle' not in iptables_state.tables"
- "'nat' not in iptables_state.tables" - "'nat' not in iptables_state.tables"
- "'raw' not in iptables_state.tables" - "'raw' not in iptables_state.tables"
- "'security' not in iptables_state.tables"
- "'*filter' in iptables_state.restored" - "'*filter' in iptables_state.restored"
- "'*mangle' not in iptables_state.restored" - "'*mangle' not in iptables_state.restored"
- "'*nat' not in iptables_state.restored" - "'*nat' not in iptables_state.restored"
- "'*raw' not in iptables_state.restored" - "'*raw' not in iptables_state.restored"
- "'*security' not in iptables_state.restored"
- iptables_state is not changed - iptables_state is not changed
quiet: yes quiet: yes
@ -264,17 +258,14 @@
- "'*mangle' in iptables_state.initial_state" - "'*mangle' in iptables_state.initial_state"
- "'*nat' in iptables_state.initial_state" - "'*nat' in iptables_state.initial_state"
- "'*raw' in iptables_state.initial_state" - "'*raw' in iptables_state.initial_state"
- "'*security' in iptables_state.initial_state"
- "'filter' in iptables_state.tables" - "'filter' in iptables_state.tables"
- "'mangle' in iptables_state.tables" - "'mangle' in iptables_state.tables"
- "'nat' in iptables_state.tables" - "'nat' in iptables_state.tables"
- "'raw' in iptables_state.tables" - "'raw' in iptables_state.tables"
- "'security' in iptables_state.tables"
- "'*filter' in iptables_state.restored" - "'*filter' in iptables_state.restored"
- "'*mangle' in iptables_state.restored" - "'*mangle' in iptables_state.restored"
- "'*nat' in iptables_state.restored" - "'*nat' in iptables_state.restored"
- "'*raw' in iptables_state.restored" - "'*raw' in iptables_state.restored"
- "'*security' in iptables_state.restored"
- iptables_state is not changed - iptables_state is not changed
quiet: yes quiet: yes

View file

@ -3,6 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
azp/posix/1 azp/posix/1
azp/posix/vm
destructive destructive
needs/privileged needs/privileged
skip/aix skip/aix

View file

@ -7,12 +7,21 @@
command: "dd if=/dev/zero of={{ remote_tmp_dir }}/img{{ item }} bs=1M count=10" command: "dd if=/dev/zero of={{ remote_tmp_dir }}/img{{ item }} bs=1M count=10"
with_sequence: 'count=2' with_sequence: 'count=2'
- name: "Show next free loop device"
command: "losetup -f"
register: loop_device1
- name: "Create loop device for file" - name: "Create loop device for file"
command: "losetup --show -f {{ remote_tmp_dir }}/img{{ item }}" command: "losetup -f {{ remote_tmp_dir }}/img1"
with_sequence: 'count=2'
register: loop_devices - 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" - name: "Affect name on disk to work on"
set_fact: set_fact:
loop_device1: "{{ loop_devices.results[0] }}" loop_device1: "{{ loop_device1.stdout }}"
loop_device2: "{{ loop_devices.results[1] }}" loop_device2: "{{ loop_device2.stdout }}"

View file

@ -8,15 +8,16 @@
vg: testvg vg: testvg
state: absent state: absent
- name: Detach loop device - name: Detach loop devices
command: "losetup -d {{ item.stdout }}" command: "losetup -d {{ item }}"
loop: "{{ loop_devices.results|default([]) }}" loop:
- "{{ loop_device1 | default('') }}"
- "{{ loop_device2 | default('') }}"
when: when:
- item.stdout is defined - item != ''
- item.stdout is match("/dev/.*")
- name: Remove device files - name: Remove device files
file: file:
path: "{{ remote_tmp_dir }}/img{{ item }}" path: "{{ remote_tmp_dir }}/img{{ item }}"
state: absent state: absent
with_sequence: 'count={{ loop_devices.results|length }}' with_sequence: 'count=2'

View file

@ -6,7 +6,7 @@
- name: "Create volume group on first disk" - name: "Create volume group on first disk"
lvg: lvg:
vg: testvg vg: testvg
pvs: "{{ loop_device1.stdout }}" pvs: "{{ loop_device1 }}"
- name: "get lvm facts" - name: "get lvm facts"
setup: setup:
@ -16,14 +16,14 @@
- name: "Assert the testvg span only on first disk" - name: "Assert the testvg span only on first disk"
assert: assert:
that: that:
- ansible_lvm.pvs[loop_device1.stdout].vg == "testvg" - ansible_lvm.pvs[loop_device1].vg == "testvg"
- 'loop_device2.stdout not in ansible_lvm.pvs or - 'loop_device2 not in ansible_lvm.pvs or
ansible_lvm.pvs[loop_device2.stdout].vg == ""' ansible_lvm.pvs[loop_device2].vg == ""'
- name: "Extend to second disk AND reduce from the first disk" - name: "Extend to second disk AND reduce from the first disk"
lvg: lvg:
vg: testvg vg: testvg
pvs: "{{ loop_device2.stdout }}" pvs: "{{ loop_device2 }}"
- name: "get lvm facts" - name: "get lvm facts"
setup: setup:
@ -33,6 +33,6 @@
- name: "Assert the testvg span only on first disk" - name: "Assert the testvg span only on first disk"
assert: assert:
that: that:
- 'loop_device1.stdout not in ansible_lvm.pvs or - 'loop_device1 not in ansible_lvm.pvs or
ansible_lvm.pvs[loop_device1.stdout].vg == ""' ansible_lvm.pvs[loop_device1].vg == ""'
- ansible_lvm.pvs[loop_device2.stdout].vg == "testvg" - ansible_lvm.pvs[loop_device2].vg == "testvg"

View file

@ -6,12 +6,12 @@
- name: Create volume group on disk device - name: Create volume group on disk device
lvg: lvg:
vg: testvg vg: testvg
pvs: "{{ loop_device1.stdout }}" pvs: "{{ loop_device1 }}"
- name: Create the volume group again to verify idempotence - name: Create the volume group again to verify idempotence
lvg: lvg:
vg: testvg vg: testvg
pvs: "{{ loop_device1.stdout }}" pvs: "{{ loop_device1 }}"
register: repeat_vg_create register: repeat_vg_create
- name: Do all assertions to verify expected results - name: Do all assertions to verify expected results

View file

@ -6,7 +6,7 @@
- name: "Create volume group on first disk" - name: "Create volume group on first disk"
lvg: lvg:
vg: testvg vg: testvg
pvs: "{{ loop_device1.stdout }}" pvs: "{{ loop_device1 }}"
- name: Gets current vg size - name: Gets current vg size
shell: vgs -v testvg -o pv_size --noheading --units b | xargs 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" 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" - 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" - name: "Reruns lvg with pvresize:no"
lvg: lvg:
vg: testvg vg: testvg
pvs: "{{ loop_device1.stdout }}" pvs: "{{ loop_device1 }}"
pvresize: no pvresize: no
register: cmd_result register: cmd_result
@ -46,7 +46,7 @@
- name: "Reruns lvg with pvresize:yes and check_mode:yes" - name: "Reruns lvg with pvresize:yes and check_mode:yes"
lvg: lvg:
vg: testvg vg: testvg
pvs: "{{ loop_device1.stdout }}" pvs: "{{ loop_device1 }}"
pvresize: yes pvresize: yes
check_mode: yes check_mode: yes
register: cmd_result register: cmd_result
@ -68,7 +68,7 @@
- name: "Reruns lvg with pvresize:yes" - name: "Reruns lvg with pvresize:yes"
lvg: lvg:
vg: testvg vg: testvg
pvs: "{{ loop_device1.stdout }}" pvs: "{{ loop_device1 }}"
pvresize: yes pvresize: yes
- name: Gets current vg size - name: Gets current vg size

View file

@ -3,8 +3,12 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
azp/posix/1 azp/posix/1
azp/posix/vm
skip/aix skip/aix
skip/alpine
skip/fedora
skip/freebsd skip/freebsd
skip/osx skip/osx
skip/macos skip/macos
skip/docker skip/docker
skip/ubuntu # FIXME!

View file

@ -3,8 +3,12 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
azp/posix/1 azp/posix/1
azp/posix/vm
skip/aix skip/aix
skip/alpine
skip/fedora
skip/freebsd skip/freebsd
skip/osx skip/osx
skip/macos skip/macos
skip/docker skip/docker
skip/ubuntu # FIXME!

View file

@ -3,6 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
azp/posix/2 azp/posix/2
azp/posix/vm
skip/aix skip/aix
skip/osx skip/osx
skip/macos skip/macos

View file

@ -3,6 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
azp/posix/2 azp/posix/2
azp/posix/vm
skip/aix skip/aix
skip/docker skip/docker
skip/freebsd skip/freebsd

View file

@ -3,9 +3,11 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
azp/posix/1 azp/posix/1
azp/posix/vm
needs/privileged needs/privileged
needs/root needs/root
skip/aix skip/aix
skip/alpine # FIXME
skip/osx skip/osx
skip/macos skip/macos
skip/freebsd skip/freebsd

View file

@ -0,0 +1 @@
remote.sh

View file

@ -0,0 +1 @@
remote.sh

View file

@ -0,0 +1 @@
remote.sh