~ubuntu-branches/ubuntu/vivid/slurm-llnl/vivid

« back to all changes in this revision

Viewing changes to testsuite/expect/test8.5

  • Committer: Bazaar Package Importer
  • Author(s): Gennaro Oliva
  • Date: 2009-09-24 23:28:15 UTC
  • mfrom: (1.1.11 upstream) (3.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090924232815-enh65jn32q1ebg07
Tags: 2.0.5-1
* New upstream release 
* Changed dependecy from lib-mysqlclient15 to lib-mysqlclient 
* Added Default-Start for runlevel 2 and 4 and $remote_fs requirement in
  init.d scripts (Closes: #541252)
* Postinst checks for wrong runlevels 2 and 4 links
* Upgraded to standard version 3.8.3
* Add lintian overrides for missing slurm-llnl-configurator.html in doc
  base registration
* modified postrm scripts to ignore pkill return value in order to avoid
  postrm failure when no slurm process is running
* Checking for slurmctld.pid before cancelling running and pending
  jobs during package removal 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/expect
2
2
############################################################################
3
3
# Purpose: Test of BLUEGENE SLURM functionality
4
 
#          Test sacct functionality and accuracy.
 
4
#          Test creation of all blocks 1 midplane and smaller.
5
5
#
6
6
# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
7
7
#          "FAILURE: ..." otherwise with an explanation of the failure, OR
10
10
# Copyright (C) 2006-2007 The Regents of the University of California.
11
11
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
12
12
# Written by Danny Auble <da@llnl.gov>
13
 
# LLNL-CODE-402394.
 
13
# CODE-OCEC-09-009. All rights reserved.
14
14
15
15
# This file is part of SLURM, a resource management program.
16
 
# For details, see <http://www.llnl.gov/linux/slurm/>.
 
16
# For details, see <https://computing.llnl.gov/linux/slurm/>.
 
17
# Please also read the included file: DISCLAIMER.
17
18
#  
18
19
# SLURM is free software; you can redistribute it and/or modify it under
19
20
# the terms of the GNU General Public License as published by the Free
42
43
# job paramters
43
44
set sleep_time 1
44
45
 
 
46
proc run_and_test { size } {
 
47
        global number sbatch scontrol 
 
48
        global file_out file_err file_in procs_per_cnode
 
49
 
 
50
        set job_id 0
 
51
        set exit_code 0
 
52
 
 
53
        set sbatch_pid [spawn $sbatch --output=$file_out --error=$file_err -t2 -N$size-$size $file_in]
 
54
        expect {
 
55
                -re "Submitted batch job ($number)" {
 
56
                        set job_id $expect_out(1,string)
 
57
                        exp_continue
 
58
                }
 
59
                timeout {
 
60
                        send_user "\nFAILURE: sbatch not responding\n"
 
61
                        slow_kill $sbatch_pid
 
62
                        set exit_code 1
 
63
                }
 
64
                eof {
 
65
                        wait
 
66
                }
 
67
        }
 
68
 
 
69
        if {!$job_id || $exit_code} {
 
70
                send_user "\nFAILURE: batch submit failure\n"
 
71
                return 1
 
72
        }
 
73
 
 
74
        #
 
75
        # Wait for job to run
 
76
        #
 
77
        if {[wait_for_job $job_id "DONE"] != 0} {
 
78
                send_user "\nFAILURE: waiting for job to run\n"
 
79
                return 1
 
80
        }
 
81
 
 
82
        set matches 0
 
83
        set requested_cpus [expr $size * $procs_per_cnode]
 
84
 
 
85
        set scon_pid [spawn $scontrol show job $job_id]
 
86
        expect {
 
87
                -re "AllocCPUs=$requested_cpus" {
 
88
                        incr matches
 
89
                        exp_continue
 
90
                }
 
91
                timeout {
 
92
                        send_user "\nFAILURE: scontrol not responding\n"
 
93
                        slow_kill $scon_pid
 
94
                        set exit_code 1
 
95
                }
 
96
                eof {
 
97
                        wait
 
98
                }
 
99
        }
 
100
        if {$matches != 1} {
 
101
                send_user "\nFAILURE: Bluegene $size cnode block not created correctly\n"
 
102
                set exit_code 1
 
103
        }
 
104
        
 
105
        
 
106
        return $exit_code
 
107
}
 
108
 
 
109
proc run_bgl_test { } {
 
110
        global psets
 
111
 
 
112
        # make a 512 cnode block
 
113
        if {[run_and_test 512]} {
 
114
                return 1
 
115
        }
 
116
 
 
117
        if {[run_and_test 128]} {
 
118
                return 1
 
119
        }
 
120
 
 
121
        if {$psets >= 16} {
 
122
                if {[run_and_test 32]} {
 
123
                        return 1
 
124
                }
 
125
        }
 
126
 
 
127
        return 0;
 
128
}
 
129
 
 
130
 
 
131
proc run_bgp_test { } {
 
132
        global psets
 
133
 
 
134
        # make a 512 cnode block
 
135
        if {[run_and_test 512]} {
 
136
                return 1
 
137
        }
 
138
 
 
139
        if {[run_and_test 256]} {
 
140
                return 1
 
141
        }
 
142
        if {[run_and_test 128]} {
 
143
                return 1
 
144
        }
 
145
 
 
146
        if {$psets >= 8} {
 
147
                if {[run_and_test 64]} {
 
148
                        return 1
 
149
                }
 
150
                if {$psets >= 16} {
 
151
                        if {[run_and_test 32]} {
 
152
                                return 1
 
153
                        }
 
154
                        if {$psets >= 32} {
 
155
                                if {[run_and_test 16]} {
 
156
                                        return 1
 
157
                                }
 
158
                        }
 
159
                }
 
160
        }
 
161
        return 0;
 
162
}
 
163
 
 
164
# TEST STARTS HERE
 
165
 
45
166
print_header $test_id
46
167
 
47
168
if {[test_bluegene] == 0} {
48
169
        send_user "\nWARNING: This test is only compatable with bluegene systems\n"
49
170
        exit $exit_code
50
171
}
 
172
 
 
173
if {[string compare [get_bluegene_layout] Dynamic]} {
 
174
        send_user "\nWARNING: This test is only compatable with dynamic bluegene systems\n"
 
175
        exit $exit_code
 
176
}
 
177
 
 
178
set psets [get_bluegene_psets]
 
179
 
 
180
if {$psets == 0} {
 
181
        send_user "\nFAILURE: No psets are set on this system\n"
 
182
        exit 1
 
183
}
 
184
 
 
185
set procs_per_cnode [get_bluegene_procs_per_cnode]
 
186
 
 
187
if {$procs_per_cnode == 0} {
 
188
        send_user "\nFAILURE: Couldn't determine procs per cnode\n"
 
189
        exit 1
 
190
}
 
191
 
 
192
set type [get_bluegene_type]
 
193
 
 
194
if {$type == 0} {
 
195
        send_user "\nFAILURE: No bluegene type found \n"
 
196
        exit 1
 
197
}
 
198
 
 
199
 
51
200
#
52
201
# Delete left-over input script files
53
202
# Build input script file
60
209
#
61
210
set timeout [expr $max_job_delay + $sleep_time]
62
211
 
63
 
# make a 512 cnode block
64
 
 
65
 
set sbatch_pid [spawn $sbatch --output=$file_out --error=$file_err -t2 -N512-512 $file_in]
66
 
expect {
67
 
        -re "Submitted batch job ($number)" {
68
 
                set job_id $expect_out(1,string)
69
 
                exp_continue
70
 
        }
71
 
        timeout {
72
 
                send_user "\nFAILURE: sbatch not responding\n"
73
 
                slow_kill $sbatch_pid
74
 
                exit 1
75
 
        }
76
 
        eof {
77
 
                wait
78
 
        }
79
 
}
80
 
if {$job_id == 0} {
81
 
        send_user "\nFAILURE: batch submit failure\n"
82
 
        exit 1
83
 
}
84
 
 
85
 
#
86
 
# Wait for job to run
87
 
#
88
 
if {[wait_for_job $job_id "DONE"] != 0} {
89
 
        send_user "\nFAILURE: waiting for job to run\n"
90
 
        set exit_code 1
91
 
}
92
 
 
93
 
set matches 0
94
 
set cpus_per_node 1
95
 
 
96
 
spawn $scontrol show job $job_id
97
 
expect {
98
 
        -re "BP_List=$alpha_numeric " {
99
 
                incr matches
100
 
                exp_continue
101
 
        }
102
 
        -re "AllocCPUs=($number)" {
103
 
                set cpu_count $expect_out(1,string)
104
 
                set cpus_per_node [expr $cpu_count / 512]
105
 
                if {($cpu_count != 512) && ($cpu_count != 1024)} {
106
 
                        send_user "\nFAILURE: Bad node count allocated\n"
107
 
                        set exit_code 1
108
 
                }
109
 
                exp_continue
110
 
        }
111
 
        timeout {
112
 
                send_user "\nFAILURE: scontrol not responding\n"
113
 
                set exit_code 1
114
 
        }
115
 
        eof {
116
 
                wait
117
 
        }
118
 
}
119
 
if {$matches != 1} {
120
 
        send_user "\nFAILURE: Blue Gene 512 cnode block not created correctly\n"
121
 
        set exit_code 1
122
 
}
123
 
if {$exit_code != 0} {
124
 
        exit $exit_code
125
 
}
126
 
 
127
 
# make a 128 cnode block
128
 
 
129
 
 
130
 
set sbatch_pid [spawn $sbatch --output=$file_out --error=$file_err -t2 -N128-128 $file_in]
131
 
expect {
132
 
        -re "Submitted batch job ($number)" {
133
 
                set job_id $expect_out(1,string)
134
 
                exp_continue
135
 
        }
136
 
        timeout {
137
 
                send_user "\nFAILURE: sbatch not responding\n"
138
 
                slow_kill $sbatch_pid
139
 
                exit 1
140
 
        }
141
 
        eof {
142
 
                wait
143
 
        }
144
 
}
145
 
if {$job_id == 0} {
146
 
        send_user "\nFAILURE: batch submit failure\n"
147
 
        exit 1
148
 
}
149
 
 
150
 
#
151
 
# Wait for job to run
152
 
#
153
 
if {[wait_for_job $job_id "DONE"] != 0} {
154
 
        send_user "\nFAILURE: waiting for job to run\n"
155
 
        set exit_code 1
156
 
}
157
 
 
158
 
set matches 0
159
 
 
160
 
spawn $scontrol show job $job_id
161
 
expect {
162
 
        -re "BP_List=$alpha_numeric\[$number-$number\] " {
163
 
                incr matches
164
 
                exp_continue
165
 
        }
166
 
        -re "AllocCPUs=($number)" {
167
 
                set cpu_count $expect_out(1,string)
168
 
                set node_count [expr $cpu_count / $cpus_per_node]
169
 
                if {$node_count != 128} {
170
 
                        send_user "\n=======================================\n"
171
 
                        send_user "\nFAILURE: Bad node count allocated\n"
172
 
                        send_user "This can indicate a low configured value of Numpsets\n"
173
 
                        send_user "  in bluegene.conf (few available I/O nodes).\n"
174
 
                        send_user "This could indicate Static Bluegene partitioning\n"
175
 
                        send_user "  with no small blocks (1/4 of a base partition).\n"
176
 
                        send_user "This could also indicate MinNodes for the partition\n"
177
 
                        send_user "  being too high for this test.\n"
178
 
                        send_user "=======================================\n"
179
 
                        set exit_code 1
180
 
                }
181
 
                exp_continue
182
 
        }
183
 
        timeout {
184
 
                send_user "\nFAILURE: scontrol not responding\n"
185
 
                set exit_code 1
186
 
        }
187
 
        eof {
188
 
                wait
189
 
        }
190
 
}
191
 
if {$matches != 1} {
192
 
        send_user "\nFAILURE: Blue Gene 128 cnode block not created correctly\n"
193
 
        set exit_code 1
194
 
}
195
 
 
196
 
# make a 32 cnode block
197
 
 
198
 
set sbatch_pid [spawn $sbatch --output=$file_out --error=$file_err -t2 -N32-32 $file_in]
199
 
expect {
200
 
        -re "Submitted batch job ($number)" {
201
 
                set job_id $expect_out(1,string)
202
 
                exp_continue
203
 
        }
204
 
        timeout {
205
 
                send_user "\nFAILURE: sbatch not responding\n"
206
 
                slow_kill $sbatch_pid
207
 
                exit 1
208
 
        }
209
 
        eof {
210
 
                wait
211
 
        }
212
 
}
213
 
if {$job_id == 0} {
214
 
        send_user "\nFAILURE: batch submit failure\n"
215
 
        exit 1
216
 
}
217
 
 
218
 
#
219
 
# Wait for job to run
220
 
#
221
 
if {[wait_for_job $job_id "DONE"] != 0} {
222
 
        send_user "\nFAILURE: waiting for job to run\n"
223
 
        set exit_code 1
224
 
}
225
 
 
226
 
set matches 0
227
 
spawn $scontrol show job $job_id
228
 
expect {
229
 
#       Could be one or multiple node cards (e.g. "bgl000[0]" or "bgl000[0-1]")
230
 
        -re "BP_List=$alpha_numeric\[$number" {
231
 
                incr matches
232
 
                exp_continue
233
 
        }
234
 
        -re "AllocCPUs=($number)" {
235
 
                set cpu_count $expect_out(1,string)
236
 
                set node_count [expr $cpu_count / $cpus_per_node]
237
 
                if {$node_count != 32} {
238
 
                        send_user "\n=======================================\n"
239
 
                        send_user "FAILURE: Bad node count allocated\n"
240
 
                        send_user "This can indicate a low configured value of Numpsets\n"
241
 
                        send_user "  in bluegene.conf (few available I/O nodes).\n"
242
 
                        send_user "This could indicate Static Bluegene partitioning\n"
243
 
                        send_user "  with no small blocks (1/16 of a base partition).\n"
244
 
                        send_user "This could also indicate MinNodes for the partition\n"
245
 
                        send_user "  being too high for this test.\n"
246
 
                        send_user "=======================================\n"
247
 
                        set exit_code 1
248
 
                }
249
 
                exp_continue
250
 
        }
251
 
        timeout {
252
 
                send_user "\nFAILURE: scontrol not responding\n"
253
 
                set exit_code 1
254
 
        }
255
 
        eof {
256
 
                wait
257
 
        }
258
 
}
259
 
if {$matches != 1} {
260
 
        send_user "\nFAILURE: Blue Gene 32 cnode block not created correctly\n"
261
 
        set exit_code 1
262
 
}
 
212
if {![string compare $type "P"]} {
 
213
        set exit_code [run_bgp_test]
 
214
} elseif {![string compare $type "L"]} {
 
215
        set exit_code [run_bgl_test]
 
216
} else {
 
217
        send_user "\nFAILURE: unknown bluegene system type '$type'\n";
 
218
        exit 1
 
219
}
 
220
 
263
221
 
264
222
if {$exit_code == 0} {
265
223
        exec rm -f $file_in $file_out $file_err