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

handle failures in test better

parent 6770981b
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,7 @@ proc inc21_30_1 {} { ...@@ -32,6 +32,7 @@ proc inc21_30_1 {} {
#test GrpNode limit #test GrpNode limit
global srun salloc acct bin_sleep jobmatch job_id1 job_id2 number global srun salloc acct bin_sleep jobmatch job_id1 job_id2 number
global exit_code
set jobmatch 0 set jobmatch 0
spawn $salloc -N1 --account=$acct $srun $bin_sleep 10 spawn $salloc -N1 --account=$acct $srun $bin_sleep 10
...@@ -43,7 +44,7 @@ proc inc21_30_1 {} { ...@@ -43,7 +44,7 @@ proc inc21_30_1 {} {
} }
timeout { timeout {
send_user "\nFAILURE: salloc is not reponding\n" send_user "\nFAILURE: salloc is not reponding\n"
exit 1 set exit_code 1
} }
eof { eof {
wait wait
...@@ -59,7 +60,7 @@ proc inc21_30_1 {} { ...@@ -59,7 +60,7 @@ proc inc21_30_1 {} {
} }
timeout { timeout {
send_user "\nFAILURE: salloc is not reponding\n" send_user "\nFAILURE: salloc is not reponding\n"
exit 1 set exit_code 1
} }
eof { eof {
wait wait
...@@ -68,7 +69,7 @@ proc inc21_30_1 {} { ...@@ -68,7 +69,7 @@ proc inc21_30_1 {} {
if {$jobmatch==0} { if {$jobmatch==0} {
send_user "\nFAILURE: jobs were not submitted\n" send_user "\nFAILURE: jobs were not submitted\n"
exit 1 set exit_code 1
} }
# checks the state of the job # checks the state of the job
...@@ -77,5 +78,4 @@ proc inc21_30_1 {} { ...@@ -77,5 +78,4 @@ proc inc21_30_1 {} {
#cancels remaining jobs #cancels remaining jobs
cancel_job $job_id1 cancel_job $job_id1
cancel_job $job_id2 cancel_job $job_id2
} }
...@@ -120,6 +120,51 @@ proc mod_qos { node cpu job sub mcpu mnode mjobs mjobsub } { ...@@ -120,6 +120,51 @@ proc mod_qos { node cpu job sub mcpu mnode mjobs mjobsub } {
} }
proc endit { } {
global sacctmgr qostest acct test_id exit_code
# delete qos
spawn $sacctmgr -i delete qos $qostest
expect {
-re "Deleting QOS(s)" {
exp_continue
}
-re "Error" {
send_user "\nFAILURE: QOS was not deleted\n"
}
timeout {
send_user "\nFAILURE: sacctmgr is not responding\n"
}
eof {
wait
}
}
#delete account
spawn $sacctmgr -i delete account $acct
expect {
-re "Deleting accounts" {
exp_continue
}
-re "Error" {
send_user "\nFAILURE: account was not deleted\n"
set exit_code 1
}
timeout {
send_user "\nFAILURE: sacctmgr is not responding\n"
set exit_code 1
}
eof {
wait
}
}
if {$exit_code == 0} {
print_success $test_id
}
exit $exit_code
}
#gets user #gets user
spawn $bin_id -u -n spawn $bin_id -u -n
expect { expect {
...@@ -193,7 +238,9 @@ mod_qos $grn_num -1 -1 -1 -1 -1 -1 -1 ...@@ -193,7 +238,9 @@ mod_qos $grn_num -1 -1 -1 -1 -1 -1 -1
sleep 5 sleep 5
#test GrpNode limit #test GrpNode limit
inc21_30_1 inc21_30_1
if {$exit_code != 0} {
endit
}
mod_qos -1 $grcpu_num -1 -1 -1 -1 -1 -1 mod_qos -1 $grcpu_num -1 -1 -1 -1 -1 -1
...@@ -239,45 +286,4 @@ sleep 5 ...@@ -239,45 +286,4 @@ sleep 5
#test MaxJobsSubmits limit #test MaxJobsSubmits limit
inc21_30_8 inc21_30_8
# delete qos endit
spawn $sacctmgr -i delete qos $qostest
expect {
-re "Deleting QOS(s)" {
exp_continue
}
-re "Error" {
send_user "\nFAILURE: QOS was not deleted\n"
}
timeout {
send_user "\nFAILURE: sacctmgr is not responding\n"
}
eof {
wait
}
}
#delete account
spawn $sacctmgr -i delete account $acct
expect {
-re "Deleting accounts" {
exp_continue
}
-re "Error" {
send_user "\nFAILURE: account was not deleted\n"
set exit_code 1
}
timeout {
send_user "\nFAILURE: sacctmgr is not responding\n"
set exit_code 1
}
eof {
wait
}
}
if {$exit_code==0} {
print_success $test_id
}
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