File: test21.8

package info (click to toggle)
slurm-wlm 22.05.8-4%2Bdeb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 48,492 kB
  • sloc: ansic: 475,246; exp: 69,020; sh: 8,862; javascript: 6,528; python: 6,444; makefile: 4,185; perl: 4,069; pascal: 131
file content (157 lines) | stat: -rwxr-xr-x 4,942 bytes parent folder | download | duplicates (2)
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#!/usr/bin/env expect
############################################################################
# Purpose: Test of Slurm functionality
#          sacctmgr modify cluster
############################################################################
# Copyright (C) 2008-2010 Lawrence Livermore National Security.
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
# Written by Joseph Donaghy <donaghy1@llnl.gov>
# CODE-OCEC-09-009. All rights reserved.
#
# This file is part of Slurm, a resource management program.
# For details, see <https://slurm.schedmd.com/>.
# Please also read the included file: DISCLAIMER.
#
# Slurm is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# Slurm is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along
# with Slurm; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
############################################################################
source ./globals
source ./globals_accounting

set mmatches    0
set dmatches    0
set tc1         "${test_name}-cluster-1"
set tc2         "${test_name}-cluster-2"
set tc3         "${test_name}-cluster-3"

array set cluster {}
set cluster(Fairshare)     2500
set cluster(GrpCPUs)       20
set cluster(GrpJobs)       100
set cluster(GrpMemory)     200
set cluster(GrpSubmitJobs) 300
set cluster(GrpNodes)      100
set cluster(MaxCPUMins)    100000
set cluster(MaxCPUs)       500
set cluster(MaxJobs)       500
set cluster(MaxSubmitJobs) 400
set cluster(MaxNodes)      200
set cluster(MaxWall)       01:00:00
set cluster(DefaultQos)    "${test_name}_qos_1"

array set mod_cluster {}
set mod_cluster(Fairshare)     1375
set mod_cluster(GrpCPUs)       50
set mod_cluster(GrpJobs)       200
set mod_cluster(GrpMemory)     500
set mod_cluster(GrpSubmitJobs) 400
set mod_cluster(GrpNodes)      150
set mod_cluster(MaxCPUMins)    20000
set mod_cluster(MaxCPUs)       100
set mod_cluster(MaxJobs)       600
set mod_cluster(MaxSubmitJobs) 700
set mod_cluster(MaxNodes)      300
set mod_cluster(MaxWall)       12:00:00
set mod_cluster(DefaultQos)    "${test_name}_qos_2"
set access_err  0

if {[get_config_param "AccountingStorageType"] ne "accounting_storage/slurmdbd"} {
	skip "This test can't be run without a usable AccountStorageType"
}

#
# Verify if Administrator privileges
#
if {[get_admin_level] ne "Administrator"} {
	skip "This test can't be run without being an Accounting administrator.\nUse: sacctmgr mod user \$USER set admin=admin"
}

proc cleanup {} {
	global sacctmgr tc1 tc2 tc3 cluster mod_cluster

	run_command "$sacctmgr -i delete cluster $tc1,$tc2,$tc3"
	run_command "$sacctmgr -i delete qos $cluster(DefaultQos) $mod_cluster(DefaultQos)"
}

#
# Create tmp QOS
#
run_command -fail "$sacctmgr -i add qos $cluster(DefaultQos) $mod_cluster(DefaultQos)"

#
# Create a cluster for testing
#
set access_err 0
add_cluster "$tc1,$tc2,$tc3" [array get cluster]

if {$access_err != 0} {
	skip "Not authorized to perform this test"
}

# Check Cluster 1
if {![check_assoc_limit 1 cluster $tc1 [array get cluster]]} {
	fail "The association limits for cluster 1 ($tc1) are incorrect"
}

# Check Cluster 2
if {![check_assoc_limit 1 cluster $tc2 [array get cluster]]} {
	fail "The association limits for cluster 2 ($tc2) are incorrect"
}

# Check Cluster 3
if {![check_assoc_limit 1 cluster $tc3 [array get cluster]]} {
	fail "The association limits for cluster 3 ($tc3) are incorrect"
}

if {![check_acct_associations]} {
	fail "Our associations don't line up"
}

#
# Modify the test cluster
#
set access_err 0
mod_cluster $tc2 [array get mod_cluster]

if {$access_err != 0} {
	skip "Not authorized to perform this test"
}

# Check Cluster 2
if {![check_assoc_limit 1 cluster $tc2 [array get mod_cluster]]} {
	fail "The association limits for cluster 2 ($tc2) are incorrect"
}

if {![check_acct_associations]} {
	fail "Our associations don't line up"
}

#
# Check these cluster limits again after cluster 2 was modified
#
log_info "Check Cluster limits after one cluster has been modified:"
# Check Cluster 1
if {![check_assoc_limit 1 cluster $tc1 [array get cluster]]} {
	fail "The association limits for cluster 1 ($tc1) are incorrect"
}

# Check Cluster 2
if {![check_assoc_limit 1 cluster $tc2 [array get mod_cluster]]} {
	fail "The association limits for cluster 2 ($tc2) are incorrect"
}

# Check Cluster 3
if {![check_assoc_limit 1 cluster $tc3 [array get cluster]]} {
	fail "The association limits for cluster 3 ($tc3) are incorrect"
}