forked from dell/omnia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_slurm_workers.yml
126 lines (112 loc) · 3.91 KB
/
test_slurm_workers.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
# Testcase OMNIA_USP_US_VFSP_TC_005
# Execute slurm_worker role in compute node with os installed centos 7.9
- name: OMNIA_USP_US_VFSP_TC_005
hosts: compute
vars_files:
- test_vars/test_slurm_workers_vars.yml
tasks:
- block:
- name: Call slurm worker role
include_role:
name: ../roles/slurm_workers
tags: TC_005
- name: Fetch slurm packages installed
package_facts:
manager: auto
tags: TC_005,VERIFY_005
- name: Check if slurm is installed
command: sinfo -V
register: slurm_version
changed_when: false
ignore_errors: True
tags: TC_005,VERIFY_005
- name: Checking slurmd service status
service:
name: slurmd.service
register: slurmd_service
tags: TC_005, VERIFY_005
- name: Verify all slurm packages are installed
assert:
that: "'{{ item }}' in ansible_facts.packages"
success_msg: "{{ slurm_packages_status_success_msg }}"
fail_msg: "{{ slurm_packages_status_fail_msg }}"
with_items:
- "{{ slurm_packages }}"
- "{{ dev_tools }}"
tags: TC_005, VERIFY_005
- name: Validate slurm installation
assert:
that: "'command not found' not in slurm_version.stdout"
fail_msg: "{{ slurm_status_fail_msg }}"
success_msg: "{{ slurm_status_success_msg }}"
tags: TC_005, VERIFY_005
- name: Validating slurmd service status
assert:
that:
- slurmd_service.status.ActiveState == 'active'
fail_msg: "{{ slurmd_service_fail_msg }}"
success_msg: "{{ slurmd_service_success_msg }}"
tags: TC_005, VERIFY_005
# Testcase OMNIA_USP_US_VFSP_TC_006
# Execute slurm_workers role in compute node with slurm packages already installed
- name: OMNIA_USP_US_VFSP_TC_006
hosts: compute
vars_files:
- test_vars/test_slurm_workers_vars.yml
tasks:
- block:
- name: Call slurm worker role
include_role:
name: ../roles/slurm_workers
tags: TC_006
- name: Fetch slurm packages installed
package_facts:
manager: auto
tags: TC_006,VERIFY_006
- name: Checking slurmd service status
service:
name: slurmd.service
register: slurmd_service
tags: TC_006, VERIFY_006
- name: Check if slurm is installed
command: sinfo -V
register: slurm_version
changed_when: false
ignore_errors: True
tags: TC_006,VERIFY_006
- name: Verify all slurm packages are installed
assert:
that: "'{{ item }}' in ansible_facts.packages"
success_msg: "{{ slurm_packages_status_success_msg }}"
fail_msg: "{{ slurm_packages_status_fail_msg }}"
with_items:
- "{{ slurm_packages }}"
- "{{ dev_tools }}"
tags: TC_006, VERIFY_006
- name: Validate slurm installation
assert:
that: "'command not found' not in slurm_version.stdout"
fail_msg: "{{ slurm_status_fail_msg }}"
success_msg: "{{ slurm_status_success_msg }}"
tags: TC_006, VERIFY_006
- name: Validating slurmd service status
assert:
that:
- slurmd_service.status.ActiveState == 'active'
fail_msg: "{{ slurmd_service_fail_msg }}"
success_msg: "{{ slurmd_service_success_msg }}"
tags: TC_006, VERIFY_006