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

test hardening

parent b8e226ba
No related branches found
No related tags found
No related merge requests found
......@@ -2652,22 +2652,37 @@ proc get_node_cnt_in_part { partition } {
################################################################
proc get_idle_node_in_part { partition } {
global sinfo alpha_numeric_under
global scontrol sinfo alpha_numeric_nodelist alpha_numeric_under
log_user 0
set node_name ""
set scon_pid [spawn -noecho $sinfo -oNAME=%n -h -p$partition --state=idle]
set host_list ""
spawn $sinfo -oNAME=%N -h -p$partition --state=idle
expect {
-re "not found" {
send_user "\nFAILURE: partition $partition doesn't exist\n"
}
-re "NAME=($alpha_numeric_under)" {
-re "NAME=($alpha_numeric_nodelist)" {
set host_list $expect_out(1,string)
}
timeout {
send_user "\nFAILURE: sinfo not responding\n"
}
eof {
wait
}
}
set node_name ""
spawn $scontrol show hostname $host_list
expect {
-re "($alpha_numeric_under)" {
set node_name $expect_out(1,string)
}
timeout {
send_user "\nFAILURE: scontrol not responding\n"
}
eof {
wait
}
}
log_user 1
......
......@@ -94,8 +94,7 @@ proc cleanup { } {
spawn $scontrol delete partition=$part_name
expect {
-re "error" {
send_user "\nFAILURE: scontrol did not remove "
"partition\n"
send_user "\nFAILURE: scontrol did not remove partition $part_name\n"
set exit_code 1
exp_continue
}
......@@ -213,6 +212,10 @@ expect {
}
}
if { [string length $partition] == 0 } {
set partition [default_partition]
}
set node_name [ get_idle_node_in_part $partition ]
set cluster_name [ get_cluster_name ]
......
......@@ -53,7 +53,8 @@ if { [test_account_storage] == 0 } {
exit 0
}
if { [string compare [check_accounting_admin_level] "Administrator"] } {
send_user "\nWARNING: This test can't be run without being an Accounting administrator.\nUse sacctmgr mod user \$USER_NAME set admin=admin.\n"
send_user "\nWARNING: This test can't be run without being an Accounting administrator.\n"
send_user "Use sacctmgr mod user \$USER_NAME set admin=admin.\n"
exit 0
}
......@@ -90,7 +91,8 @@ proc cleanup { } {
}
}
send_user "Any error, except for unresponsiveness, from the previous scancel is expected and should be ignored.\n"
send_user "Any error, except for unresponsiveness, from the previous "
send_user "scancel is expected and should be ignored.\n"
spawn $scontrol delete partition=$part_name
expect {
......@@ -242,6 +244,10 @@ expect {
}
}
if { [string length $partition] == 0 } {
set partition [default_partition]
}
set node_name [ get_idle_node_in_part $partition ]
set cluster_name [ get_cluster_name ]
......
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