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

correction to sinfo test parsing

Test4.5 was failing due to failure to parse node count with "K" suffix and
change in case of node state name.
parent 503a00dc
No related branches found
No related tags found
No related merge requests found
...@@ -196,6 +196,7 @@ set alpha_numeric_under "\[a-zA-Z0-9_\-\]+" ...@@ -196,6 +196,7 @@ set alpha_numeric_under "\[a-zA-Z0-9_\-\]+"
set alpha_under "\[A-Z_\]+" set alpha_under "\[A-Z_\]+"
set end_of_line "\[\r\n\]" set end_of_line "\[\r\n\]"
set number "\[0-9\]+" set number "\[0-9\]+"
set number_with_suffix "\[0-9\]+\[KM\]*"
set float "\[0-9\]+\\.?\[0-9\]+" set float "\[0-9\]+\\.?\[0-9\]+"
set whitespace "\[ \t\n\r\f\v\]+" set whitespace "\[ \t\n\r\f\v\]+"
set alpha_numeric_nodelist "$alpha_numeric_under\\\[?\[$alpha_numeric_comma\]?\\\]?" set alpha_numeric_nodelist "$alpha_numeric_under\\\[?\[$alpha_numeric_comma\]?\\\]?"
......
...@@ -49,7 +49,7 @@ print_header $test_id ...@@ -49,7 +49,7 @@ print_header $test_id
spawn $sinfo --Node --long --exact spawn $sinfo --Node --long --exact
expect { expect {
-re "($end_of_line)($name_string) *($number) *($name_string) *($alpha_cap)" { -re "($end_of_line)($name_string) *($number_with_suffix) *($name_string) *($alpha)" {
if (![string compare $node_name ""]) { if (![string compare $node_name ""]) {
set node_name $expect_out(2,string) set node_name $expect_out(2,string)
} }
...@@ -77,12 +77,16 @@ expect { ...@@ -77,12 +77,16 @@ expect {
spawn $sinfo --Node --long --exact --state=$node_state spawn $sinfo --Node --long --exact --state=$node_state
expect { expect {
-re "($end_of_line)($name_string) *($number) *($name_string) *($alpha_cap)" { -re "($end_of_line)($name_string) *($number_with_suffix) *($name_string) *($alpha)" {
if ([string compare $expect_out(5,string) $node_state]) { if ([string compare $expect_out(5,string) $node_state]) {
incr mismatches incr mismatches
} }
exp_continue exp_continue
} }
-re "error:" {
send_user "\nFAILURE: Unexpected error from sinfo\n"
set exit_code 1
}
-re "Unable to contact" { -re "Unable to contact" {
send_user "\nFAILURE: slurm appears to be down\n" send_user "\nFAILURE: slurm appears to be down\n"
exit 1 exit 1
...@@ -102,12 +106,16 @@ expect { ...@@ -102,12 +106,16 @@ expect {
spawn $sinfo --Node --long --exact --nodes=$node_name spawn $sinfo --Node --long --exact --nodes=$node_name
expect { expect {
-re "($end_of_line)($name_string) *($number) *($name_string) *($alpha_cap)" { -re "($end_of_line)($name_string) *($number_with_suffix) *($name_string) *($alpha)" {
if ([string compare $expect_out(2,string) $node_name]) { if ([string compare $expect_out(2,string) $node_name]) {
incr mismatches incr mismatches
} }
exp_continue exp_continue
} }
-re "error:" {
send_user "\nFAILURE: Unexpected error from sinfo\n"
set exit_code 1
}
-re "Unable to contact" { -re "Unable to contact" {
send_user "\nFAILURE: slurm appears to be down\n" send_user "\nFAILURE: slurm appears to be down\n"
exit 1 exit 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