Skip to content
Snippets Groups Projects
Commit a8e82125 authored by Danny Auble's avatar Danny Auble
Browse files

better tests

parent f581597b
No related branches found
No related tags found
No related merge requests found
...@@ -61,7 +61,7 @@ set timeout $max_job_delay ...@@ -61,7 +61,7 @@ set timeout $max_job_delay
set srun_pid [spawn $srun -n1 -O $test_prog] set srun_pid [spawn $srun -n1 -O $test_prog]
expect { expect {
-re "Segmentation fault" { -re "Segmentation fault" {
send_user "\nThis error was expected, no worries\n" send_user "\nThis Seg Fault was expected, no worries\n"
set matches 1 set matches 1
exp_continue exp_continue
} }
......
...@@ -69,6 +69,7 @@ if {$job_id == 0} { ...@@ -69,6 +69,7 @@ if {$job_id == 0} {
exit 1 exit 1
} }
set status 1
spawn $qdel $job_id spawn $qdel $job_id
expect { expect {
-re "Invalid job id" { -re "Invalid job id" {
...@@ -81,15 +82,22 @@ expect { ...@@ -81,15 +82,22 @@ expect {
set exit_code 1 set exit_code 1
} }
eof { eof {
wait catch wait reason
set status [lindex $reason 3]
} }
} }
if {$status != 0} {
send_user "\nFAILURE: it appears things worked ok, but we got a non-zero exit from qdel\n"
set exit_code 1
}
set status 0
set matches 0 set matches 0
spawn $qdel $job_id spawn $qdel $job_id
expect { expect {
-re "already completing or completed" { -re "already completing or completed" {
send_user "\nThis error was expected, no worries\n" send_user "\nWe shouldn't see this because qdel doesn't print an error for this.\n"
incr matches incr matches
exp_continue exp_continue
} }
...@@ -98,10 +106,13 @@ expect { ...@@ -98,10 +106,13 @@ expect {
set exit_code 1 set exit_code 1
} }
eof { eof {
wait catch wait reason
set status [lindex $reason 3]
} }
} }
if {$matches != 1} {
# we should get and error code here from qdel, but no message
if {($matches != 0) || ($status == 0)} {
send_user "\nFAILURE: No error on attempt to cancel terminated job\n" send_user "\nFAILURE: No error on attempt to cancel terminated job\n"
set exit_code 1 set exit_code 1
} }
......
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