X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=test%2Fcsit%2Flibraries%2FPcepOperations.robot;fp=test%2Fcsit%2Flibraries%2FPcepOperations.robot;h=0000000000000000000000000000000000000000;hb=23412e442bc8e1b8f3d27e233829cf106b6ad0b8;hp=fb00068644d4c026f8670234f7a4386e940370ec;hpb=732659be50eedc962e9cf09b09ac15e459523c7a;p=integration.git diff --git a/test/csit/libraries/PcepOperations.robot b/test/csit/libraries/PcepOperations.robot deleted file mode 100644 index fb000686..00000000 --- a/test/csit/libraries/PcepOperations.robot +++ /dev/null @@ -1,60 +0,0 @@ -*** Settings *** -Documentation Robot keyword library (Resource) for performing PCEP operations via restconf calls. -... -... Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. -... -... This program and the accompanying materials are made available under the -... terms of the Eclipse Public License v1.0 which accompanies this distribution, -... and is available at http://www.eclipse.org/legal/epl-v10.html -Library RequestsLibrary -Variables ${CURDIR}/../variables/Variables.py - -*** Keywords *** -Setup_Pcep_Operations - [Documentation] Creates Requests session to be used by subsequent keywords. - # Do not append slash at the end uf URL, Requests would add another, resulting in error. - Create_Session pcep_session http://${CONTROLLER}:${RESTCONFPORT}/restconf/operations headers=${HEADERS_XML} auth=${AUTH} - -Teardown_Pcep_Operations - [Documentation] Teardown to pair with Setup (otherwise no-op). - Log TODO: The following line does not seem to be implemented by RequestsLibrary. Look for a workaround. - # Delete_Session pcep_session - -Add_Xml_Lsp_Return_Json - [Arguments] ${xml_data} - [Documentation] Instantiate LSP according to XML data and return response (json) text. - # Also no slash here - ${response}= Operate_Xml_Lsp_Return_Json network-topology-pcep:add-lsp ${xml_data} - [Return] ${response} - -Update_Xml_Lsp_Return_Json - [Arguments] ${xml_data} - [Documentation] Update LSP according to XML data and return response (json) text. - # Also no slash here - ${response}= Operate_Xml_Lsp_Return_Json network-topology-pcep:update-lsp ${xml_data} - [Return] ${response} - -Remove_Xml_Lsp_Return_Json - [Arguments] ${xml_data} - [Documentation] Remove LSP according to XML data and return response (json) text. - # Also no slash here - ${response}= Operate_Xml_Lsp_Return_Json network-topology-pcep:remove-lsp ${xml_data} - [Return] ${response} - -Operate_Xml_Lsp_Return_Json - [Arguments] ${uri_part} ${xml_data} - [Documentation] Post XML data to given pcep-operations URI, check status_code is 200 and return response text (JSON). - ${response}= RequestsLibrary.Post pcep_session ${uri_part} data=${xml_data} - Should_Be_Equal_As_Strings ${response.status_code} 200 - [Return] ${response.text} - -Pcep_Json_Is_Success - [Arguments] ${text} - [Documentation] Given text should be equal to successfull json response. - Should_Be_Equal_As_Strings ${text} {"output":{}} - -Pcep_Json_Is_Refused - [Arguments] ${text} - [Documentation] Given text should be equal to json response when device refuses tunnel removal. - # FIXME: We probably should normalize text as json (and by that, test whether it is a json at all). - Should_Be_Equal_As_Strings ${text} {"output":{"error":[{"error-object":{"ignore":false,"processing-rule":false,"type":19,"value":9}}],"failure":"failed"}}