Fix PcepOperations requests
[integration/test.git] / csit / libraries / PcepOperations.robot
index 23383afe005797c1895bd4aa8563ed65f737eeb6..1a37c05948809726872be675a1f010d02b2a87fb 100644 (file)
@@ -25,14 +25,13 @@ Setup_Pcep_Operations
     [Documentation]    Creates Requests session to be used by subsequent keywords.
     RequestsLibrary.Create_Session
     ...    alias=pcep_session
-    ...    url=http://${ODL_SYSTEM_IP}:${RESTCONFPORT}/rests/operations/
+    ...    url=http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
     ...    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
+    RequestsLibrary.Delete_All_Sessions
 
 Add_Xml_Lsp_Return_Json
     [Documentation]    Instantiate LSP according to XML data and return response (json) text.
@@ -58,9 +57,10 @@ Remove_Xml_Lsp_Return_Json
 Operate_Xml_Lsp_Return_Json
     [Documentation]    Post XML data to given pcep-operations URI, check status_code is 200 and return response text (JSON).
     [Arguments]    ${uri_part}    ${xml_data}
+    ${uri_path}=    BuiltIn.Set_Variable    /rests/operations/${uri_part}
     ${response}=    RequestsLibrary.POST On Session
     ...    alias=pcep_session
-    ...    url=${uri_part}
+    ...    url=${uri_path}
     ...    data=${xml_data}
     ...    expected_status=any
     Log    ${xml_data}