Skip to content

Commit 576252d

Browse files
committed
add login-only configless tests
1 parent f93abd0 commit 576252d

File tree

4 files changed

+130
-0
lines changed

4 files changed

+130
-0
lines changed

molecule/test8/INSTALL.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
*******
2+
Docker driver installation guide
3+
*******
4+
5+
Requirements
6+
============
7+
8+
* Docker Engine
9+
10+
Install
11+
=======
12+
13+
Please refer to the `Virtual environment`_ documentation for installation best
14+
practices. If not using a virtual environment, please consider passing the
15+
widely recommended `'--user' flag`_ when invoking ``pip``.
16+
17+
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
18+
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
19+
20+
.. code-block:: bash
21+
22+
$ python3 -m pip install 'molecule[docker]'

molecule/test8/converge.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
- name: Converge
3+
hosts: all
4+
tasks:
5+
- name: "Include ansible-role-openhpc"
6+
include_role:
7+
name: "ansible-role-openhpc/"
8+
vars:
9+
openhpc_enable:
10+
control: "{{ inventory_hostname in groups['testohpc_control'] }}"
11+
batch: "{{ inventory_hostname in groups['testohpc_compute'] }}"
12+
login: "{{ inventory_hostname in groups['testohpc_login'] }}"
13+
runtime: true
14+
openhpc_slurm_control_host: "{{ groups['testohpc_control'] | first }}"
15+
openhpc_slurm_partitions:
16+
- name: "compute"
17+
openhpc_cluster_name: testohpc
18+
openhpc_slurm_configless: true
19+

molecule/test8/molecule.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
name: single partition, group is partition
3+
driver:
4+
name: docker
5+
platforms:
6+
- name: testohpc-control
7+
image: ${MOLECULE_IMAGE}
8+
pre_build_image: true
9+
groups:
10+
- testohpc_control
11+
command: /sbin/init
12+
tmpfs:
13+
- /run
14+
- /tmp
15+
volumes:
16+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
17+
networks:
18+
- name: net1
19+
20+
- name: testohpc-login-0
21+
image: ${MOLECULE_IMAGE}
22+
pre_build_image: true
23+
groups:
24+
- testohpc_login
25+
command: /sbin/init
26+
tmpfs:
27+
- /run
28+
- /tmp
29+
volumes:
30+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
31+
networks:
32+
- name: net1
33+
34+
- name: testohpc-login-1
35+
image: ${MOLECULE_IMAGE}
36+
pre_build_image: true
37+
groups:
38+
- testohpc_login
39+
command: /sbin/init
40+
tmpfs:
41+
- /run
42+
- /tmp
43+
volumes:
44+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
45+
networks:
46+
- name: net1
47+
48+
- name: testohpc-compute-0
49+
image: ${MOLECULE_IMAGE}
50+
pre_build_image: true
51+
groups:
52+
- testohpc_compute
53+
command: /sbin/init
54+
tmpfs:
55+
- /run
56+
- /tmp
57+
volumes:
58+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
59+
networks:
60+
- name: net1
61+
- name: testohpc-compute-1
62+
image: ${MOLECULE_IMAGE}
63+
pre_build_image: true
64+
groups:
65+
- testohpc_compute
66+
command: /sbin/init
67+
tmpfs:
68+
- /run
69+
- /tmp
70+
volumes:
71+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
72+
networks:
73+
- name: net1
74+
provisioner:
75+
name: ansible
76+
verifier:
77+
name: ansible

molecule/test8/verify.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
3+
- name: Check slurm hostlist
4+
hosts: testohpc_login # NB for this test this is 2x non-control nodes, so tests they can contact slurmctld too
5+
tasks:
6+
- name: Get slurm partition info
7+
command: sinfo --noheader --format="%P,%a,%l,%D,%t,%N" # using --format ensures we control whitespace
8+
register: sinfo
9+
- name:
10+
assert: # PARTITION AVAIL TIMELIMIT NODES STATE NODELIST
11+
that: "sinfo.stdout_lines == ['compute*,up,60-00:00:00,2,idle,testohpc-compute-[0-1]']"
12+
fail_msg: "FAILED - actual value: {{ sinfo.stdout_lines }}"

0 commit comments

Comments
 (0)