Skip to content

Commit b32d318

Browse files
authored
Merge pull request #78 from stackhpc/test/configless
Add test for configless mode
2 parents 1c760c3 + 9fd154c commit b32d318

File tree

6 files changed

+108
-3
lines changed

6 files changed

+108
-3
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ jobs:
2424
- test2
2525
- test3
2626
- test4
27+
- test5
28+
exclude:
29+
- image: 'centos:7'
30+
scenario: test5
2731

2832
steps:
2933
- name: Check out the codebase.

molecule/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ Molecule tests for the role.
22

33
# Test Matrix
44

5-
Test options "flow down" through table unless changed.
5+
Test options in "Other" column flow down through table unless changed.
66

77
Test | # Partitions | Groups in partitions? | Other
88
--- | --- | --- | ---
9-
test1 | 1 | N | 2x compute node, sequential names (default test)
9+
test1 | 1 | N | 2x compute node, sequential names (default test), config on all nodes
1010
test1b | 1 | N | 1x compute node
1111
test1c | 1 | N | 2x compute nodes, nonsequential names
1212
test2 | 2 | N | 4x compute node, sequential names
1313
test3 | 1 | Y | -
1414
test4 | 1 | N | 2x compute node, accounting enabled
15-
15+
test5 | 1 | N | As for #1 but configless
1616

1717
# Local Installation & Running
1818

molecule/test5/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/test5/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_login'] }}"
11+
batch: "{{ inventory_hostname in groups['testohpc_compute'] }}"
12+
runtime: true
13+
openhpc_slurm_service_enabled: true
14+
openhpc_slurm_control_host: "{{ groups['testohpc_login'] | first }}"
15+
openhpc_slurm_partitions:
16+
- name: "compute"
17+
openhpc_cluster_name: testohpc
18+
openhpc_slurm_configless: true
19+

molecule/test5/molecule.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: single partition, group is partition
3+
driver:
4+
name: docker
5+
platforms:
6+
- name: testohpc-login-0
7+
image: ${MOLECULE_IMAGE}
8+
pre_build_image: true
9+
groups:
10+
- testohpc_login
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+
- name: testohpc-compute-0
20+
image: ${MOLECULE_IMAGE}
21+
pre_build_image: true
22+
groups:
23+
- testohpc_compute
24+
command: /sbin/init
25+
tmpfs:
26+
- /run
27+
- /tmp
28+
volumes:
29+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
30+
networks:
31+
- name: net1
32+
- name: testohpc-compute-1
33+
image: ${MOLECULE_IMAGE}
34+
pre_build_image: true
35+
groups:
36+
- testohpc_compute
37+
command: /sbin/init
38+
tmpfs:
39+
- /run
40+
- /tmp
41+
volumes:
42+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
43+
networks:
44+
- name: net1
45+
provisioner:
46+
name: ansible
47+
verifier:
48+
name: ansible

molecule/test5/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
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)