~ubuntu-branches/ubuntu/precise/slurm-llnl/precise

« back to all changes in this revision

Viewing changes to testsuite/expect/test15.26

  • Committer: Bazaar Package Importer
  • Author(s): Gennaro Oliva
  • Date: 2011-04-08 11:21:17 UTC
  • mfrom: (3.3.16 sid)
  • Revision ID: james.westby@ubuntu.com-20110408112117-nfnyq9dtm55hqoaw
Tags: 2.2.4-1
* New upstream releases 
* Cleaning spare file and directories, not belonging to the sources
  generated by the building process and not removed by distclean.
  Added debian/clean with spare files and rm -rf inside debian/rules
  for directories.
* Added new packages libslurm-perl, libslurmdb-perl, slurm-llnl-torque
  (Closes: #575822) thanks to Julien Blache

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/expect
 
2
############################################################################
 
3
# Purpose: Test of SLURM functionality
 
4
#          Test interuption of salloc while waiting for resource allocation.
 
5
#
 
6
# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
 
7
#          "FAILURE: ..." otherwise with an explanation of the failure, OR
 
8
#          anything else indicates a failure mode that must be investigated.
 
9
############################################################################
 
10
# Copyright (C) 2002-2007 The Regents of the University of California.
 
11
# Copyright (C) 2008-2010 Lawrence Livermore National Security
 
12
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 
13
# Written by Morris Jette <jette1@llnl.gov>
 
14
# CODE-OCEC-09-009. All rights reserved.
 
15
#
 
16
# This file is part of SLURM, a resource management program.
 
17
# For details, see <https://computing.llnl.gov/linux/slurm/>.
 
18
# Please also read the included file: DISCLAIMER.
 
19
#
 
20
# SLURM is free software; you can redistribute it and/or modify it under
 
21
# the terms of the GNU General Public License as published by the Free
 
22
# Software Foundation; either version 2 of the License, or (at your option)
 
23
# any later version.
 
24
#
 
25
# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
 
26
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
27
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
28
# details.
 
29
#
 
30
# You should have received a copy of the GNU General Public License along
 
31
# with SLURM; if not, write to the Free Software Foundation, Inc.,
 
32
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 
33
############################################################################
 
34
source ./globals
 
35
 
 
36
set test_id     "15.26"
 
37
set exit_code   0
 
38
set matches     0
 
39
 
 
40
print_header $test_id
 
41
 
 
42
if { [test_xcpu] } {
 
43
        send_user "\nWARNING: This test is incompatible with XCPU systems\n"
 
44
        exit $exit_code
 
45
}
 
46
 
 
47
#
 
48
# Spawn initial program via srun
 
49
# Send the signal while the srun is waiting for a resource allocation
 
50
#
 
51
set salloc_pid [spawn $salloc -N1 -t1 --begin=noon -v $bin_sleep 1]
 
52
expect {
 
53
        -re "queued and waiting for resources" {
 
54
                incr matches
 
55
                exec $bin_kill -INT $salloc_pid
 
56
                send_user "\nSent SIGINT\n"
 
57
                exp_continue
 
58
        }
 
59
        -re "Job allocation ($number) has been revoked" {
 
60
                incr matches
 
61
                exp_continue
 
62
        }
 
63
        timeout {
 
64
                send_user "\nFAILURE: salloc not responding\n"
 
65
                set matches -999
 
66
                slow_kill $salloc_pid
 
67
                set exit_code 1
 
68
        }
 
69
        eof {
 
70
                send_user "\nEOF\n"
 
71
                wait
 
72
        }
 
73
}
 
74
if {$matches != 2} {
 
75
        send_user "\nFAILURE: salloc failed to process SIGINT while waiting for allocation\n"
 
76
        set exit_code 1
 
77
}
 
78
 
 
79
#
 
80
# Post-processing
 
81
#
 
82
if {$exit_code == 0} {
 
83
        send_user "\nSUCCESS\n"
 
84
}
 
85
exit $exit_code