Skip to content
Snippets Groups Projects
Commit 32ec9d7a authored by Morris Jette's avatar Morris Jette
Browse files

Modify test to work on system with < 5 nodes

parent e070114f
No related branches found
No related tags found
No related merge requests found
...@@ -143,9 +143,11 @@ expect { ...@@ -143,9 +143,11 @@ expect {
} }
} }
set node_cnt 0
spawn $bin_bash -c "$scontrol show nodes $node_list | grep CPUTot" spawn $bin_bash -c "$scontrol show nodes $node_list | grep CPUTot"
expect { expect {
-re "CPUTot=($number)" { -re "CPUTot=($number)" {
incr node_cnt
if { $expect_out(1,string) > $highest_cpu_cnt } { if { $expect_out(1,string) > $highest_cpu_cnt } {
set highest_cpu_cnt $expect_out(1,string) set highest_cpu_cnt $expect_out(1,string)
} }
...@@ -160,31 +162,30 @@ expect { ...@@ -160,31 +162,30 @@ expect {
} }
} }
# Choose a cpu count greater then highest cpu node (job should use 2 nodes) # Choose a CPU count equal to the highest CPU node (job should use 1 node)
set cpu_test_cnt [expr $highest_cpu_cnt + 1]
# Submit a job to the default partition
sub_job $cpu_test_cnt $default_part
set exp_nodes [expr ($cpu_test_cnt - 1)/$highest_cpu_cnt + 1]
check_node_cnt $exp_nodes
cancel_job $job_id
# Choose a cpu count greater then highest cpu node (job should use 1 node)
set cpu_test_cnt $highest_cpu_cnt set cpu_test_cnt $highest_cpu_cnt
sub_job $cpu_test_cnt $default_part sub_job $cpu_test_cnt $default_part
set exp_nodes [expr ($cpu_test_cnt - 1)/$highest_cpu_cnt + 1] set exp_nodes [expr ($cpu_test_cnt - 1)/$highest_cpu_cnt + 1]
check_node_cnt $exp_nodes check_node_cnt $exp_nodes
cancel_job $job_id cancel_job $job_id
# Choose a cpu count greater then highest cpu node (job should use 5 node) # Choose a CPU count greater then highest CPU node (job should use 2 nodes)
set cpu_test_cnt [expr $highest_cpu_cnt * 4 + 1] if {$node_cnt >= 2} {
sub_job $cpu_test_cnt $default_part set cpu_test_cnt [expr $highest_cpu_cnt + 1]
sub_job $cpu_test_cnt $default_part
set exp_nodes [expr ($cpu_test_cnt - 1)/$highest_cpu_cnt + 1]
check_node_cnt $exp_nodes
cancel_job $job_id
}
set exp_nodes [expr ($cpu_test_cnt - 1)/$highest_cpu_cnt + 1] # Choose a CPU count greater then highest CPU node (job should use 5 nodes)
check_node_cnt $exp_nodes if {$node_cnt >= 5} {
cancel_job $job_id set cpu_test_cnt [expr $highest_cpu_cnt * 4 + 1]
sub_job $cpu_test_cnt $default_part
set exp_nodes [expr ($cpu_test_cnt - 1)/$highest_cpu_cnt + 1]
check_node_cnt $exp_nodes
cancel_job $job_id
}
################## Test with new parition ################## ################## Test with new parition ##################
......
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