Skip to content
Snippets Groups Projects
Commit 9bbf5339 authored by David J. Bremer's avatar David J. Bremer
Browse files

Added test1.45 to test srun --preserve-env

parent c744a9d0
No related branches found
No related tags found
No related merge requests found
...@@ -59,6 +59,7 @@ EXTRA_DIST = \ ...@@ -59,6 +59,7 @@ EXTRA_DIST = \
test1.42 \ test1.42 \
test1.43 \ test1.43 \
test1.44 \ test1.44 \
test1.45 \
test1.46 \ test1.46 \
test1.47 \ test1.47 \
test1.48 \ test1.48 \
......
...@@ -295,6 +295,7 @@ EXTRA_DIST = \ ...@@ -295,6 +295,7 @@ EXTRA_DIST = \
test1.42 \ test1.42 \
test1.43 \ test1.43 \
test1.44 \ test1.44 \
test1.45 \
test1.46 \ test1.46 \
test1.47 \ test1.47 \
test1.48 \ test1.48 \
......
...@@ -139,7 +139,7 @@ test1.41 Validate SLURM debugger infrastructure (--debugger-test option). ...@@ -139,7 +139,7 @@ test1.41 Validate SLURM debugger infrastructure (--debugger-test option).
test1.42 Test of job dependencies (--dependency option). test1.42 Test of job dependencies (--dependency option).
test1.43 Test of slurm_job_will_run API, (srun --test-only option). test1.43 Test of slurm_job_will_run API, (srun --test-only option).
test1.44 Read srun's stdout slowly and test for lost data. test1.44 Read srun's stdout slowly and test for lost data.
test1.45 REMOVED test1.45 Test srun option --preserve-env
test1.46 Test srun option --kill-on-bad-exit test1.46 Test srun option --kill-on-bad-exit
test1.47 Test of job dependencies with singleton parameter. test1.47 Test of job dependencies with singleton parameter.
test1.48 Test of srun mail options (--mail-type and --mail-user options). test1.48 Test of srun mail options (--mail-type and --mail-user options).
......
#!/usr/bin/expect
############################################################################
# Purpose: Test of SLURM functionality
# Test that a job correctly uses the -E or --preserve-env flag.
#
# 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) 2008 Lawrence Livermore National Security
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
# Written by Dave Bremer <dbremer@llnl.gov>
# LLNL-CODE-402394.
#
# 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.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
############################################################################
source ./globals
set test_id "1.45"
set exit_code 0
set file_in "test$test_id.input"
set file_out "test$test_id.output"
set job_id 0
set min_nodes 1
set max_nodes 3
set num_procs 6
set num_nodes_test1 ""
set num_nodes_test2 ""
set num_nodes_test3 ""
set num_procs_test1 ""
set num_procs_test2 ""
set num_procs_test3 ""
print_header $test_id
if { [test_xcpu] } {
send_user "\nWARNING: This test is incompatable with XCPU systems\n"
exit 0
}
#
# Build input script file
#
make_bash_script $file_in "
$bin_printenv SLURM_NNODES
$srun -E -n1 -N1 $bin_printenv SLURM_NNODES
$bin_printenv SLURM_NPROCS
$srun --preserve-env -n1 -N1 $bin_printenv SLURM_NPROCS
$srun -n1 -N1 $bin_printenv SLURM_NNODES
$srun -n1 -N1 $bin_printenv SLURM_NPROCS"
#
# Run job to determine what nodes are available
#
spawn $sbatch -N$min_nodes-$max_nodes -n$num_procs -O -t1 --output=$file_out $file_in
expect {
-re "nodes *: ($number)" {
if {$expect_out(1,string) != 3} {
send_user "\nFAILURE: failed to process --nodes option\n"
set exit_code 1
}
exp_continue
}
-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
}
eof {
wait
}
}
if {$job_id == 0} {
send_user "\nFAILURE: job not submitted\n"
exit 1
}
if {[wait_for_job $job_id "DONE"] != 0} {
send_user "\nFAILURE: job did not complete\n"
cancel_job $job_id
exit 1
}
if {[wait_for_file $file_out] != 0} {
send_user "\nFAILURE: no output file\n"
exit 1
}
spawn $bin_cat $file_out
expect {
-re "($number)\r\n($number)\r\n($number)\r\n($number)\r\n($number)\r\n($number)" {
set num_nodes_test1 $expect_out(1,string)
set num_nodes_test2 $expect_out(2,string)
set num_procs_test1 $expect_out(3,string)
set num_procs_test2 $expect_out(4,string)
set num_nodes_test3 $expect_out(5,string)
set num_procs_test3 $expect_out(6,string)
}
eof {
wait
}
}
if {$num_nodes_test1 != $num_nodes_test2} {
send_user "\nFAILURE: SLURM_NNODES was not preserved ($num_nodes_test1 != $num_nodes_test2)\n"
set exit_code 1
}
if {$num_procs_test1 != $num_procs_test2} {
send_user "\nFAILURE: SLURM_NPROCS was not preserved ($num_procs_test1 != $num_procs_test2)\n"
set exit_code 1
}
if {$num_nodes_test3 != 1} {
send_user "\nFAILURE: SLURM_NNODES should be 1 ($num_nodes_test3 != 1)\n"
set exit_code 1
}
if {$num_procs_test3 != 1} {
send_user "\nFAILURE: SLURM_NPROCS should be 1 ($num_procs_test3 != 1)\n"
set exit_code 1
}
if {$exit_code == 0} {
exec $bin_rm $file_in $file_out
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