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

Rewrote most of 21.30 to work directly off limits instead of around the

limits
parent 4535783d
No related branches found
No related tags found
No related merge requests found
......@@ -29,12 +29,13 @@ proc inc21_30_1 {} {
#test GrpNode limit
global srun salloc acct bin_sleep number
global srun salloc acct bin_sleep number grn_num
global exit_code
send_user "\nStarting GrpNode limit test\n\n"
set job_id1 0
set job_id2 0
spawn $salloc -N1 --account=$acct $srun $bin_sleep 10
spawn $salloc -N$grn_num --account=$acct $srun $bin_sleep 10
expect {
-re "Granted job allocation ($number)" {
set job_id1 $expect_out(1,string)
......@@ -53,7 +54,7 @@ proc inc21_30_1 {} {
exit 1
}
spawn $salloc -N2 --account=$acct $srun $bin_sleep 10
spawn $salloc -N1 --account=$acct $srun $bin_sleep 10
expect {
-re "Granted job allocation ($number)" {
set job_id2 $expect_out(1,string)
......
......@@ -31,9 +31,11 @@ proc inc21_30_2 {} {
#test GrpCpus
global srun salloc acct bin_sleep jobmatch job_id1 job_id2 number exit_code
global grcpu_num
send_user "\nStarting GrpCPUs limit test\n\n"
set jobmatch 0
spawn $salloc --account=$acct -n6 $srun $bin_sleep 5
spawn $salloc --account=$acct -n$grcpu_num $srun $bin_sleep 5
expect {
-re "Granted job allocation ($number)" {
set job_id1 $expect_out(1,string)
......@@ -49,7 +51,7 @@ proc inc21_30_2 {} {
}
}
spawn $salloc --account=$acct -n6 $srun $bin_sleep 5
spawn $salloc --account=$acct -n1 $srun $bin_sleep 5
expect {
-re "job ($number)" {
set job_id2 $expect_out(1,string)
......
......@@ -30,56 +30,42 @@
proc inc21_30_3 {} {
# test GrpJob limits
global salloc srun acct bin_sleep jobmatch job_id1 job_id2 job_id3 number exit_code grjobs_num
global salloc srun acct bin_sleep jobmatch job_id1 job_id2 job_id3 number exit_code
send_user "\nStarting GrpJob limit test\n\n"
set check_num $grjobs_num
set jobmatch 0
spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
expect {
-re "Granted job allocation ($number)" {
set job_id1 $expect_out(1,string)
send_user "\njob $job_id1 was submitted\n"
incr jobmatch
}
timeout {
send_user "\nFAILURE: salloc is not responding\n"
set exit_code 1
}
eof {
wait
}
}
spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
expect {
-re "Granted job allocation ($number)" {
set job_id2 $expect_out(1,string)
send_user "\njob $job_id2 was submitted\n"
incr jobmatch
}
timeout {
send_user "\nFAILURE: salloc is not responding\n"
set exit_code 1
}
eof {
wait
}
}
spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
expect {
-re "job ($number)" {
set job_id3 $expect_out(1,string)
send_user "\nJob $job_id3 is waiting for resources. This is expected\n"
incr jobmatch
}
timeout {
send_user "\nFAILURE: salloc is not responding\n"
set exit_code 1
}
eof {
wait
for {set inx 0} {$inx <= $check_num} {incr inx} {
spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
expect {
-re "Granted job allocation ($number)" {
set job_id($inx) $expect_out(1,string)
if {$inx < $check_num} {
send_user "\njob $inx $job_id($inx) was submitted\n"
incr jobmatch
} else {
send_user "\nFAILURE: Job $inx $job_id($inx) wasn't suppose to work but it did, limit was $check_num?\n"
set exit_code 1
}
}
-re "job ($number) queued and waiting for resources" {
set job_id($inx) $expect_out(1,string)
if {$inx >= $check_num} {
send_user "\nJob $inx $job_id($inx) is waiting for resources. This is expected\n"
incr jobmatch
} else {
send_user "\nFAILURE: Job $inx $job_id($inx) was suppose to work but it didn't, limit was $check_num?\n"
set exit_code 1
}
}
timeout {
send_user "\nFAILURE: salloc is not responding\n"
set exit_code 1
}
eof {
wait
}
}
}
......@@ -89,13 +75,19 @@ proc inc21_30_3 {} {
}
#checks the job state
check_state $job_id3
# cancels the remaining jobs
cancel_job $job_id1
cancel_job $job_id2
cancel_job $job_id3
if [info exists job_id($check_num)] {
check_state $job_id($check_num)
} else {
send_user "\nFAILURE: didn't attempt to start enough jobs\n"
set exit_code 1
}
for {set inx 0} {$inx <= $check_num} {incr inx} {
if [info exists job_id($inx)] {
# cancels the jobs
cancel_job $job_id($inx)
}
}
}
......
......@@ -31,70 +31,54 @@ proc inc21_30_4 {} {
# test GrpSubmit
global salloc srun acct bin_sleep jobmatch job_id1 job_id2 job_id3 number exit_code
global salloc srun acct bin_sleep jobmatch job_id1 job_id2 job_id3 number exit_code grsub_num
set jobmatch 0
spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
expect {
-re "Granted job allocation ($number)" {
set job_id1 $expect_out(1,string)
send_user "\njob $job_id1 was submitted\n"
incr jobmatch
}
timeout {
send_user "\nFAILURE: salloc is not responding\n"
set exit_code 1
}
eof {
wait
}
}
send_user "\nStarting GrpSubmit limit test\n\n"
set check_num $grsub_num
spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
expect {
-re "Granted job allocation ($number)" {
set job_id2 $expect_out(1,string)
send_user "\njob $job_id2 was submitted\n"
incr jobmatch
}
timeout {
send_user "\nFAILURE: salloc is not responding\n"
set exit_code 1
}
eof {
wait
}
}
spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
expect {
-re "error" {
set job_id3 $expect_out(1,string)
send_user "\nThis error is expected do not worry\n"
incr jobmatch
}
-re "Granted job allocation" {
send_user "\nThis should have failed but did not\n"
set exit_code 1
}
timeout {
send_user "\nFAILURE: salloc is not responding\n"
set exit_code 1
}
eof {
wait
set jobmatch 0
for {set inx 0} {$inx <= $check_num} {incr inx} {
spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
expect {
-re "Granted job allocation ($number)" {
set job_id($inx) $expect_out(1,string)
if {$inx < $check_num} {
send_user "\njob $inx $job_id($inx) was submitted\n"
incr jobmatch
} else {
send_user "\nFAILURE: Job $inx $job_id($inx) wasn't suppose to work but it did, limit was $check_num?\n"
set exit_code 1
}
}
-re "error" {
if {$inx >= $check_num} {
send_user "\nJob $inx didn't get submitted. This is expected\n"
incr jobmatch
} else {
send_user "\nFAILURE: Job $inx $job_id($inx) was suppose to work but it didn't, limit was $check_num?\n"
set exit_code 1
}
}
timeout {
send_user "\nFAILURE: salloc is not responding\n"
set exit_code 1
}
eof {
wait
}
}
}
if {$jobmatch==0} {
if {$jobmatch == 0} {
send_user "\nFAILURE: jobs were not submitted\n"
set exit_code 1
}
# cancels the remaining jobs
cancel_job $job_id1
cancel_job $job_id2
cancel_job $job_id3
for {set inx 0} {$inx <= $check_num} {incr inx} {
if [info exists job_id($inx)] {
# cancels the jobs
cancel_job $job_id($inx)
}
}
}
......@@ -31,16 +31,40 @@ proc inc21_30_5 {} {
#test MaxCpus limits
global salloc acct number srun job_id1 bin_sleep
global salloc acct number srun bin_sleep maxcpu_num
spawn $salloc --account=$acct -n11 $srun $bin_sleep 2
send_user "\nStarting MaxCPUs limit test\n\n"
set job_id1 0
spawn $salloc --account=$acct -n$maxcpu_num $srun $bin_sleep 2
expect {
-re "job ($number)" {
set job_id1 $expect_out(1,string)
send_user "\nThis is expected do not worry\n"
}
-re "Granted job allocation ($number)" {
}
timeout {
send_user "\nFAILURE: salloc not responding\n"
set exit_code 1
}
eof {
wait
}
}
# cancels remaining jobs
cancel_job $job_id1
spawn $salloc --account=$acct -n[expr $maxcpu_num + 1] $srun $bin_sleep 2
expect {
-re "Pending job allocation ($number)" {
set job_id1 $expect_out(1,string)
send_user "\nThis is expected do not worry\n"
}
-re "Granted job allocation ($number)" {
send_user "\nFAILURE: This should have failed but did not\n"
send_user "\nFAILURE: This should have pended but did not\n"
set exit_code 1
}
timeout {
......
......@@ -31,16 +31,41 @@ proc inc21_30_6 {} {
#test MaxNode limit
global salloc acct number srun job_id1 bin_sleep
global salloc acct number srun job_id1 bin_sleep maxnode_num
spawn $salloc --account=$acct -N11 $srun $bin_sleep 2
send_user "\nStarting MaxNode limit test\n\n"
set job_id1 0
spawn $salloc --account=$acct -N$maxnode_num $srun $bin_sleep 2
expect {
-re "Granted job allocation ($number)" {
set job_id1 $expect_out(1,string)
}
-re "Pending job allocation ($number)" {
set job_id1 $expect_out(1,string)
send_user "\nFAILURE: This should have ran but did not\n"
set exit_code 1
}
timeout {
send_user "\nFAILURE: salloc not responding\n"
set exit_code 1
}
eof {
wait
}
}
# cancels remaining jobs
cancel_job $job_id1
spawn $salloc --account=$acct -N[expr $maxnode_num + 1] $srun $bin_sleep 2
expect {
-re "job ($number)" {
-re "Pending job allocation ($number)" {
set job_id1 $expect_out(1,string)
send_user "\nThis is expected do not worry\n"
}
-re "Granted job allocation ($number)" {
send_user "\nFAILURE: This should have failed but did not\n"
send_user "\nFAILURE: This should have pended but did not\n"
set exit_code 1
}
timeout {
......
......@@ -31,71 +31,62 @@ proc inc21_30_7 {} {
#test MaxJobs limit
global salloc srun acct bin_sleep jobmatch job_id1 job_id2 job_id3 number exit_code
global salloc srun acct bin_sleep jobmatch job_id1 job_id2 job_id3 number exit_code maxjobs_num
set jobmatch 0
spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
expect {
-re "Granted job allocation ($number)" {
set job_id1 $expect_out(1,string)
send_user "\njob $job_id1 was submitted\n"
incr jobmatch
}
timeout {
send_user "\nFAILURE: salloc is not responding\n"
set exit_code 1
}
eof {
wait
}
}
spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
expect {
-re "Granted job allocation ($number)" {
set job_id2 $expect_out(1,string)
send_user "\njob $job_id2 was submitted\n"
incr jobmatch
}
timeout {
send_user "\nFAILURE: salloc is not responding\n"
set exit_code 1
}
eof {
wait
}
}
send_user "\nStarting MaxJob limit test\n\n"
set check_num $maxjobs_num
spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
expect {
-re "job ($number)" {
set job_id3 $expect_out(1,string)
send_user "\nThis error is expected do not worry\n"
incr jobmatch
}
-re "Granted job allocation" {
send_user "\nThis should have failed but did not\n"
set exit_code 1
}
timeout {
send_user "\nFAILURE: salloc is not responding\n"
set exit_code 1
}
eof {
wait
set jobmatch 0
for {set inx 0} {$inx <= $check_num} {incr inx} {
spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
expect {
-re "Granted job allocation ($number)" {
set job_id($inx) $expect_out(1,string)
if {$inx < $check_num} {
send_user "\njob $inx $job_id($inx) was submitted\n"
incr jobmatch
} else {
send_user "\nFAILURE: Job $inx $job_id($inx) wasn't suppose to work but it did, limit was $check_num?\n"
set exit_code 1
}
}
-re "job ($number) queued and waiting for resources" {
set job_id($inx) $expect_out(1,string)
if {$inx >= $check_num} {
send_user "\nJob $inx $job_id($inx) is waiting for resources. This is expected\n"
incr jobmatch
} else {
send_user "\nFAILURE: Job $inx $job_id($inx) was suppose to work but it didn't, limit was $check_num?\n"
set exit_code 1
}
}
timeout {
send_user "\nFAILURE: salloc is not responding\n"
set exit_code 1
}
eof {
wait
}
}
}
check_state $job_id3
if {$jobmatch==0} {
send_user "\nFAILURE: jobs were not submitted\n"
set exit_code 1
}
# cancels the remaining jobs
cancel_job $job_id1
cancel_job $job_id2
cancel_job $job_id3
#checks the job state
if [info exists job_id($check_num)] {
check_state $job_id($check_num)
} else {
send_user "\nFAILURE: didn't attempt to start enough jobs\n"
set exit_code 1
}
for {set inx 0} {$inx <= $check_num} {incr inx} {
if [info exists job_id($inx)] {
# cancels the jobs
cancel_job $job_id($inx)
}
}
}
......@@ -31,66 +31,53 @@ proc inc21_30_8 {} {
#test MaxJobsSubmits limit
global salloc srun acct bin_sleep jobmatch job_id1 job_id2 job_id3 number exit_code
global salloc srun acct bin_sleep jobmatch job_id1 job_id2 job_id3 number exit_code maxjobsub_num
set jobmatch 0
spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
expect {
-re "Granted job allocation ($number)" {
set job_id1 $expect_out(1,string)
send_user "\njob $job_id1 was submitted\n"
incr jobmatch
}
timeout {
send_user "\nFAILURE: salloc is not responding\n"
set exit_code 1
}
eof {
wait
}
}
send_user "\nStarting MaxJobsSubmits limit test\n\n"
set check_num $maxjobsub_num
spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
expect {
-re "Granted job allocation ($number)" {
set job_id2 $expect_out(1,string)
send_user "\njob $job_id2 was submitted\n"
incr jobmatch
}
timeout {
send_user "\nFAILURE: salloc is not responding\n"
set exit_code 1
}
eof {
wait
set jobmatch 0
for {set inx 0} {$inx <= $check_num} {incr inx} {
spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
expect {
-re "Granted job allocation ($number)" {
set job_id($inx) $expect_out(1,string)
if {$inx < $check_num} {
send_user "\njob $inx $job_id($inx) was submitted\n"
incr jobmatch
} else {
send_user "\nFAILURE: Job $inx $job_id($inx) wasn't suppose to work but it did, limit was $check_num?\n"
set exit_code 1
}
}
-re "error" {
if {$inx >= $check_num} {
send_user "\nJob $inx didn't get submitted. This is expected\n"
incr jobmatch
} else {
send_user "\nFAILURE: Job $inx was suppose to work but it didn't, limit was $check_num?\n"
set exit_code 1
}
}
timeout {
send_user "\nFAILURE: salloc is not responding\n"
set exit_code 1
}
eof {
wait
}
}
}
spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
expect {
-re "error" {
send_user "\nThis error is expected do not worry\n"
incr jobmatch
}
-re "Granted job allocation" {
send_user "\nThis should have failed but did not\n"
set exit_code 1
}
timeout {
send_user "\nFAILURE: salloc is not responding\n"
set exit_code 1
}
eof {
wait
}
}
if {$jobmatch==0} {
if {$jobmatch == 0} {
send_user "\nFAILURE: jobs were not submitted\n"
set exit_code 1
}
# cancels the remaining jobs
cancel_job $job_id1
cancel_job $job_id2
for {set inx 0} {$inx <= $check_num} {incr inx} {
if [info exists job_id($inx)] {
# cancels the jobs
cancel_job $job_id($inx)
}
}
}
......@@ -42,9 +42,6 @@ source ./inc21.30.8
set test_id "21.30"
set exit_code 0
set acct test_acct
set job_id1 ""
set job_id2 ""
set job_id3 ""
set user_name ""
set qosname name
set qostest [format "%s %s" $test_id "qosTest"]
......@@ -89,7 +86,7 @@ proc check_state { job } {
if {$state_match != 1} {
send_user "\nFAILURE job should be pending, but is not\n"
exit 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