From ffb1fc8fc8eccccf4f282d1b54ac0b074db9faec Mon Sep 17 00:00:00 2001 From: Danny Auble <da@schedmd.com> Date: Tue, 5 Mar 2013 14:28:37 -0800 Subject: [PATCH] TESTSUITE - Make it so the avaliable_nodes function handles 'K' and 'M' --- testsuite/expect/globals | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/testsuite/expect/globals b/testsuite/expect/globals index 7e9dcf3e6b5..3e3d2630970 100755 --- a/testsuite/expect/globals +++ b/testsuite/expect/globals @@ -1674,11 +1674,18 @@ proc available_nodes { partition } { global sinfo set available -1 - send_user "$sinfo --noheader --partition $partition --state idle,alloc,comp --format %D\n" + #send_user "$sinfo --noheader --partition $partition --state idle,alloc,comp --format %D\n" set fd [open "|$sinfo --noheader --partition $partition --state idle,alloc,comp --format %D"] gets $fd line catch {close $fd} regexp {\d+} $line available + if {[string match *K $line]} { + set available [expr $available * 1024] + } elseif {[string match *M $line]} { + set available [expr $available * 1048576] + } + + return $available } -- GitLab