Skip to content
Snippets Groups Projects
Commit 1ce0d17b authored by Moe Jette's avatar Moe Jette
Browse files

Add more sbatch tests.

parent 53594831
No related branches found
No related tags found
No related merge requests found
...@@ -359,6 +359,12 @@ test17.7 Confirm that sbatch sets appropriate working directory (--chdir ...@@ -359,6 +359,12 @@ test17.7 Confirm that sbatch sets appropriate working directory (--chdir
test17.8 Confirm that sbatch sets appropriate time limit (--time test17.8 Confirm that sbatch sets appropriate time limit (--time
option) option)
test17.9 Confirm that sbatch sets appropriate job name (--job-name option) test17.9 Confirm that sbatch sets appropriate job name (--job-name option)
test17.10 Test of processors, memory, and temporary disk space
constraints options (--mincpus, --mem, and --tmp options).
Also test that priority zero job is not started (--hold
option).
test17.11 Test of shared and contiguous options (--shared and --contiguous).
Also uses --hold option.
test18.# Testing of slaunch options. test18.# Testing of slaunch options.
......
...@@ -9,11 +9,8 @@ ...@@ -9,11 +9,8 @@
# Output: "TEST: #.#" followed by "SUCCESS" if test was successful, OR # Output: "TEST: #.#" followed by "SUCCESS" if test was successful, OR
# "FAILURE: ..." otherwise with an explanation of the failure, OR # "FAILURE: ..." otherwise with an explanation of the failure, OR
# anything else indicates a failure mode that must be investigated. # anything else indicates a failure mode that must be investigated.
#
# Note: This script generates and then deletes files in the working directory
# named test1.12.input, test1.12.output, and test1.12.error
############################################################################ ############################################################################
# Copyright (C) 2002 The Regents of the University of California. # Copyright (C) 2002-2006 The Regents of the University of California.
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). # Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
# Written by Morris Jette <jette1@llnl.gov> # Written by Morris Jette <jette1@llnl.gov>
# UCRL-CODE-217948. # UCRL-CODE-217948.
...@@ -42,10 +39,10 @@ set exit_code 0 ...@@ -42,10 +39,10 @@ set exit_code 0
set file_in "test$test_id.input" set file_in "test$test_id.input"
set job_id 0 set job_id 0
set cpu_cnt 1 set cpu_cnt 1
set mem_size 13 set mem_size 13
set tmp_size 2 set tmp_size 2
set matches 0 set matches 0
print_header $test_id print_header $test_id
...@@ -55,7 +52,7 @@ print_header $test_id ...@@ -55,7 +52,7 @@ print_header $test_id
# #
exec $bin_rm -f $file_in exec $bin_rm -f $file_in
make_bash_script $file_in " make_bash_script $file_in "
$srun $bin_sleep 10 $bin_sleep 10
" "
# #
...@@ -82,7 +79,6 @@ if {$job_id == 0} { ...@@ -82,7 +79,6 @@ if {$job_id == 0} {
send_user "\nFAILURE: batch submit failure\n" send_user "\nFAILURE: batch submit failure\n"
exit 1 exit 1
} }
exec $bin_rm -f $file_in
# #
# Confirm constraints are registered and wait for job completion # Confirm constraints are registered and wait for job completion
...@@ -128,7 +124,6 @@ expect { ...@@ -128,7 +124,6 @@ expect {
} }
timeout { timeout {
send_user "\nFAILURE: scontrol not responding\n" send_user "\nFAILURE: scontrol not responding\n"
cancel_job $job_id
set exit_code 1 set exit_code 1
} }
eof { eof {
...@@ -142,6 +137,7 @@ if {$matches != 5} { ...@@ -142,6 +137,7 @@ if {$matches != 5} {
set exit_code 1 set exit_code 1
} }
if {$exit_code == 0} { if {$exit_code == 0} {
exec $bin_rm -f $file_in
send_user "\nSUCCESS\n" send_user "\nSUCCESS\n"
} }
exit $exit_code exit $exit_code
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# "FAILURE: ..." otherwise with an explanation of the failure, OR # "FAILURE: ..." otherwise with an explanation of the failure, OR
# anything else indicates a failure mode that must be investigated. # anything else indicates a failure mode that must be investigated.
############################################################################ ############################################################################
# Copyright (C) 2002 The Regents of the University of California. # Copyright (C) 2002-2006 The Regents of the University of California.
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). # Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
# Written by Morris Jette <jette1@llnl.gov> # Written by Morris Jette <jette1@llnl.gov>
# UCRL-CODE-217948. # UCRL-CODE-217948.
...@@ -55,6 +55,7 @@ expect { ...@@ -55,6 +55,7 @@ expect {
exp_continue exp_continue
} }
eof { eof {
wait
} }
} }
...@@ -80,10 +81,10 @@ if {$job_id != 0} { ...@@ -80,10 +81,10 @@ if {$job_id != 0} {
} }
timeout { timeout {
send_user "\nFAILURE: scontrol not responding\n" send_user "\nFAILURE: scontrol not responding\n"
cancel_job $job_id
set exit_code 1 set exit_code 1
} }
eof { eof {
wait
} }
} }
cancel_job $job_id cancel_job $job_id
...@@ -95,6 +96,7 @@ if {$job_id != 0} { ...@@ -95,6 +96,7 @@ if {$job_id != 0} {
# #
# Spawn a srun batch job with contiguous option only # Spawn a srun batch job with contiguous option only
# #
set job_id 0
spawn $srun --contiguous --hold --batch -t1 $bin_pwd spawn $srun --contiguous --hold --batch -t1 $bin_pwd
expect { expect {
-re "jobid ($number) submitted" { -re "jobid ($number) submitted" {
...@@ -106,6 +108,7 @@ expect { ...@@ -106,6 +108,7 @@ expect {
exit 1 exit 1
} }
eof { eof {
wait
} }
} }
...@@ -131,10 +134,10 @@ if {$job_id != 0} { ...@@ -131,10 +134,10 @@ if {$job_id != 0} {
} }
timeout { timeout {
send_user "\nFAILURE: scontrol not responding\n" send_user "\nFAILURE: scontrol not responding\n"
cancel_job $job_id
set exit_code 1 set exit_code 1
} }
eof { eof {
wait
} }
} }
cancel_job $job_id cancel_job $job_id
......
...@@ -47,7 +47,7 @@ print_header $test_id ...@@ -47,7 +47,7 @@ print_header $test_id
# #
exec $bin_rm -f $file_in exec $bin_rm -f $file_in
make_bash_script $file_in " make_bash_script $file_in "
if ((\$SLURM_PROCID== 1)) if ((\$SLURM_PROCID == 1))
then exit then exit
fi fi
$bin_sleep 300 $bin_sleep 300
......
#!/usr/bin/expect
############################################################################
# Purpose: Test of SLURM functionality
# Test of processors, memory, and temporary disk space
# constraints options (--mincpus, --mem, and --tmp options).
# Also test that priority zero job is not started (--hold
# option).
#
# 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) 2002-2006 The Regents of the University of California.
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
# Written by Morris Jette <jette1@llnl.gov>
# UCRL-CODE-217948.
#
# This file is part of SLURM, a resource management program.
# For details, see <http://www.llnl.gov/linux/slurm/>.
#
# 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.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
############################################################################
source ./globals
set test_id "17.10"
set exit_code 0
set file_in "test$test_id.input"
set job_id 0
set cpu_cnt 1
set mem_size 13
set tmp_size 2
set matches 0
print_header $test_id
# DISABLE FOR NOW
send_user "\nFAILURE: sbatch does not yet support --output option\n"
exit 0
#
# Delete left-over input script
# Build input script file
#
exec $bin_rm -f $file_in
make_bash_script $file_in "
$bin_sleep 10
"
#
# Spawn a sbatch job with constraints and stdout/err
#
spawn $sbatch --output=none --error=none --mincpus=$cpu_cnt --mem=$mem_size --tmp=$tmp_size --hold -t1 $file_in
expect {
-re "Submitted batch job ($number)" {
set job_id $expect_out(1,string)
exp_continue
}
timeout {
send_user "\nFAILURE: sbatch not responding\n"
set exit_code 1
exp_continue
}
eof {
wait
}
}
if {$job_id == 0} {
send_user "\nFAILURE: batch submit failure\n"
exit 1
}
#
# Confirm constraints are registered and wait for job completion
#
spawn $scontrol show job $job_id
expect {
-re "Priority=($number)" {
set read_prio $expect_out(1,string)
if {$read_prio == 0} {
incr matches
send_user "match of Priority\n"
}
exp_continue
}
-re "JobState=PENDING" {
incr matches
send_user "match of JobState\n"
exp_continue
}
-re "MinProcs=($number)" {
set read_proc $expect_out(1,string)
if {$read_proc == $cpu_cnt} {
incr matches
send_user "match of MinProcs\n"
}
exp_continue
}
-re "MinMemory=($number)" {
set read_mem $expect_out(1,string)
if {$read_mem == $mem_size} {
incr matches
send_user "match of MinMemory\n"
}
exp_continue
}
-re "MinTmpDisk=($number)" {
set read_disk $expect_out(1,string)
if {$read_disk == $tmp_size} {
incr matches
send_user "match of MinTmpDisk\n"
}
exp_continue
}
timeout {
send_user "\nFAILURE: scontrol not responding\n"
set exit_code 1
}
eof {
wait
}
}
cancel_job $job_id
if {$matches != 5} {
send_user "\nFAILURE: Did not get proper constraints\n"
set exit_code 1
}
if {$exit_code == 0} {
exec $bin_rm -f $file_in
send_user "\nSUCCESS\n"
}
exit $exit_code
#!/usr/bin/expect
############################################################################
# Purpose: Test of SLURM functionality
# Test of shared and contiguous options (--shared and --contiguous).
# Also uses --hold option.
#
# 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) 2002-2006 The Regents of the University of California.
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
# Written by Morris Jette <jette1@llnl.gov>
# UCRL-CODE-217948.
#
# This file is part of SLURM, a resource management program.
# For details, see <http://www.llnl.gov/linux/slurm/>.
#
# 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.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
############################################################################
source ./globals
set test_id "17.11"
set exit_code 0
set file_in "test$test_id.input"
set job_id 0
set matches 0
print_header $test_id
# DISABLE FOR NOW
send_user "\nFAILURE: sbatch does not yet support --output option\n"
exit 0
#
# Delete left-over input script
# Build input script file
#
exec $bin_rm -f $file_in
make_bash_script $file_in "
$bin_sleep 10
"
#
# Spawn a sbatch job with shared option only
#
spawn $sbatch --share --hold -t1 $file_in
expect {
-re "Submitted batch job ($number)" {
set job_id $expect_out(1,string)
exp_continue
}
timeout {
send_user "\nFAILURE: sbatch not responding\n"
set exit_code 1
exp_continue
}
eof {
wait
}
}
#
# Confirm shared and contiguous flag values
#
if {$job_id != 0} {
spawn $scontrol show job $job_id
expect {
-re "Shared=($number)" {
set shared_val $expect_out(1,string)
if {$shared_val == 1} {
incr matches
}
exp_continue
}
-re "Contiguous=($number)" {
set cont_val $expect_out(1,string)
if {$cont_val == 0} {
incr matches
}
exp_continue
}
timeout {
send_user "\nFAILURE: scontrol not responding\n"
set exit_code 1
}
eof {
wait
}
}
cancel_job $job_id
set job_id 0
} else {
set exit_code 1
}
#
# Spawn a sbatch job with contiguous option only
#
set job_id 0
spawn $sbatch --contiguous --hold -t1 $file_in
expect {
-re "Submitted batch job ($number)" {
set job_id $expect_out(1,string)
exp_continue
}
timeout {
send_user "\nFAILURE: sbatch not responding\n"
exit 1
}
eof {
wait
}
}
#
# Confirm shared and contiguous flag values
#
if {$job_id != 0} {
spawn $scontrol show job $job_id
expect {
-re "Shared=($number)" {
set shared_val $expect_out(1,string)
if {$shared_val == 0} {
incr matches
}
exp_continue
}
-re "Contiguous=($number)" {
set cont_val $expect_out(1,string)
if {$cont_val == 1} {
incr matches
}
exp_continue
}
timeout {
send_user "\nFAILURE: scontrol not responding\n"
set exit_code 1
}
eof {
wait
}
}
cancel_job $job_id
} else {
set exit_code 1
}
if {$matches != 4} {
send_user "\nFAILURE: Did not properly set shared and contiguous flags\n"
set exit_code 1
}
if {$exit_code == 0} {
exec $bin_rm -f $file_in
send_user "\nSUCCESS\n"
}
exit $exit_code
#!/usr/bin/expect
############################################################################
# Purpose: Test of SLURM functionality
# Verify node configuration specification (--constraint option).
#
# Output: "TEST: #.#" followed by "SUCCESS" if test was successful, OR
# "WARNING: ..." with an explanation of why the test can't be made, OR
# "FAILURE: ..." otherwise with an explanation of the failure, OR
# anything else indicates a failure mode that must be investigated.
############################################################################
# Copyright (C) 2002-2006 The Regents of the University of California.
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
# Written by Morris Jette <jette1@llnl.gov>
# UCRL-CODE-217948.
#
# This file is part of SLURM, a resource management program.
# For details, see <http://www.llnl.gov/linux/slurm/>.
#
# 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.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
############################################################################
source ./globals
set test_id "17.12"
set exit_code 0
set file_in "test$test_id.input"
print_header $test_id
#
# Delete left-over input script
# Build input script file
#
exec $bin_rm -f $file_in
make_bash_script $file_in "
$bin_sleep 10
"
#
# Submit a job with invalid constraint requirement
#
set err_msg 0
set timeout $max_job_delay
spawn $sbatch -N1 --constraint=invalid,constraint -t1 $file_in
expect {
-re "configuration is not available" {
send_user "This error is expected, no worries\n"
set err_msg 1
exp_continue
}
-re "Submitted batch job ($number)" {
send_user "\nFAILURE: sbatch job submitted with invalid constraint\n"
set exit_code 1
exp_continue
}
timeout {
send_user "\nFAILURE: sbatch not responding\n"
set exit_code 1
exp_continue
}
eof {
wait
}
}
if {$err_msg != 1} {
send_user "\nFAILURE: job failed to report required error\n"
set exit_code 1
}
if {$exit_code == 0} {
exec $bin_rm -f $file_in
send_user "\nSUCCESS\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