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

Change test output file to include test number

Avoid having stray slurm-#.out file that is difficult to identify
the source of
parent 6faf3a69
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,7 @@ set number "\[0-9\]+" ...@@ -38,6 +38,7 @@ set number "\[0-9\]+"
set name "banana" set name "banana"
set my_cmd ./mycmd set my_cmd ./mycmd
set file_in "test$test_id.in" set file_in "test$test_id.in"
set file_out "test$test_id.out"
# Set env path to SLURM_JOB_NAME # Set env path to SLURM_JOB_NAME
set env(SLURM_JOB_NAME) "zebra" set env(SLURM_JOB_NAME) "zebra"
...@@ -77,13 +78,11 @@ send_user "SUCCESS\n" ...@@ -77,13 +78,11 @@ send_user "SUCCESS\n"
# Tests -J using sbatch # Tests -J using sbatch
# #
set found 0 set found 0
set sbatch_pid [spawn $sbatch -J $name --wrap=env] set sbatch_pid [spawn $sbatch -J $name -o $file_out --wrap=env]
expect { expect {
-re "Submitted batch job ($number)" { -re "Submitted batch job ($number)" {
set job_id $expect_out(1,string) set job_id $expect_out(1,string)
exp_continue exp_continue
} }
timeout { timeout {
send_user "\nFAILURE: sbatch not responding\n" send_user "\nFAILURE: sbatch not responding\n"
...@@ -94,8 +93,8 @@ expect { ...@@ -94,8 +93,8 @@ expect {
wait wait
} }
} }
set wait_file [wait_for_file slurm-$job_id.out] set wait_file [wait_for_file $file_out]
spawn $bin_grep SLURM_JOB_NAME=banana slurm-$job_id.out spawn $bin_grep SLURM_JOB_NAME=banana $file_out
expect { expect {
-re "SLURM_JOB_NAME=($alpha_numeric)" { -re "SLURM_JOB_NAME=($alpha_numeric)" {
send_user "Job name matched $expect_out(1,string)\n" send_user "Job name matched $expect_out(1,string)\n"
...@@ -112,7 +111,7 @@ if {$found != 1} { ...@@ -112,7 +111,7 @@ if {$found != 1} {
exit 1 exit 1
} }
if {$exit_code == 0} { if {$exit_code == 0} {
exec $bin_rm -f slurm-$job_id.out exec $bin_rm -f $file_out
send_user "SUCCESS\n" send_user "SUCCESS\n"
} }
exec rm -f slurm-$job_id.out exec rm -f slurm-$job_id.out
......
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