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

« back to all changes in this revision

Viewing changes to testsuite/expect/test7.11

  • 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:
7
7
#          "FAILURE: ..." otherwise with an explanation of the failure, OR
8
8
#          anything else indicates a failure mode that must be investigated.
9
9
############################################################################
10
 
# Copyright (C) 2008 Lawrence Livermore National Security.
 
10
# Copyright (C) 2008-2009 Lawrence Livermore National Security.
11
11
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
12
12
# Written by Morris Jette <jette1@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
56
57
# Build the plugin
57
58
#
58
59
exec $bin_rm -f ${file_prog}.so
59
 
exec $bin_cc -shared -I${slurm_dir}/include -o ${file_prog}.so ${file_prog}.c
 
60
exec $bin_cc -fPIC -shared -I${slurm_dir}/include -o ${file_prog}.so ${file_prog}.c
60
61
 
61
62
#
62
63
# Locate slurm.conf's directory, copy the original plugstack.conf file
66
67
set config_dir ""
67
68
spawn $scontrol show config
68
69
expect {
69
 
        -re "SLURM_CONFIG_FILE.*= (/.*)/slurm.conf" {
 
70
        -re "SLURM_CONF.*= (/.*)/slurm.conf.*SLURM_VERSION" {
70
71
                set config_dir $expect_out(1,string)
71
72
                exp_continue
72
73
        }
97
98
 
98
99
        exec $bin_cp $spank_conf_file $orig_spank_conf
99
100
        exec $bin_cp $spank_conf_file $new_spank_conf
 
101
        exec $bin_chmod 700 $spank_conf_file
 
102
        exec $bin_chmod 700 $new_spank_conf
100
103
} else {
101
104
        exec $bin_cp /dev/null $new_spank_conf
102
105
}
113
116
        }
114
117
}
115
118
 
 
119
# Allow enough time for configuration file in NFS to be propogated
 
120
# to all nodes of cluster
 
121
exec sleep 60 
 
122
 
116
123
#
117
124
# Test of srun help message
118
125
#
119
126
# NOTE: Expect parsing failures have been noted running "$srun --help" 
120
127
#       directly, so we build a script containing a pipe to tail
121
128
#
 
129
 
122
130
make_bash_script $file_in "$srun --help | $bin_grep test"
 
131
 
123
132
set matches 0
124
133
set srun_pid [spawn $file_in]
125
134
expect {
146
155
}
147
156
 
148
157
#
 
158
# Test of alloc help message
 
159
#
 
160
# NOTE: Expect parsing failures have been noted running "$salloc --help" 
 
161
#       directly, so we build a script containing a pipe to tail
 
162
#
 
163
 
 
164
make_bash_script $file_in "$salloc --help | $bin_grep test"
 
165
 
 
166
set matches 0
 
167
set srun_pid [spawn $file_in]
 
168
expect {
 
169
        -re "Registered component of slurm test suite" {
 
170
                incr matches
 
171
                exp_continue
 
172
        }
 
173
        timeout {
 
174
                send_user "\nFAILURE: salloc not responding\n"
 
175
                slow_kill $srun_pid
 
176
                set exit_code 1
 
177
        }
 
178
        eof {
 
179
                wait
 
180
        }
 
181
}
 
182
if {$matches != 1} {
 
183
        send_user "\nFAILURE: spank help message not in salloc help message\n"
 
184
        set exit_code 1
 
185
}
 
186
 
 
187
#
 
188
# Test of sbatch help message
 
189
#
 
190
# NOTE: Expect parsing failures have been noted running "$sbatch --help" 
 
191
#       directly, so we build a script containing a pipe to tail
 
192
#
 
193
 
 
194
make_bash_script $file_in "$sbatch --help | $bin_grep test"
 
195
 
 
196
set matches 0
 
197
set srun_pid [spawn $file_in]
 
198
expect {
 
199
        -re "Registered component of slurm test suite" {
 
200
                incr matches
 
201
                exp_continue
 
202
        }
 
203
        timeout {
 
204
                send_user "\nFAILURE: srun not responding\n"
 
205
                slow_kill $srun_pid
 
206
                set exit_code 1
 
207
        }
 
208
        eof {
 
209
                wait
 
210
        }
 
211
}
 
212
if {$matches != 1} {
 
213
        send_user "\nFAILURE: spank help message not in sbatch help message\n"
 
214
        set exit_code 1
 
215
}
 
216
exec $bin_rm -f $file_in
 
217
 
 
218
#
149
219
# Test of locally logged messages().
150
220
# We update the plugstatck.conf in this script since NFS delays may 
151
221
# prevent it from having the same state as the submit host. 
158
228
    $bin_cp $orig_spank_conf $spank_conf_file
159
229
  fi
160
230
"
161
 
spawn $sbatch -N1 -t1 -o $file_out $file_in
 
231
set matches 0
 
232
spawn $sbatch --test_suite_reg=4 -N1 -t1 -o $file_out $file_in
162
233
expect {
 
234
        -re "_test_opt_process: test_suite: opt_arg=4" {
 
235
                incr matches
 
236
                exp_continue
 
237
        }
 
238
        -re "slurm_spank_exit: opt_arg=4" {
 
239
                incr matches
 
240
                exp_continue
 
241
        }
163
242
        -re timeout {
164
243
                send_user "\nFAILURE: sbatch not responding\n"
165
244
                set exit_code 1
168
247
                wait
169
248
        }
170
249
}
 
250
if {$matches != 2} {
 
251
        send_user "\nFAILURE: spank options not processed by sbatch\n"
 
252
        set exit_code 1
 
253
}
171
254
 
172
255
# NOTE: spank logs from sbatch and srun would be intermingled here
173
256
if {[wait_for_file $file_out] == 0} {
213
296
#
214
297
if {[wait_for_file $spank_out] == 0} {
215
298
        send_user "\n\n"
216
 
        set matches 0
217
 
        spawn $bin_cat $spank_out
 
299
        set matches        0
 
300
        set matches_sbatch 0
 
301
        set matches_srun   0
 
302
        spawn $bin_sort $spank_out
218
303
        expect {
219
 
                -re "slurm_spank_task_init: opt_arg=5" {
 
304
                -re "slurm_spank_exit: opt_arg=($number)" {
 
305
                        if {$expect_out(1,string) == 4} {
 
306
                                incr matches_sbatch
 
307
                        }
 
308
                        if {$expect_out(1,string) == 5} {
 
309
                                incr matches_srun
 
310
                        }
 
311
                        exp_continue
 
312
                }
 
313
                -re "slurm_spank_task_init: opt_arg=($number)" {
 
314
                        if {$expect_out(1,string) == 4} {
 
315
                                incr matches_sbatch
 
316
                        }
 
317
                        if {$expect_out(1,string) == 5} {
 
318
                                incr matches_srun
 
319
                        }
 
320
                        exp_continue
 
321
                }
 
322
                -re "spank_get_item: argv" {
220
323
                        incr matches
221
324
                        exp_continue
222
325
                }
224
327
                        incr matches
225
328
                        exp_continue
226
329
                }
227
 
                -re "spank_get_item: argv" {
228
 
                        incr matches
229
 
                        exp_continue
230
 
                }
231
 
                -re "slurm_spank_exit: opt_arg=5" {
232
 
                        incr matches
233
 
                        exp_continue
234
 
                }
235
330
                eof {
236
331
                        wait
237
332
                }
238
333
        }
239
 
        if {$matches != 4} {
240
 
                send_user "\nFAILURE: remote (slurmd) spank plugin failure\n"
 
334
        if {$matches_sbatch != 2} {
 
335
                send_user "\nFAILURE: remote (slurmd) sbatch spank plugin failure ($matches_sbatch)\n"
 
336
                set exit_code 1
 
337
        } elseif {$matches_srun != 2} {
 
338
                send_user "\nFAILURE: remote (slurmd) srun spank plugin failure ($matches_srun)\n"
 
339
                set exit_code 1
 
340
        } elseif {$matches != 4} {
 
341
                send_user "\nFAILURE: remote (slurmd) spank plugin failure ($matches)\n"
241
342
                set exit_code 1
242
343
        } else {
243
344
                send_user "\n remote (slurmd) spank plugin success\n"