2 Documentation Robot wrapper around ODLTools.
3 Library OperatingSystem
4 Resource ../variables/Variables.robot
8 [Documentation] Get the odltools version
9 ${cmd} = BuiltIn.Set Variable odltools -V
10 ${rc} ${output} = OperatingSystem.Run And Return Rc And Output ${cmd}
11 BuiltIn.Log rc: ${rc}, output: ${output}
12 BuiltIn.Should Be True '${rc}' == '0'
16 [Arguments] ${node_ip}=${ODL_SYSTEM_IP} ${port}=${RESTCONFPORT} ${test_name}=${SUITE_NAME}.${TEST_NAME}
17 [Documentation] Get the various ODL entity ownership information
18 ${dstdir} = Get Path ${test_name}
19 ${cmd} = BuiltIn.Set Variable odltools netvirt show eos -i ${node_ip} -t ${port} -u ${ODL_RESTCONF_USER} -w ${ODL_RESTCONF_PASSWORD} --path ${dstdir}
20 ${rc} ${output} = OperatingSystem.Run And Return Rc And Output ${cmd}
21 BuiltIn.Log rc: ${rc}, output: ${output}
22 BuiltIn.Should Be True '${rc}' == '0'
26 [Arguments] ${port}=${RESTCONFPORT}
27 [Documentation] Get ODL Cluster related information like transaction counts, commit rates, etc.
28 : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM}
29 \ ${cmd} = BuiltIn.Set Variable odltools netvirt show cluster-info -i ${ODL_SYSTEM_${i+1}_IP} -t ${port} -u ${ODL_RESTCONF_USER} -w ${ODL_RESTCONF_PASSWORD}
30 \ ${output} = OperatingSystem.Run ${cmd}
31 \ BuiltIn.Log output: ${output}
34 [Arguments] ${node_ip}=${ODL_SYSTEM_IP} ${port}=${RESTCONFPORT} ${test_name}=${SUITE_NAME}.${TEST_NAME}
35 [Documentation] Analyze Tunnel Mesh creation for any errors and log results
36 ${dstdir} = Get Path ${test_name}
37 ${cmd} = BuiltIn.Set Variable odltools netvirt analyze tunnels -i ${node_ip} -t ${port} -u ${ODL_RESTCONF_USER} -w ${ODL_RESTCONF_PASSWORD} --path ${dstdir}
38 ${rc} ${output} = OperatingSystem.Run And Return Rc And Output ${cmd}
39 BuiltIn.Log rc: ${rc}, output: ${output}
40 BuiltIn.Should Be True '${rc}' == '0'
44 [Arguments] ${node_ip}=${ODL_SYSTEM_IP} ${port}=${RESTCONFPORT} ${test_name}=${SUITE_NAME}.${TEST_NAME}
45 [Documentation] Get all results provided by ODLTools
46 ODLTools.Get Cluster Info
47 BuiltIn.run Keyword And Ignore Error ODLTools.Get EOS ${node_ip} test_name=${test_name}
48 BuiltIn.run Keyword And Ignore Error ODLTools.Analyze Tunnels ${node_ip} test_name=${test_name}
51 [Arguments] ${test_name}=${SUITE_NAME}.${TEST_NAME}
52 [Documentation] Get odltools path for a given test case
53 ${tmpdir} = BuiltIn.Evaluate """${test_name}""".replace(" ","_").replace("/","_").replace(".","_").replace("(","_").replace(")","_")
54 [Return] /tmp/${tmpdir}