X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FODLTools.robot;h=38691b5c60aa3df7e6a7de30b0d25418326850b9;hb=db9ad6fa42252ac73e36d8dad73223bf624e8d28;hp=c54650191a663233c25109dd4510c7ed67e7baa6;hpb=ac59ef037e243a0bbe1a38d2f25a59d1b93522d0;p=integration%2Ftest.git diff --git a/csit/libraries/ODLTools.robot b/csit/libraries/ODLTools.robot index c54650191a..38691b5c60 100644 --- a/csit/libraries/ODLTools.robot +++ b/csit/libraries/ODLTools.robot @@ -1,6 +1,9 @@ *** Settings *** -Documentation Robot wrapper around ODLTools. -Resource ../variables/Variables.robot +Documentation Robot wrapper around ODLTools. + +Library OperatingSystem +Resource ../variables/Variables.robot + *** Keywords *** Version @@ -9,21 +12,50 @@ Version ${rc} ${output} = OperatingSystem.Run And Return Rc And Output ${cmd} BuiltIn.Log rc: ${rc}, output: ${output} BuiltIn.Should Be True '${rc}' == '0' - [Return] ${output} + RETURN ${output} Get EOS - [Arguments] ${node_ip}=${TOOLS_SYSTEM_IP} ${port}=${RESTCONFPORT} [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} + [Arguments] ${node_ip}=${ODL_SYSTEM_IP} ${port}=${RESTCONFPORT} ${test_name}=${SUITE_NAME}.${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' - [Return] ${output} + RETURN ${output} Get Cluster Info + [Documentation] Get ODL Cluster related information like transaction counts, commit rates, etc. [Arguments] ${port}=${RESTCONFPORT} - [Documentation] Get ODL Cluster related information like transaction counts, commit rates etc - : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} - \ ${cmd} = BuiltIn.Set Variable odltools show cluster-info -i ${ODL_SYSTEM_${i+1}_IP} -t ${port} -u ${ODL_RESTCONF_USER} -w ${ODL_RESTCONF_PASSWORD} - \ ${output} = OperatingSystem.Run ${cmd} - \ BuiltIn.Log output: ${output} + FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} + ${cmd} = BuiltIn.Set Variable + ... odltools show cluster-info -i ${ODL_SYSTEM_${i+1}_IP} -t ${port} -u ${ODL_RESTCONF_USER} -w ${ODL_RESTCONF_PASSWORD} + ${output} = OperatingSystem.Run ${cmd} + BuiltIn.Log output: ${output} + END + +Analyze Tunnels + [Documentation] Analyze Tunnel Mesh creation for any errors and log results + [Arguments] ${node_ip}=${ODL_SYSTEM_IP} ${port}=${RESTCONFPORT} ${test_name}=${SUITE_NAME}.${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' + RETURN ${output} + +Get All + [Documentation] Get all results provided by ODLTools + [Arguments] ${node_ip}=${ODL_SYSTEM_IP} ${port}=${RESTCONFPORT} ${test_name}=${SUITE_NAME}.${TEST_NAME} + ODLTools.Get Cluster Info + BuiltIn.run Keyword And Ignore Error ODLTools.Get EOS ${node_ip} test_name=${test_name} + BuiltIn.run Keyword And Ignore Error ODLTools.Analyze Tunnels ${node_ip} test_name=${test_name} + +Get Path + [Documentation] Get odltools path for a given test case + [Arguments] ${test_name}=${SUITE_NAME}.${TEST_NAME} + ${tmpdir} = BuiltIn.Evaluate + ... """${test_name}""".replace(" ","_").replace("/","_").replace(".","_").replace("(","_").replace(")","_") + RETURN /tmp/${tmpdir}