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

Improve failure logging in a test

parent 6aed461b
No related branches found
No related tags found
No related merge requests found
...@@ -52,7 +52,7 @@ array set node_info { ...@@ -52,7 +52,7 @@ array set node_info {
FreeMem freemem FreeMem freemem
Gres gres Gres gres
NodeAddr nodeaddr NodeAddr nodeaddr
NodeName nodehost NodeHostName nodehost
RealMemory memory RealMemory memory
State statelong State statelong
Sockets sockets Sockets sockets
...@@ -103,8 +103,7 @@ foreach option [array names node_info] { ...@@ -103,8 +103,7 @@ foreach option [array names node_info] {
spawn $scontrol show node $test_node spawn $scontrol show node $test_node
expect { expect {
-re "\\m$option=($alpha_numeric_dot)\\M" { -re "\\m$option=($alpha_numeric_dot)\\M" {
set node_sinfo_vals($node_info($option)) \ set node_sinfo_vals($node_info($option)) $expect_out(1,string)
$expect_out(1,string)
exp_continue exp_continue
} }
timeout { timeout {
...@@ -122,11 +121,6 @@ set first_option 1 ...@@ -122,11 +121,6 @@ set first_option 1
foreach option [array names node_sinfo_vals] { foreach option [array names node_sinfo_vals] {
set match 0 set match 0
if {$first_option == 1} {
set first_option 0
} else {
log_user 0
}
spawn $sinfo -n$test_node -O$option -h spawn $sinfo -n$test_node -O$option -h
expect { expect {
-nocase -re "$node_sinfo_vals($option)" { -nocase -re "$node_sinfo_vals($option)" {
...@@ -145,10 +139,9 @@ foreach option [array names node_sinfo_vals] { ...@@ -145,10 +139,9 @@ foreach option [array names node_sinfo_vals] {
if {$match != 1} { if {$match != 1} {
send_user "\nFAILURE: Node information $option output does " send_user "\nFAILURE: Node information $option output does "
send_user "not match sinfo output. " send_user "not match sinfo output. "
send_user "Looking for value: $node_sinfo_vals($option)\n" send_user "Looking for value: $option = $node_sinfo_vals($option)\n"
exit 1 set exit_code 1
} }
log_user 1
} }
# #
...@@ -218,11 +211,6 @@ set first_option 1 ...@@ -218,11 +211,6 @@ set first_option 1
foreach option [array names part_sinfo_vals] { foreach option [array names part_sinfo_vals] {
set match 0 set match 0
if {$first_option == 1} {
set $first_option 0
} else {
log_user 0
}
spawn $sinfo -p$test_part -O$option -h spawn $sinfo -p$test_part -O$option -h
expect { expect {
-nocase -re "$part_sinfo_vals($option)" { -nocase -re "$part_sinfo_vals($option)" {
...@@ -243,15 +231,16 @@ foreach option [array names part_sinfo_vals] { ...@@ -243,15 +231,16 @@ foreach option [array names part_sinfo_vals] {
send_user "output does not match sinfo output. " send_user "output does not match sinfo output. "
send_user "Looking for value: " send_user "Looking for value: "
send_user "$option = $part_sinfo_vals($option)\n" send_user "$option = $part_sinfo_vals($option)\n"
cleanup set exit_code 1
exit 1
} }
log_user 1
} }
cleanup cleanup
if {$exit_code == 0} { if {$exit_code == 0} {
send_user "\nSUCCESS\n" send_user "\nSUCCESS\n"
} else {
send_user "\nFAILURE\n"
} }
exit $exit_code 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