View | Details | Raw Unified | Return to ticket 437
Collapse All | Expand All

(-)a/testsuite/expect/Makefile.am (+7 lines)
Lines 379-384 EXTRA_DIST = \ Link Here
379
	test20.2			\
379
	test20.2			\
380
	test20.3			\
380
	test20.3			\
381
	test20.4			\
381
	test20.4			\
382
	test20.5			\
383
	test20.6			\
384
	test20.7			\
385
	test20.8			\
386
	test20.9			\
387
	test20.10			\
388
	test20.11			\
382
	test21.1			\
389
	test21.1			\
383
	test21.2			\
390
	test21.2			\
384
	test21.3			\
391
	test21.3			\
(-)a/testsuite/expect/Makefile.in (+7 lines)
Lines 759-764 EXTRA_DIST = \ Link Here
759
	test20.2			\
759
	test20.2			\
760
	test20.3			\
760
	test20.3			\
761
	test20.4			\
761
	test20.4			\
762
	test20.5			\
763
	test20.6			\
764
	test20.7			\
765
	test20.8			\
766
	test20.9			\
767
	test20.10			\
768
	test20.11			\
762
	test21.1			\
769
	test21.1			\
763
	test21.2			\
770
	test21.2			\
764
	test21.3			\
771
	test21.3			\
(-)a/testsuite/expect/globals (+2 lines)
Lines 104-109 cset pbsnodes "${slurm_dir}/bin/pbsnodes" Link Here
104
cset qdel        "${slurm_dir}/bin/qdel"
104
cset qdel        "${slurm_dir}/bin/qdel"
105
cset qstat       "${slurm_dir}/bin/qstat"
105
cset qstat       "${slurm_dir}/bin/qstat"
106
cset qsub        "${slurm_dir}/bin/qsub"
106
cset qsub        "${slurm_dir}/bin/qsub"
107
cset qalter      "${slurm_dir}/bin/qalter"
108
cset qrerun      "${slurm_dir}/bin/qrerun"
107
109
108
# If length of string partition is zero, use output of function
110
# If length of string partition is zero, use output of function
109
#	default_partition, otherwise use the partition explicitly
111
#	default_partition, otherwise use the partition explicitly
(-)a/testsuite/expect/test20.1 (-1 / +1 lines)
Lines 50-56 exec rm -f $file_out $file_err Link Here
50
make_bash_script $file_in "$bin_echo HELLO; $bin_cat /dummy_file"
50
make_bash_script $file_in "$bin_echo HELLO; $bin_cat /dummy_file"
51
spawn $qsub -e $file_err -o $file_out $file_in
51
spawn $qsub -e $file_err -o $file_out $file_in
52
expect {
52
expect {
53
	-re "Submitted batch job ($number)" {
53
	-re "($number)" {
54
		set job_id $expect_out(1,string)
54
		set job_id $expect_out(1,string)
55
		exp_continue
55
		exp_continue
56
	}
56
	}
(-)a/testsuite/expect/test20.10 (+68 lines)
Line 0 Link Here
1
#!/usr/bin/expect
2
############################################################################
3
# Purpose: Test of SLURM functionality
4
#          Test for the qrerun --help option
5
#
6
#
7
# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
8
#          "FAILURE: ..." otherwise with an explanation of the failure, OR
9
#          anything else indicates a failure mode that must be investigated.
10
############################################################################
11
# Copyright (C) 2013 SchedMD LLC
12
# Written by Nathan Yee <nyee32@schedmd.com>
13
#
14
# This file is part of SLURM, a resource management program.
15
# For details, see <http://slurm.schedmd.com/>.
16
# Please also read the included file: DISCLAIMER.
17
#
18
# SLURM is free software; you can redistribute it and/or modify it under
19
# the terms of the GNU General Public License as published by the Free
20
# Software Foundation; either version 2 of the License, or (at your option)
21
# any later version.
22
#
23
# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
24
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
25
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
26
# details.
27
#
28
# You should have received a copy of the GNU General Public License along
29
# with SLURM; if not, write to the Free Software Foundation, Inc.,
30
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
31
############################################################################
32
source ./globals
33
34
set test_id    "test20.10"
35
set exit_code  0
36
37
print_header $test_id
38
39
if {[file executable $qrerun] == 0} {
40
	send_user "\nWARNING: qrerun was not found\n"
41
	exit 0
42
}
43
44
set found 0
45
spawn $qrerun --help
46
expect {
47
	-re "Usage:" {
48
		set found 1
49
		exp_continue
50
	}
51
	timeout {
52
		send_user "\nFAILURE: qrerun is not responding\n"
53
		set exit_code 1
54
	}
55
	eof {
56
		wait
57
	}
58
}
59
60
if {$found != 1} {
61
	send_user "\nFAILURE: qrerun --help option failed\n"
62
	set exit_code 1
63
}
64
65
if {$exit_code == 0} {
66
	send_user "\nSUCCESS\n"
67
}
68
exit $exit_code
(-)a/testsuite/expect/test20.11 (+73 lines)
Line 0 Link Here
1
#!/usr/bin/expect
2
############################################################################
3
# Purpose: Test of SLURM functionality
4
#          Test for the qrerun --man option
5
#
6
#
7
# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
8
#          "FAILURE: ..." otherwise with an explanation of the failure, OR
9
#          anything else indicates a failure mode that must be investigated.
10
############################################################################
11
# Copyright (C) 2013 SchedMD LLC
12
# Written by Nathan Yee <nyee32@schedmd.com>
13
#
14
# This file is part of SLURM, a resource management program.
15
# For details, see <http://slurm.schedmd.com/>.
16
# Please also read the included file: DISCLAIMER.
17
#
18
# SLURM is free software; you can redistribute it and/or modify it under
19
# the terms of the GNU General Public License as published by the Free
20
# Software Foundation; either version 2 of the License, or (at your option)
21
# any later version.
22
#
23
# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
24
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
25
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
26
# details.
27
#
28
# You should have received a copy of the GNU General Public License along
29
# with SLURM; if not, write to the Free Software Foundation, Inc.,
30
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
31
############################################################################
32
source ./globals
33
34
set test_id    "test20.11"
35
set exit_code  0
36
37
print_header $test_id
38
39
if {[file executable $qrerun] == 0} {
40
	send_user "\nWARNING: qrerun was not found\n"
41
	exit 0
42
}
43
44
set found 0
45
spawn $qrerun --man
46
expect {
47
	-re "SYNOPSIS" {
48
		# Wait for output then quit from man page
49
		sleep 2
50
		send "q\r"
51
		set found 1
52
		exp_continue
53
	}
54
	timeout {
55
		send_user "\nFAILURE: qrerun is not responding\n"
56
		set exit_code 1
57
	}
58
	eof {
59
		wait
60
	}
61
}
62
63
if {$found != 1} {
64
	send_user "\nFAILURE: qrerun --man command failed\n"
65
	set exit_code 1
66
}
67
68
if {$exit_code == 0} {
69
	send_user "\nSUCCESS\n"
70
}
71
exit $exit_code
72
73
(-)a/testsuite/expect/test20.2 (-1 / +1 lines)
Lines 57-63 set job_id 0 Link Here
57
make_bash_script $file_in "sleep 60"
57
make_bash_script $file_in "sleep 60"
58
spawn $qsub -o $file_out -N $job_name $file_in
58
spawn $qsub -o $file_out -N $job_name $file_in
59
expect {
59
expect {
60
	-re "Submitted batch job ($number)" {
60
	-re "($number)" {
61
		set job_id $expect_out(1,string)
61
		set job_id $expect_out(1,string)
62
		exp_continue
62
		exp_continue
63
	}
63
	}
(-)a/testsuite/expect/test20.5 (+68 lines)
Line 0 Link Here
1
#!/usr/bin/expect
2
############################################################################
3
# Purpose: Test of SLURM functionality
4
#          Test the qalter --help option
5
#
6
#
7
# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
8
#          "FAILURE: ..." otherwise with an explanation of the failure, OR
9
#          anything else indicates a failure mode that must be investigated.
10
############################################################################
11
# Copyright (C) 2013 SchedMD LLC
12
# Written by Nathan Yee <nyee32@schedmd.com>
13
#
14
# This file is part of SLURM, a resource management program.
15
# For details, see <http://slurm.schedmd.com/>.
16
# Please also read the included file: DISCLAIMER.
17
#
18
# SLURM is free software; you can redistribute it and/or modify it under
19
# the terms of the GNU General Public License as published by the Free
20
# Software Foundation; either version 2 of the License, or (at your option)
21
# any later version.
22
#
23
# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
24
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
25
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
26
# details.
27
#
28
# You should have received a copy of the GNU General Public License along
29
# with SLURM; if not, write to the Free Software Foundation, Inc.,
30
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
31
############################################################################
32
source ./globals
33
34
set test_id      "test20.5"
35
set exit_code    0
36
37
print_header $test_id
38
39
if {[file executable $qalter] == 0} {
40
	send_user "\nWARNING: $qalter does not exist\n"
41
	exit 0
42
}
43
44
set found 0
45
spawn $qalter --help
46
expect {
47
	-re "Usage:" {
48
		set found 1
49
		exp_continue
50
	}
51
	timeout {
52
		send_user "\nFAILURE: qalter is not responding\n"
53
		set exit_code 1
54
	}
55
	eof {
56
		wait
57
	}
58
}
59
60
if {$found != 1} {
61
	send_user "\nFAILURE: qalter's help option did not work\n"
62
	set exit_code 1
63
}
64
65
if {$exit_code == 0} {
66
	send_user "\nSUCCESS\n"
67
}
68
exit $exit_code
(-)a/testsuite/expect/test20.6 (+137 lines)
Line 0 Link Here
1
#!/usr/bin/expect
2
############################################################################
3
# Purpose: Test of SLURM functionality
4
#          Test the qalter -r option of altering
5
#          a job's rerunnable flag
6
#
7
#
8
# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
9
#          "FAILURE: ..." otherwise with an explanation of the failure, OR
10
#          anything else indicates a failure mode that must be investigated.
11
############################################################################
12
# Copyright (C) 2013 SchedMD LLC
13
# Written by Nathan Yee <nyee32@schedmd.com>
14
#
15
# This file is part of SLURM, a resource management program.
16
# For details, see <http://slurm.schedmd.com/>.
17
# Please also read the included file: DISCLAIMER.
18
#
19
# SLURM is free software; you can redistribute it and/or modify it under
20
# the terms of the GNU General Public License as published by the Free
21
# Software Foundation; either version 2 of the License, or (at your option)
22
# any later version.
23
#
24
# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
25
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
27
# details.
28
#
29
# You should have received a copy of the GNU General Public License along
30
# with SLURM; if not, write to the Free Software Foundation, Inc.,
31
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
32
############################################################################
33
source ./globals
34
35
set test_id      "test20.6"
36
set file_in      "$test_id\.script"
37
set job_id       0
38
set exit_code    0
39
40
print_header $test_id
41
42
if {[file executable $qsub] == 0} {
43
	send_user "\nWARNING: $qsub does not exits\n"
44
	exit 0
45
}
46
47
# Clean up any vestigial files
48
exec $bin_rm -f $file_in
49
50
make_bash_script $file_in "
51
52
sleep 50
53
"
54
55
proc check_rerun { arg job_id} {
56
57
	global scontrol exit_code
58
59
	set check_val 0
60
	spawn $scontrol show job $job_id
61
	expect {
62
		-re "Requeue=$arg" {
63
			set check_val 1
64
			exp_continue
65
		}
66
		timeout {
67
			send_user "\nFAILURE: scontrol is not responding\n"
68
			set exit_code 1
69
		}
70
		eof {
71
			wait
72
		}
73
	}
74
75
	if {$check_val != 1} {
76
		send_user "\nFAILURE: requeue for job $job_id was not"
77
		send_user " set correctly\n"
78
		set exit_code 1
79
	}
80
81
}
82
83
spawn $qsub -o /dev/null $file_in
84
expect {
85
	-re "($number)" {
86
		set job_id $expect_out(1,string)
87
		exp_continue
88
	}
89
	timeout {
90
		send_user "\nFAILURE: qsub is not responding\n"
91
		set exit_code 1
92
	}
93
	eof {
94
		wait
95
	}
96
}
97
98
if {$job_id == 0} {
99
	send_user "\nFAILURE: job was not submitted\n"
100
	set exit_code 1
101
}
102
103
spawn $qalter -r y $job_id
104
expect {
105
	timeout {
106
		send_user "\nFAILURE: qalter is not responding\n"
107
		set exit_code 1
108
	}
109
	eof {
110
		wait
111
	}
112
}
113
114
# 1 for "y" and 0 for "n"
115
check_rerun 1 $job_id
116
117
spawn $qalter -r n $job_id
118
expect {
119
	timeout {
120
		send_user "\nFAILURE: qalter is not responding\n"
121
		set exit_code 1
122
	}
123
	eof {
124
		wait
125
	}
126
}
127
128
# 1 for "y" and 0 for "n"
129
check_rerun 0 $job_id
130
131
cancel_job $job_id
132
133
if {$exit_code == 0} {
134
	exec $bin_rm -f $file_in
135
	send_user "\nSUCCESS\n"
136
}
137
exit $exit_code
(-)a/testsuite/expect/test20.7 (+130 lines)
Line 0 Link Here
1
#!/usr/bin/expect
2
############################################################################
3
# Purpose: Test of SLURM functionality
4
#          Test qalter's -o option for changing
5
#          the stdout path of a job.
6
#
7
#
8
# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
9
#          "FAILURE: ..." otherwise with an explanation of the failure, OR
10
#          anything else indicates a failure mode that must be investigated.
11
############################################################################
12
# Copyright (C) 2013 SchedMD LLC
13
# Written by Nathan Yee <nyee32@schedmd.com>
14
#
15
# This file is part of SLURM, a resource management program.
16
# For details, see <http://slurm.schedmd.com/>.
17
# Please also read the included file: DISCLAIMER.
18
#
19
# SLURM is free software; you can redistribute it and/or modify it under
20
# the terms of the GNU General Public License as published by the Free
21
# Software Foundation; either version 2 of the License, or (at your option)
22
# any later version.
23
#
24
# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
25
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
27
# details.
28
#
29
# You should have received a copy of the GNU General Public License along
30
# with SLURM; if not, write to the Free Software Foundation, Inc.,
31
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
32
############################################################################
33
source ./globals
34
35
set test_id      "test20.7"
36
set file_in      "$test_id\.script"
37
set out_path     "/tmp/null"
38
set exit_code    0
39
40
print_header $test_id
41
42
if {[file executable $qalter] == 0} {
43
	send_user "\nWARNING: $qalter does not exist\n"
44
	exit 0
45
}
46
47
if {[file executable $qsub] == 0} {
48
	send_user "\nWARNING: $qsub does not exits\n"
49
	exit 0
50
}
51
52
# Clean up any vestigial files
53
exec $bin_rm -f $file_in
54
55
make_bash_script $file_in "
56
57
sleep 200
58
"
59
60
61
proc check_output { path job_id} {
62
63
	global scontrol exit_code
64
65
	set check_out 0
66
	spawn $scontrol show job $job_id
67
	expect {
68
		-re "Comment=stdout=$path" {
69
			set check_out 1
70
			exp_continue
71
		}
72
		timeout {
73
			send_user "\nFAILURE: scontrol is not responding\n"
74
			set exit_code 1
75
		}
76
		eof {
77
			wait
78
		}
79
	}
80
81
	if {$check_out != 1} {
82
		send_user "\nFAILURE: output path for job $job_id was not set"
83
		send_user " to the correct value\n"
84
		set exit_code 1
85
	}
86
87
88
}
89
90
spawn $qsub -o /dev/null $file_in
91
expect {
92
	-re "($number)" {
93
		set job_id $expect_out(1,string)
94
		exp_continue
95
	}
96
	timeout {
97
		send_user "\nFAILURE: qsub is not responding\n"
98
		set exit_code 1
99
	}
100
	eof {
101
		wait
102
	}
103
}
104
105
if {$job_id == 0} {
106
	send_user "\nFAILURE: qsub did not submit job\n"
107
	set exit_code 1
108
}
109
110
set found 0
111
spawn $qalter -o $out_path $job_id
112
expect {
113
	timeout {
114
		send_user "\nFAILURE: qalter is not responding\n"
115
		set exit_code 1
116
	}
117
	eof {
118
		wait
119
	}
120
}
121
122
check_output $out_path $job_id
123
124
cancel_job $job_id
125
126
if {$exit_code == 0} {
127
	exec $bin_rm -f $file_in
128
	send_user "\nSUCCESS\n"
129
}
130
exit $exit_code
(-)a/testsuite/expect/test20.8 (+125 lines)
Line 0 Link Here
1
#!/usr/bin/expect
2
############################################################################
3
# Purpose: Test of SLURM functionality
4
#          Test the qalte -N option for changing
5
#          the name of a job.
6
#
7
#
8
# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
9
#          "FAILURE: ..." otherwise with an explanation of the failure, OR
10
#          anything else indicates a failure mode that must be investigated.
11
############################################################################
12
# Copyright (C) 2013 SchedMD LLC
13
# Written by Nathan Yee <nyee32@schedmd.com>
14
#
15
# This file is part of SLURM, a resource management program.
16
# For details, see <http://slurm.schedmd.com/>.
17
# Please also read the included file: DISCLAIMER.
18
#
19
# SLURM is free software; you can redistribute it and/or modify it under
20
# the terms of the GNU General Public License as published by the Free
21
# Software Foundation; either version 2 of the License, or (at your option)
22
# any later version.
23
#
24
# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
25
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
27
# details.
28
#
29
# You should have received a copy of the GNU General Public License along
30
# with SLURM; if not, write to the Free Software Foundation, Inc.,
31
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
32
############################################################################
33
source ./globals
34
35
set test_id     "test20.8"
36
set file_in     "$test_id\.script"
37
set job_name    "$test_id\.newname"
38
set job_id      0
39
set exit_code   0
40
41
print_header $test_id
42
43
if {[file executable $qalter] == 0} {
44
	send_user "\nWARNING: $qalter does not exist\n"
45
	exit 0
46
}
47
48
if {[file executable $qsub] == 0} {
49
	send_user "\nWARNING: $qalter does not exist\n"
50
	exit 0
51
}
52
53
# Clean up any vestigial files
54
exec $bin_rm -f $file_in
55
56
make_bash_script $file_in "
57
58
sleep 200
59
"
60
61
proc check_name { job_id name } {
62
63
	global scontrol exit_code
64
65
	set check_out 0
66
	spawn $scontrol show job $job_id
67
	expect {
68
		-re "Name=$name" {
69
			set check_out 1
70
			exp_continue
71
		}
72
		timeout {
73
			send_user "\nFAILURE: scontrol is not responding\n"
74
			set exit_code 1
75
		}
76
		eof {
77
			wait
78
		}
79
	}
80
81
	if {$check_out != 1} {
82
		send_user "\nFAILURE: job name for job $job_id was not changed\n"
83
		set exi_code 1
84
	}
85
86
}
87
88
spawn $qsub -o /dev/null $file_in
89
expect {
90
	-re "($number)" {
91
		set job_id $expect_out(1,string)
92
		exp_continue
93
	}
94
	timeout {
95
		send_user "\nFAILURE: qsub is not responding\n"
96
		set exit_code 1
97
	}
98
	eof {
99
		wait
100
	}
101
}
102
103
if {$job_id == 0} {
104
	send_user "\nFAILURE: qsub did not submit job\n"
105
	set exit_code 1
106
}
107
108
spawn $qalter -N $job_name $job_id
109
expect {
110
	timeout {
111
		send_user "\nFAILURE: qalter is not responding\n"
112
		set exit_code 1
113
	}
114
	eof {
115
		wait
116
	}
117
}
118
119
check_name $job_id $job_name
120
121
if {$exit_code == 0} {
122
	exec $bin_rm -f $file_in
123
	send_user "\nSUCCESS\n"
124
}
125
exit $exit_code
(-)a/testsuite/expect/test20.9 (+71 lines)
Line 0 Link Here
1
#!/usr/bin/expect
2
############################################################################
3
# Purpose: Test of SLURM functionality
4
#          Test for the qalter --man option
5
#
6
#
7
# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
8
#          "FAILURE: ..." otherwise with an explanation of the failure, OR
9
#          anything else indicates a failure mode that must be investigated.
10
############################################################################
11
# Copyright (C) 2013 SchedMD LLC
12
# Written by Nathan Yee <nyee32@schedmd.com>
13
#
14
# This file is part of SLURM, a resource management program.
15
# For details, see <http://slurm.schedmd.com/>.
16
# Please also read the included file: DISCLAIMER.
17
#
18
# SLURM is free software; you can redistribute it and/or modify it under
19
# the terms of the GNU General Public License as published by the Free
20
# Software Foundation; either version 2 of the License, or (at your option)
21
# any later version.
22
#
23
# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
24
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
25
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
26
# details.
27
#
28
# You should have received a copy of the GNU General Public License along
29
# with SLURM; if not, write to the Free Software Foundation, Inc.,
30
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
31
############################################################################
32
source ./globals
33
34
set test_id     "test20.9"
35
set exit_code   0
36
37
print_header $test_id
38
39
if {[file executable $qalter] == 0} {
40
	send_user "\nWARNING: $qalter does not exist\n"
41
	exit 0
42
}
43
44
set check 0
45
spawn $qalter --man
46
expect {
47
	-re "SYNOPSIS" {
48
		# Wait for output then quit from man page
49
		sleep 2
50
		send "q\r"
51
		set check 1
52
		exp_continue
53
	}
54
	timeout {
55
		send_user "\nFAILURE: qalter is not responding\n"
56
		set exit_code 1
57
	}
58
	eof {
59
		wait
60
	}
61
}
62
63
if {$check != 1} {
64
	send_user "\nFAILURE: qalter did not return the man pages\n"
65
	set exit_code 1
66
}
67
68
if {$exit_code == 0} {
69
	send_user "\nSUCCESS\n"
70
}
71
exit $exit_code

Return to ticket 437