diff --git a/testsuite/expect/globals b/testsuite/expect/globals index 31c858a89de7ea71351f7cbf295f3f6773913283..751fd445c7d09ab053a6651b5adee705a50ac285 100755 --- a/testsuite/expect/globals +++ b/testsuite/expect/globals @@ -4679,49 +4679,17 @@ proc check_job_state { job state } { # # Proc: get_craynetwork_count # -# Returns number of craynetwork GRES in the default partition +# For a given node count, returns number of craynetowrks per node on +# those "node_count" nodes with the highest craynetworks counts +# For example: node1 has 1 craynetwork, node2 has 2 craynetworks and +# node3 has 3 craynetworks +# [get_craynetwork_count 1] returns 3 (i.e. 1 node 3 craynetworks) +# [get_craynetwork_count 2] returns 2 (i.e. 2 nodes have at least 2 each) +# [get_craynetwork_count 3] returns 1 (i.e. 3 nodes have at least 1 each) # ################################################################ -proc get_craynetwork_count {} { - global number sbatch scancel - set count 0 - set fini 0 - log_user 0 - for {set inx 1} {$fini == 0} {set inx [expr $inx * 2]} { - set job_id 0 - if {$inx > 32} { - set count -1 - break - } - spawn $sbatch --gres=craynetwork:$inx --output=/dev/null --wrap "exit 0" - expect { - -re "Invalid generic resource" { - set fini 1 - exp_continue - } - -re "Requested node configuration is not available" { - set fini 1 - exp_continue - } - -re "Submitted batch job ($number)" { - set job_id $expect_out(1,string) - set count $inx - exp_continue - } - timeout { - send_user "\nFAILURE: sbatch not responding\n" - set fini 1 - } - eof { - wait - } - } - if {$job_id != 0} { - exec $scancel -Q $job_id - } - } - log_user 1 - return $count +proc get_craynetwork_count { {node_count 1} } { + get_gres_count $node_count "craynetwork" } ################################################################