Add ToolsSystem.robot 74/75074/4
authorSam Hague <shague@redhat.com>
Thu, 9 Aug 2018 22:58:57 +0000 (18:58 -0400)
committerSam Hague <shague@redhat.com>
Fri, 10 Aug 2018 00:17:51 +0000 (20:17 -0400)
Change-Id: I2a699fbb1e59c1c7e7b2e42ad3342ed3d6dfafe2
Signed-off-by: Sam Hague <shague@redhat.com>
csit/libraries/ToolsSystem.robot [new file with mode: 0644]

diff --git a/csit/libraries/ToolsSystem.robot b/csit/libraries/ToolsSystem.robot
new file mode 100644 (file)
index 0000000..3842fb9
--- /dev/null
@@ -0,0 +1,24 @@
+*** Settings ***
+Documentation     Library for the tools system nodes.
+Library           Collections
+Library           SSHLibrary
+Resource          Utils.robot
+Resource          ../variables/Variables.robot
+
+*** Variables ***
+@{TOOLS_SYSTEM_ALL_IPS}    @{EMPTY}
+@{TOOLS_SYSTEM_ALL_CONN_IDS}    @{EMPTY}
+
+*** Keywords ***
+Get Tools System Nodes Data
+    : FOR    ${i}    IN RANGE    1    ${NUM_TOOLS_SYSTEM} + 1
+    \    ${ip} =    BuiltIn.Set Variable    ${TOOLS_SYSTEM_${i}_IP}
+    \    Collections.Append To List    ${TOOLS_SYSTEM_ALL_IPS}    ${ip}
+    \    ${conn_id} =    SSHLibrary.Open Connection    ${ip}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=30s
+    \    Collections.Append To List    ${TOOLS_SYSTEM_ALL_CONN_IDS}    ${conn_id}
+
+Run Command On All Tools Systems
+    [Arguments]    ${cmd}
+    [Documentation]    Run command on all tools systems
+    : FOR    ${ip}    IN    @{TOOLS_SYSTEM_ALL_IPS}
+    \    Utils.Run Command On Remote System    ${ip}    ${cmd}