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

several corrections in test logic

parent ac326bf5
No related branches found
No related tags found
No related merge requests found
...@@ -35,27 +35,23 @@ source ./globals ...@@ -35,27 +35,23 @@ source ./globals
set test_id "1.61" set test_id "1.61"
set exit_code 0 set exit_code 0
set job_id 0 set job_id 0
set file_in "test.$test_id.input" set file_in "test$test_id.input"
set file_out "test.$test_id.output" set file_out "test$test_id.output"
set file_err "test.$test_id.error" set file_err "test$test_id.error"
set test_acct "test_acct"
set timeout 60 set timeout 60
print_header $test_id
exec $bin_rm -f $file_in file_out file_err
# print_header $test_id
# Spawn a job via sbatch using this account
# exec $bin_rm -f $file_in file_out file_err
make_bash_script $file_in " make_bash_script $file_in "
$squeue -s $bin_date
$srun -t1 $scontrol show step \$SLURM_JOB_ID & $srun -t1 $scontrol show step \$SLURM_JOB_ID
$squeue -s $bin_date
$srun -t1 sleep 200 $srun -t1 sleep 200
$squeue -s $bin_date
$srun -t1 sleep 200 &
$squeue -s
" "
set job_id 0 set job_id 0
spawn $sbatch -t5 --output=$file_out --error=$file_err $file_in spawn $sbatch -t5 --output=$file_out --error=$file_err $file_in
expect { expect {
...@@ -73,44 +69,59 @@ expect { ...@@ -73,44 +69,59 @@ expect {
} }
if {$job_id == 0} { if {$job_id == 0} {
send_user "\nFAILURE: did not get sbatch job_id\n" send_user "\nFAILURE: did not get sbatch job_id\n"
set exit_code 1 exit 1
} }
# #
# Wait for step to begin execution # Wait for job completion
# #
if {[wait_for_step $job_id.2] == 0} { if {[wait_for_job $job_id DONE] != 0} {
cancel_job $job_id send_user "\nFAILURE: waiting for job to complete\n"
set exit_code 1
} }
spawn cat $file_out if {[wait_for_file $file_out] == 0} {
expect { set tl 0
-re " TimeLimit=00:01:00" { spawn cat $file_out
set tl $expect_out(1,string) expect {
exp_continue -re " TimeLimit=00:01:00" {
set tl 1
exp_continue
}
eof {
wait
}
} }
timeout { if {$tl == 0} {
send_user "\nFAILURE: srun time limit not set\n" send_user "\nFAILURE: srun time limit not found\n"
set exit_code 1 set exit_code 1
} }
eof { } else {
wait send_user "\nFAILURE: Job output file missing\n"
} set exit_code 1
} }
spawn cat $file_err if {[wait_for_file $file_err] == 0} {
expect { set tl 0
-re " STEP $job_id.1 CANCELLED AT.*DUE TO TIME LIMIT " { spawn cat $file_err
set tl $expect_out(1,string) expect {
exp_continue -re " STEP $job_id.1 CANCELLED AT.*DUE TO TIME LIMIT " {
set tl 1
exp_continue
}
eof {
wait
}
} }
timeout { if {$tl == 0} {
send_user "\nFAILURE: srun not cancelled\n" send_user "\nFAILURE: srun time limit not enforced\n"
set exit_code 1 set exit_code 1
} }
eof { } else {
wait send_user "\nFAILURE: Job error file missing\n"
} set exit_code 1
} }
if {$exit_code == 0} { if {$exit_code == 0} {
exec $bin_rm -f $file_in $file_out $file_err exec $bin_rm -f $file_in $file_out $file_err
send_user "\nSUCCESS\n" send_user "\nSUCCESS\n"
......
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