Upgrade RF syntax for v3.2 compatibility
[integration/test.git] / csit / libraries / ToolsSystem.robot
1 *** Settings ***
2 Documentation     Library for the tools system nodes.
3 Library           Collections
4 Library           SSHLibrary
5 Resource          Utils.robot
6 Resource          ../variables/Variables.robot
7
8 *** Variables ***
9 @{TOOLS_SYSTEM_ALL_IPS}    @{EMPTY}
10 @{TOOLS_SYSTEM_ALL_CONN_IDS}    @{EMPTY}
11
12 *** Keywords ***
13 Get Tools System Nodes Data
14     FOR    ${i}    IN RANGE    1    ${NUM_TOOLS_SYSTEM} + 1
15         ${ip} =    BuiltIn.Set Variable    ${TOOLS_SYSTEM_${i}_IP}
16         Collections.Append To List    ${TOOLS_SYSTEM_ALL_IPS}    ${ip}
17         ${conn_id} =    SSHLibrary.Open Connection    ${ip}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=30s
18         Collections.Append To List    ${TOOLS_SYSTEM_ALL_CONN_IDS}    ${conn_id}
19     END
20
21 Run Command On All Tools Systems
22     [Arguments]    ${cmd}
23     [Documentation]    Run command on all tools systems
24     FOR    ${ip}    IN    @{TOOLS_SYSTEM_ALL_IPS}
25         Utils.Run Command On Remote System    ${ip}    ${cmd}
26     END