1
+ import os
1
2
import osgtest .library .core as core
2
3
import osgtest .library .files as files
3
4
import osgtest .library .mysql as mysql
4
5
import osgtest .library .osgunittest as osgunittest
5
6
import osgtest .library .service as service
6
7
7
- import time
8
-
9
8
CLUSTER_NAME = 'osg_test'
10
9
CTLD_LOG = '/var/log/slurm/slurmctld.log'
11
10
SLURM_LOG = '/var/log/slurm/slurm.log'
@@ -66,14 +65,15 @@ def slurm_reqs(self):
66
65
def test_01_slurm_config (self ):
67
66
self .slurm_reqs ()
68
67
if core .PackageVersion ('slurm' ) >= '19.05.2' :
69
- core .config ['slurm.config' ] = '/etc/slurm.conf '
68
+ core .config ['slurm.config-dir ' ] = '/etc'
70
69
else :
71
- core .config ['slurm.config' ] = '/etc/slurm/slurm.conf'
70
+ core .config ['slurm.config-dir' ] = '/etc/slurm'
71
+ core .config ['slurm.config' ] = os .path .join (core .config ['slurm.config-dir' ], 'slurm.conf' )
72
72
files .write (core .config ['slurm.config' ],
73
73
SLURM_CONFIG % {'short_hostname' : SHORT_HOSTNAME , 'cluster' : CLUSTER_NAME , 'ctld_log' : CTLD_LOG },
74
74
owner = 'slurm' ,
75
75
chmod = 0o644 )
76
- core .config ['cgroup.config' ] = '/etc/ slurm/ cgroup.conf'
76
+ core .config ['cgroup.config' ] = os . path . join ( core . config [ ' slurm.config-dir' ], ' cgroup.conf')
77
77
config = SLURM_CGROUPS_CONFIG
78
78
if core .el_release () == 6 :
79
79
config += "\n CgroupMountpoint=/cgroup"
@@ -82,7 +82,8 @@ def test_01_slurm_config(self):
82
82
owner = 'slurm' ,
83
83
chmod = 0o644 )
84
84
85
- core .config ['cgroup_allowed_devices_file.conf' ] = '/etc/slurm/cgroup_allowed_devices_file.conf'
85
+ core .config ['cgroup_allowed_devices_file.conf' ] = os .path .join (core .config ['slurm.config-dir' ],
86
+ 'cgroup_allowed_devices_file.conf' )
86
87
files .write (core .config ['cgroup_allowed_devices_file.conf' ],
87
88
SLURM_CGROUPS_DEVICE_CONFIG ,
88
89
owner = 'slurm' ,
@@ -93,7 +94,7 @@ def test_02_start_slurmdbd(self):
93
94
self .slurm_reqs ()
94
95
core .skip_ok_unless_installed ('slurm-slurmdbd' )
95
96
self .skip_bad_unless (mysql .is_running (), 'slurmdbd requires mysql' )
96
- core .config ['slurmdbd.config' ] = '/etc/ slurm/ slurmdbd.conf'
97
+ core .config ['slurmdbd.config' ] = os . path . join ( core . config [ ' slurm.config-dir' ], ' slurmdbd.conf')
97
98
core .config ['slurmdbd.user' ] = "'osg-test-slurm'@'localhost'"
98
99
core .config ['slurmdbd.name' ] = "osg_test_slurmdb"
99
100
0 commit comments