Skip to content

Commit 325d6e7

Browse files
authored
Merge pull request #124 from sthapa/master
osg-test changes for SOFTWARE-3202
2 parents 029cef4 + 3c33a0c commit 325d6e7

File tree

3 files changed

+53
-6
lines changed

3 files changed

+53
-6
lines changed

osgtest/library/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ def handler(*args, **kwargs):
5757
_el_release = None
5858

5959
SLURM_PACKAGES = ['slurm',
60-
'slurm-munge',
60+
'slurm-slurmd',
61+
'slurm-slurmctld',
6162
'slurm-perlapi',
62-
'slurm-plugins',
63-
'slurm-sql']
63+
'slurm-slurmdbd']
6464

6565
# ------------------------------------------------------------------------------
6666
# Global Functions

osgtest/tests/test_29_slurm.py

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
import osgtest.library.osgunittest as osgunittest
55
import osgtest.library.service as service
66

7+
import time
8+
79
CLUSTER_NAME = 'osg_test'
810
CTLD_LOG = '/var/log/slurm/slurmctld.log'
11+
SLURM_LOG = '/var/log/slurm/slurm.log'
912
SHORT_HOSTNAME = core.get_hostname().split('.')[0]
1013

1114
SLURMDBD_CONFIG = """AuthType=auth/munge
@@ -39,6 +42,21 @@
3942
StateSaveLocation=/var/spool/slurmd
4043
"""
4144

45+
SLURM_CGROUPS_CONFIG = """CgroupAutomount=yes
46+
CgroupMountpoint=/cgroup
47+
ConstrainCores=no
48+
ConstrainRAMSpace=no
49+
"""
50+
51+
SLURM_CGROUPS_DEVICE_CONFIG = """/dev/null
52+
/dev/urandom
53+
/dev/zero
54+
/dev/sda*
55+
/dev/cpu/*/*
56+
/dev/pts/*
57+
"""
58+
59+
4260
class TestStartSlurm(osgunittest.OSGTestCase):
4361

4462
def slurm_reqs(self):
@@ -52,6 +70,20 @@ def test_01_slurm_config(self):
5270
SLURM_CONFIG % {'short_hostname': SHORT_HOSTNAME, 'cluster': CLUSTER_NAME, 'ctld_log': CTLD_LOG},
5371
owner='slurm',
5472
chmod=0644)
73+
core.config['cgroup.config'] = '/etc/slurm/cgroup.conf'
74+
config = SLURM_CGROUPS_CONFIG
75+
if core.el_release() == 6:
76+
config += "\nCgroupMountpoint=/cgroup"
77+
files.write(core.config['cgroup.config'],
78+
config,
79+
owner='slurm',
80+
chmod=0644)
81+
82+
core.config['cgroup_allowed_devices_file.conf'] = '/etc/slurm/cgroup_allowed_devices_file.conf'
83+
files.write(core.config['cgroup_allowed_devices_file.conf'],
84+
SLURM_CGROUPS_DEVICE_CONFIG,
85+
owner='slurm',
86+
chmod=0644)
5587

5688
def test_02_start_slurmdbd(self):
5789
core.state['slurmdbd.started-service'] = False
@@ -88,20 +120,31 @@ def test_03_start_slurm(self):
88120
core.config['slurm.service-name'] = 'slurm'
89121
if core.el_release() == 7:
90122
core.config['slurm.service-name'] += 'd'
123+
core.config['slurm.ctld-service-name'] = 'slurmctld'
91124
core.state['%s.started-service' % core.config['slurm.service-name']] = False
92125
self.slurm_reqs()
93126
self.skip_ok_if(service.is_running(core.config['slurm.service-name']), 'slurm already running')
94127

95128
stat = core.get_stat(CTLD_LOG)
96129

97-
command = ['slurmctld']
98-
core.check_system(command, 'enable slurmctld')
99-
service.check_start(core.config['slurm.service-name'])
130+
if core.el_release() == 7:
131+
# slurmctld is handled by /etc/init.d/slurm on EL6
132+
command = ['slurmctld']
133+
core.check_system(command, 'enable slurmctld')
134+
service.check_start(core.config['slurm.service-name'])
135+
service.check_start(core.config['slurm.ctld-service-name'])
136+
else:
137+
service.check_start(core.config['slurm.service-name'])
100138

101139
core.monitor_file(CTLD_LOG,
102140
stat,
103141
'slurm_rpc_node_registration complete for %s' % SHORT_HOSTNAME,
104142
60.0)
143+
log_stat = core.get_stat(SLURM_LOG)
144+
core.monitor_file(SLURM_LOG,
145+
log_stat,
146+
'slurmd started',
147+
60.0)
105148
command = ['scontrol', 'update', 'nodename=%s' % SHORT_HOSTNAME, 'state=idle']
106149
core.check_system(command, 'enable slurm node')
107150

osgtest/tests/test_74_slurm.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ def test_01_stop_slurm(self):
1313
self.slurm_reqs()
1414
self.skip_ok_unless(core.state['%s.started-service' % core.config['slurm.service-name']], 'did not start slurm')
1515
service.check_stop(core.config['slurm.service-name']) # service requires config so we stop it first
16+
if core.el_release() == 7:
17+
service.check_stop(core.config['slurm.ctld-service-name'])
1618
files.restore(core.config['slurm.config'], 'slurm')
19+
files.restore(core.config['cgroup.config'], 'slurm')
20+
files.restore(core.config['cgroup_allowed_devices_file.conf'], 'slurm')
1721

1822
def test_02_stop_slurmdbd(self):
1923
self.slurm_reqs()

0 commit comments

Comments
 (0)