Skip to content
Snippets Groups Projects
Commit 05f21d92 authored by Nathan Yee's avatar Nathan Yee Committed by Morris Jette
Browse files

Add test for invalid partition

Validate that sbatch, srun, salloc return partition error message
on invalid partition name.
bug 1223
parent ae13a710
No related branches found
No related tags found
No related merge requests found
...@@ -411,6 +411,7 @@ EXTRA_DIST = \ ...@@ -411,6 +411,7 @@ EXTRA_DIST = \
test17.38 \ test17.38 \
test17.39 \ test17.39 \
test17.40 \ test17.40 \
test17.41 \
test19.1 \ test19.1 \
test19.2 \ test19.2 \
test19.3 \ test19.3 \
......
...@@ -810,6 +810,7 @@ EXTRA_DIST = \ ...@@ -810,6 +810,7 @@ EXTRA_DIST = \
test17.38 \ test17.38 \
test17.39 \ test17.39 \
test17.40 \ test17.40 \
test17.41 \
test19.1 \ test19.1 \
test19.2 \ test19.2 \
test19.3 \ test19.3 \
......
...@@ -569,7 +569,8 @@ test17.36 Test that the shared option in partitions is enforced. ...@@ -569,7 +569,8 @@ test17.36 Test that the shared option in partitions is enforced.
test17.37 Validate that afternotok dependency is enforced. test17.37 Validate that afternotok dependency is enforced.
test17.38 Test for sbatch --signal. test17.38 Test for sbatch --signal.
test17.39 Validate dependecy OR option. test17.39 Validate dependecy OR option.
test17.34 Test of --thread-spec option. test17.40 Test of --thread-spec option.
test17.41 Validate that sbatch, srun, salloc return partition error message.
test19.# Testing of strigger options. test19.# Testing of strigger options.
......
#!/usr/bin/env expect
############################################################################
# Purpose: Test of SLURM functionality
# Validate that sbatch, srun, salloc return partition error message.
#
# Output: "TEST: #.#" followed by "SUCCESS" if test was successful, OR
# "FAILURE: ..." otherwise with an explanation of the failure, OR
# anything else indicates a failure mode that must be investigated.
############################################################################
# Copyright (C) 2015 SchedMD LLC
# Written by Nathan Yee <nyee32@schedmd.com>
#
# This file is part of SLURM, a resource management program.
# For details, see <http://slurm.schedmd.com/>.
# Please also read the included file: DISCLAIMER.
#
# SLURM is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along
# with SLURM; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
############################################################################
source ./globals
set test_id 17.41
set test_part [default_partition]
set part_inv "$test_part\g"
set file_in "test$test_id\.sc"
set exit_code 0
make_bash_script $file_in "sleep 1"
proc test_sbatch { part } {
global srun salloc sbatch exit_code file_in part_inv
send_user "\n=======Testing Values: $part=======\n"
send_user "\n====Testing sbatch====\n"
set match 0
spawn $sbatch -t1 -p$part -o/dev/null $file_in
expect {
-re "invalid partition specified: $part_inv" {
set match 1
exp_continue
}
timeout {
send_user "\nFAILURE: sbatch is not responding\n"
set exit_code 1
}
eof {
wait
}
}
if {$match == 0} {
send_user "\nFAILURE: error message was not correct\n"
set exit_code 1
}
send_user "\n====Testing srun====\n"
set match 0
spawn $srun -t1 -p$part -o/dev/null $file_in
expect {
-re "invalid partition specified: $part_inv" {
set match 1
exp_continue
}
timeout {
send_user "\nFAILURE: sbatch is not responding\n"
set exit_code 1
}
eof {
wait
}
}
if {$match == 0} {
send_user "\nFAILURE: error message was not correct\n"
set exit_code 1
}
send_user "\n====Testing salloc====\n"
set match 0
spawn $salloc -t1 -p$part $file_in
expect {
-re "invalid partition specified: $part_inv" {
set match 1
exp_continue
}
timeout {
send_user "\nFAILURE: sbatch is not responding\n"
set exit_code 1
}
eof {
wait
}
}
if {$match == 0} {
send_user "\nFAILURE: error message was not correct\n"
set exit_code 1
}
}
test_sbatch $test_part\g
test_sbatch "$test_part\,$test_part\g"
if {$exit_code == 0} {
exec $bin_rm -f $file_in
send_user "\nSUCCESS\n"
} else {
send_user "\nFAILURE\n"
}
exit $exit_code
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment