Skip to content

Commit bca9709

Browse files
committed
add tests 13 and 14 to github CI
1 parent b6416fd commit bca9709

File tree

5 files changed

+108
-0
lines changed

5 files changed

+108
-0
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ jobs:
4343
- test10
4444
- test11
4545
- test12
46+
- test13
47+
- test14
4648

4749
exclude:
4850
- image: 'centos:7'
@@ -61,6 +63,10 @@ jobs:
6163
scenario: test11
6264
- image: 'centos:7'
6365
scenario: test12
66+
- image: 'centos:7'
67+
scenario: test13
68+
- image: 'centos:7'
69+
scenario: test14
6470

6571
steps:
6672
- name: Check out the codebase.

molecule/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ test10 | 1 | N | As for #5 but then tries to ad
2121
test11 | 1 | N | As for #5 but then deletes a node (actually changes the partition due to molecule/ansible limitations)
2222
test12 | 1 | N | As for #5 but enabling job completion and testing `sacct -c`
2323
test13 | 1 | N | As for #5 but tests `openhpc_config` variable.
24+
test14 | 1 | | As for #5 but also tests `extra_nodes` via State=DOWN nodes.
2425

2526
# Local Installation & Running
2627

molecule/test14/converge.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
- name: Converge
3+
hosts: all
4+
tasks:
5+
- name: "Include ansible-role-openhpc"
6+
include_role:
7+
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
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_control_host: "{{ groups['testohpc_login'] | first }}"
14+
openhpc_slurm_partitions:
15+
- name: "compute"
16+
extra_nodes:
17+
# Need to specify IPs as even with State=DOWN, if slurmctld can't lookup a host it just excludes it from the config entirely
18+
# Can't add to /etc/hosts via ansible due to Docker limitations on modifying /etc/hosts
19+
- NodeName: fake-x,fake-y
20+
NodeAddr: 0.42.42.0,0.42.42.1
21+
State: DOWN
22+
CPUs: 1
23+
- NodeName: fake-2cpu-[3,7-9]
24+
NodeAddr: 0.42.42.3,0.42.42.7,0.42.42.8,0.42.42.9
25+
State: DOWN
26+
CPUs: 2
27+
openhpc_cluster_name: testohpc
28+
openhpc_slurm_configless: true
29+

molecule/test14/molecule.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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+
docker_networks:
20+
- name: net1
21+
driver_options:
22+
com.docker.network.driver.mtu: ${DOCKER_MTU:-1500} # 1500 is docker default
23+
- name: testohpc-compute-0
24+
image: ${MOLECULE_IMAGE}
25+
pre_build_image: true
26+
groups:
27+
- testohpc_compute
28+
command: /sbin/init
29+
tmpfs:
30+
- /run
31+
- /tmp
32+
volumes:
33+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
34+
networks:
35+
- name: net1
36+
docker_networks:
37+
- name: net1
38+
driver_options:
39+
com.docker.network.driver.mtu: ${DOCKER_MTU:-1500} # 1500 is docker default
40+
- name: testohpc-compute-1
41+
image: ${MOLECULE_IMAGE}
42+
pre_build_image: true
43+
groups:
44+
- testohpc_compute
45+
command: /sbin/init
46+
tmpfs:
47+
- /run
48+
- /tmp
49+
volumes:
50+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
51+
networks:
52+
- name: net1
53+
docker_networks:
54+
- name: net1
55+
driver_options:
56+
com.docker.network.driver.mtu: ${DOCKER_MTU:-1500} # 1500 is docker default
57+
provisioner:
58+
name: ansible
59+
verifier:
60+
name: ansible

molecule/test14/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,6,down*,fake-2cpu-[3,7-9],fake-x,fake-y', '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)