Add optional parameter in Openstack lib.
[integration/test.git] / csit / libraries / ODLTools.robot
index 04fdf7240305de5a7109dda3d6b742ec7fa3f34e..df41eb04347d59d6f91f134f08e125ff969ed45b 100644 (file)
@@ -14,7 +14,8 @@ Version
 Get EOS
     [Arguments]    ${node_ip}=${TOOLS_SYSTEM_IP}    ${port}=${RESTCONFPORT}    ${test_name}=${SUITE_NAME}.${TEST_NAME}
     [Documentation]    Get the various ODL entity ownership information
-    ${cmd} =    BuiltIn.Set Variable    odltools show eos -i ${node_ip} -t ${port} -u ${ODL_RESTCONF_USER} -w ${ODL_RESTCONF_PASSWORD} --path /tmp/${test_name}
+    ${dstdir} =    Get Path    ${test_name}
+    ${cmd} =    BuiltIn.Set Variable    odltools show eos -i ${node_ip} -t ${port} -u ${ODL_RESTCONF_USER} -w ${ODL_RESTCONF_PASSWORD} --path ${dstdir}
     ${rc}    ${output} =    OperatingSystem.Run And Return Rc And Output    ${cmd}
     BuiltIn.Log    rc: ${rc}, output: ${output}
     BuiltIn.Should Be True    '${rc}' == '0'
@@ -31,7 +32,8 @@ Get Cluster Info
 Analyze Tunnels
     [Arguments]    ${node_ip}=${TOOLS_SYSTEM_IP}    ${port}=${RESTCONFPORT}    ${test_name}=${SUITE_NAME}.${TEST_NAME}
     [Documentation]    Analyze Tunnel Mesh creation for any errors and log results
-    ${cmd} =    BuiltIn.Set Variable    odltools analyze tunnels -i ${node_ip} -t ${port} -u ${ODL_RESTCONF_USER} -w ${ODL_RESTCONF_PASSWORD} --path /tmp/${test_name}
+    ${dstdir} =    Get Path    ${test_name}
+    ${cmd} =    BuiltIn.Set Variable    odltools analyze tunnels -i ${node_ip} -t ${port} -u ${ODL_RESTCONF_USER} -w ${ODL_RESTCONF_PASSWORD} --path ${dstdir}
     ${rc}    ${output} =    OperatingSystem.Run And Return Rc And Output    ${cmd}
     BuiltIn.Log    rc: ${rc}, output: ${output}
     BuiltIn.Should Be True    '${rc}' == '0'
@@ -43,3 +45,9 @@ Get All
     ODLTools.Get Cluster Info
     BuiltIn.run Keyword And Ignore Error    ODLTools.Get EOS    ${HA_PROXY_IP}    test_name=${test_name}
     BuiltIn.run Keyword And Ignore Error    ODLTools.Analyze Tunnels    ${HA_PROXY_IP}    test_name=${test_name}
+
+Get Path
+    [Arguments]    ${test_name}=${SUITE_NAME}.${TEST_NAME}
+    [Documentation]    Get odltools path for a given test case
+    ${tmpdir} =    BuiltIn.Evaluate    """${test_name}""".replace(" ","_").replace("/","_").replace(".","_")
+    [Return]    /tmp/${tmpdir}