73521ca2b790d8bd9a1c1840fe5c32205d0ba306
[integration/test.git] / csit / libraries / ODLTools.robot
1 *** Settings ***
2 Documentation     Robot wrapper around ODLTools.
3 Resource          ../variables/Variables.robot
4
5 *** Keywords ***
6 Version
7     [Documentation]    Get the odltools version
8     ${cmd} =    BuiltIn.Set Variable    odltools -V
9     ${rc}    ${output} =    OperatingSystem.Run And Return Rc And Output    ${cmd}
10     BuiltIn.Log    rc: ${rc}, output: ${output}
11     BuiltIn.Should Be True    '${rc}' == '0'
12     [Return]    ${output}
13
14 Get EOS
15     [Arguments]    ${node_ip}=${TOOLS_SYSTEM_IP}    ${port}=${RESTCONFPORT}    ${test_name}=${SUITE_NAME}.${TEST_NAME}
16     [Documentation]    Get the various ODL entity ownership information
17     ${cmd} =    BuiltIn.Set Variable    odltools show eos -i ${node_ip} -t ${port} -u ${ODL_RESTCONF_USER} -w ${ODL_RESTCONF_PASSWORD} --path /tmp/${test_name}
18     ${rc}    ${output} =    OperatingSystem.Run And Return Rc And Output    ${cmd}
19     BuiltIn.Log    rc: ${rc}, output: ${output}
20     BuiltIn.Should Be True    '${rc}' == '0'
21     [Return]    ${output}
22
23 Get Cluster Info
24     [Arguments]    ${port}=${RESTCONFPORT}
25     [Documentation]    Get ODL Cluster related information like transaction counts, commit rates etc
26     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
27     \    ${cmd} =    BuiltIn.Set Variable    odltools show cluster-info -i ${ODL_SYSTEM_${i+1}_IP} -t ${port} -u ${ODL_RESTCONF_USER} -w ${ODL_RESTCONF_PASSWORD}
28     \    ${output} =    OperatingSystem.Run    ${cmd}
29     \    BuiltIn.Log    output: ${output}
30
31 Analyze Tunnels
32     [Arguments]    ${node_ip}=${TOOLS_SYSTEM_IP}    ${port}=${RESTCONFPORT}    ${test_name}=${SUITE_NAME}.${TEST_NAME}
33     [Documentation]    Analyze Tunnel Mesh creation for any errorsand log results
34     ${cmd} =    BuiltIn.Set Variable    odltools analyze tunnels -i ${node_ip} -t ${port} -u ${ODL_RESTCONF_USER} -w ${ODL_RESTCONF_PASSWORD} --path /tmp/${test_name}
35     ${rc}    ${output} =    OperatingSystem.Run And Return Rc And Output    ${cmd}
36     BuiltIn.Log    rc: ${rc}, output: ${output}
37     BuiltIn.Should Be True    '${rc}' == '0'
38     [Return]    ${output}
39
40 Get All
41     [Arguments]    ${node_ip}=${TOOLS_SYSTEM_IP}    ${port}=${RESTCONFPORT}
42     [Documentation]    Get all results provided by ODLTools
43     ODLTools.Get Cluster Info
44     BuiltIn.run Keyword And Ignore Error    ODLTools.Get EOS    ${HA_PROXY_IP}
45     BuiltIn.run Keyword And Ignore Error    ODLTools.Analyze Tunnels    ${HA_PROXY_IP}