Skip to content

Commit fdc37f3

Browse files
committed
edpm_multipathd: Update molecule tests
Updates to the edpm_multipathd molecule tests include: - Moving the job to zuul. - Revisions for the new host-based multipathd deployment. - A new scenario to facilitate local development of molecule tests using vagrant.
1 parent fdf739b commit fdc37f3

File tree

17 files changed

+138
-145
lines changed

17 files changed

+138
-145
lines changed

.github/workflows/molecule.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ jobs:
2929
- edpm_derive_pci_device_spec
3030
- edpm_download_cache
3131
- edpm_growvols
32-
- edpm_multipathd
3332
- edpm_network_config
3433
- edpm_neutron_dhcp
3534
- edpm_neutron_metadata
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../default/collections.yml

roles/edpm_multipathd/molecule/custom_config/molecule.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../default/molecule.yml

roles/edpm_multipathd/molecule/custom_config/prepare.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../default/prepare.yml
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
collections:
3+
- name: community.general

roles/edpm_multipathd/molecule/default/converge.yml

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,6 @@
1818
hosts: all
1919
gather_facts: false
2020
vars:
21-
# We cannot use the real multipathd command because the daemon needs
22-
# privileges that are not available in a rootless molecule container,
23-
# even with "privileged: true".
24-
edpm_multipathd_command: "/usr/bin/sleep 3600"
25-
tasks:
26-
- name: Install multipathd
27-
ansible.builtin.import_role:
28-
name: osp.edpm.edpm_multipathd
29-
tasks_from: install.yml
30-
- name: Configure multipathd
31-
ansible.builtin.import_role:
32-
name: osp.edpm.edpm_multipathd
33-
tasks_from: configure.yml
34-
- name: Run multipathd
35-
ansible.builtin.import_role:
36-
name: osp.edpm.edpm_multipathd
37-
tasks_from: run.yml
21+
edpm_container_cli: "true"
22+
roles:
23+
- role: osp.edpm.edpm_multipathd

roles/edpm_multipathd/molecule/default/molecule.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
---
22
dependency:
33
name: galaxy
4-
options:
5-
role-file: collections.yml
64
driver:
7-
name: podman
5+
name: delegated
6+
options:
7+
managed: false
8+
ansible_connection_options:
9+
ansible_connection: local
810
platforms:
9-
- command: /sbin/init
10-
dockerfile: ../../../../molecule/common/Containerfile.j2
11-
image: ${EDPM_ANSIBLE_MOLECULE_IMAGE:-"ubi9/ubi-init"}
12-
name: instance
13-
privileged: true
14-
registry:
15-
url: ${EDPM_ANSIBLE_MOLECULE_REGISTRY:-"registry.access.redhat.com"}
16-
volumes:
17-
- /run/udev:/run/udev
11+
- name: edpm_multipathd
1812
provisioner:
1913
name: ansible
2014
log: true

roles/edpm_multipathd/molecule/default/prepare.yml

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,56 @@
1414
# License for the specific language governing permissions and limitations
1515
# under the License.
1616

17-
- name: Prepare test deps
17+
- name: Prepare
1818
hosts: all
1919
gather_facts: false
2020
roles:
2121
- role: ../../../../molecule/common/test_deps
22-
test_deps_extra_packages:
23-
- iproute
24-
- iscsi-initiator-utils
25-
- podman
26-
test_deps_setup_edpm: true
27-
test_deps_setup_stream: true
28-
- name: Prepare
29-
hosts: all
30-
roles:
3122
- role: osp.edpm.env_data
23+
24+
- name: Setup DUT
25+
hosts: all
26+
gather_facts: false
27+
vars:
28+
test_helper_dir: "../../../../molecule/test-helpers"
3229
tasks:
33-
- name: set /etc/localtime
30+
- name: Load role vars
31+
ansible.builtin.include_vars: ../../defaults/main.yml
32+
33+
- name: Create systemd unit file for mocked legacy containerized services
34+
become: true
35+
ansible.builtin.copy:
36+
dest: "/etc/systemd/system/{{ legacy_service }}"
37+
content: |
38+
[Unit]
39+
Description=Mock containerized multipathd service
40+
41+
[Service]
42+
ExecStart=sleep 9999
43+
44+
[Install]
45+
WantedBy=multi-user.target
46+
mode: '0644'
47+
loop: "{{ edpm_multipathd_legacy_services }}"
48+
loop_control:
49+
loop_var: legacy_service
50+
51+
- name: Enable and start mocked legacy services
3452
become: true
35-
ansible.builtin.file:
36-
path: /etc/localtime
37-
src: /usr/share/zoneinfo/UTC
38-
state: link
53+
ansible.builtin.systemd_service:
54+
name: "{{ legacy_service }}"
55+
enabled: true
56+
state: started
57+
daemon_reload: true
58+
loop: "{{ edpm_multipathd_legacy_services }}"
59+
loop_control:
60+
loop_var: legacy_service
61+
62+
- name: Verify mocked legacy services are running
63+
ansible.builtin.include_tasks: "{{test_helper_dir}}/verify_systemd_unit.yaml"
64+
vars:
65+
item:
66+
name: "{{ legacy_service }}"
67+
loop: "{{ edpm_multipathd_legacy_services }}"
68+
loop_control:
69+
loop_var: legacy_service

0 commit comments

Comments
 (0)