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

« back to all changes in this revision

Viewing changes to testsuite/expect/test24.1

  • 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
#!/usr/bin/expect
 
2
############################################################################
 
3
# Purpose:  Test of priority multifactor algo to get correct decay and
 
4
#           such.
 
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
# Note:    This script generates and then deletes files in the working directory
 
11
#          named test24.1.prog
 
12
############################################################################
 
13
# Copyright (C) 2009 Lawrence Livermore National Security.
 
14
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 
15
# Written by Danny Auble <da@llnl.gov>
 
16
# CODE-OCEC-09-009. All rights reserved.
 
17
 
18
# This file is part of SLURM, a resource management program.
 
19
# For details, see <https://computing.llnl.gov/linux/slurm/>.
 
20
# Please also read the included file: DISCLAIMER.
 
21
#  
 
22
# SLURM is free software; you can redistribute it and/or modify it under
 
23
# the terms of the GNU General Public License as published by the Free
 
24
# Software Foundation; either version 2 of the License, or (at your option)
 
25
# any later version.
 
26
 
27
# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
 
28
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
29
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
30
# details.
 
31
 
32
# You should have received a copy of the GNU General Public License along
 
33
# with SLURM; if not, write to the Free Software Foundation, Inc.,
 
34
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 
35
############################################################################
 
36
source ./globals
 
37
 
 
38
set test_id     "24.1"
 
39
set exit_code   0
 
40
set test_prog   "test$test_id.prog"
 
41
set matches     0
 
42
print_header $test_id
 
43
 
 
44
#
 
45
# Delete left-over programs and rebuild them 
 
46
#
 
47
file delete $test_prog
 
48
 
 
49
send_user "build_dir is $build_dir\n"
 
50
if {[test_aix]} {
 
51
        send_user "$bin_cc ${test_prog}.c -ldl -lntbl -fno-gcse -fno-strict-aliasing -Wl,-brtl -Wl,-bgcbypass:1000 -Wl,-bexpfull -Wl,-bmaxdata:0x70000000 -Wl,-brtl -g -lpthreads -o ${test_prog} -I${build_dir} -I${src_dir} ${build_dir}/src/api/libslurm.o ${build_dir}/src/slurmctld/locks.o  ${build_dir}/src/sshare/process.o\n"
 
52
        exec       $bin_cc ${test_prog}.c -ldl -lntbl -fno-gcse -fno-strict-aliasing -Wl,-brtl -Wl,-bgcbypass:1000 -Wl,-bexpfull -Wl,-bmaxdata:0x70000000 -Wl,-brtl -g -lpthreads -o ${test_prog} -I${build_dir} -I${src_dir} ${build_dir}/src/api/libslurm.o ${build_dir}/src/slurmctld/locks.o  ${build_dir}/src/sshare/process.o 
 
53
} else {
 
54
        send_user "$bin_cc ${test_prog}.c -g -pthread -o ${test_prog} -I${build_dir} -I${src_dir} ${build_dir}/src/api/libslurm.o ${build_dir}/src/slurmctld/locks.o  ${build_dir}/src/sshare/process.o -ldl -export-dynamic \n"
 
55
        exec       $bin_cc ${test_prog}.c -g -pthread -o ${test_prog} -I${build_dir} -I${src_dir} ${build_dir}/src/api/libslurm.o ${build_dir}/src/slurmctld/locks.o ${build_dir}/src/sshare/process.o -ldl -export-dynamic 
 
56
}
 
57
        exec $bin_chmod 700 $test_prog
 
58
 
 
59
# Usage: test24.1.prog
 
60
spawn ./$test_prog
 
61
expect {
 
62
        "No last decay" {
 
63
                send_user "This error is expected.  No worries.\n"
 
64
                exp_continue
 
65
        }
 
66
        "error: Can't save decay state" {
 
67
                send_user "This error is expected.  No worries.\n"
 
68
                exp_continue
 
69
        }
 
70
        "AccountA||40|0.400000|45|0.450000|0.450000|" {
 
71
                incr matches
 
72
                exp_continue
 
73
        }
 
74
        "AccountB||30|0.300000|20|0.200000|0.387500|" {
 
75
                incr matches
 
76
                exp_continue
 
77
        }
 
78
        "AccountB|User1|1|0.300000|20|0.200000|0.387500|" {
 
79
                incr matches
 
80
                exp_continue
 
81
        }
 
82
        "AccountC||10|0.100000|25|0.250000|0.300000|" {
 
83
                incr matches
 
84
                exp_continue
 
85
        }
 
86
        "AccountC|User2|1|0.050000|25|0.250000|0.275000|" {
 
87
                incr matches
 
88
                exp_continue
 
89
        }
 
90
        "AccountC|User3|1|0.050000|0|0.000000|0.150000|" {
 
91
                incr matches
 
92
                exp_continue
 
93
        } 
 
94
        "AccountD||60|0.600000|25|0.250000|0.250000|" {
 
95
                incr matches
 
96
                exp_continue
 
97
        }
 
98
        "AccountE||25|0.250000|25|0.250000|0.250000|" {
 
99
                incr matches
 
100
                exp_continue
 
101
        }
 
102
        "AccountE|User4|1|0.250000|25|0.250000|0.250000|" {
 
103
                incr matches
 
104
                exp_continue
 
105
        }
 
106
        "AccountF||35|0.350000|0|0.000000|0.145833|" {
 
107
                incr matches
 
108
                exp_continue
 
109
        } 
 
110
        "AccountF|User5|1|0.350000|0|0.000000|0.145833|" {
 
111
                incr matches
 
112
                exp_continue
 
113
        }
 
114
        timeout {
 
115
                send_user "\nFAILURE: spawn IO not responding\n"
 
116
                cancel_job $job_id
 
117
                set exit_code 1
 
118
        }
 
119
        eof {
 
120
                wait
 
121
        }
 
122
}
 
123
 
 
124
if {$matches != 11} {
 
125
        send_user "\nFAILURE: we didn't get the correct priorities from the plugin $matches\n"
 
126
        set exit_code 1
 
127
}
 
128
 
 
129
if {$exit_code == 0} {
 
130
        file delete $test_prog
 
131
        send_user "\nSUCCESS\n"
 
132
}
 
133
exit $exit_code