Refactor SFC CSIT Variables
[integration/test.git] / csit / suites / sfc / SFC_Basic / 010__sfc_service_functions.robot
index 46060baecac1fbc4c5621e142c7c32af5c5dc9d8..2f3b7e5ead239b7f27f1f672f2d529626664626a 100644 (file)
@@ -38,18 +38,18 @@ Get one Service Function
     [Documentation]    Get one Service Function
     Add Elements To URI From File    ${SERVICE_FUNCTIONS_URI}    ${SERVICE_FUNCTIONS_FILE}
     ${elements}=    Create List    dpi-102-1    dpi
-    Check For Elements At URI    ${SERVICE_FUNCTIONS_URI}service-function/dpi-102-1    ${elements}
+    Check For Elements At URI    ${SERVICE_FUNCTION_URI}/dpi-102-1    ${elements}
 
 Get A Non-existing Service Function
     [Documentation]    Get A Non-existing Service Function
     Add Elements To URI From File    ${SERVICE_FUNCTIONS_URI}    ${SERVICE_FUNCTIONS_FILE}
-    ${resp}    RequestsLibrary.Get Request    session    ${SERVICE_FUNCTIONS_URI}service-function/non-existing-sf
+    ${resp}    RequestsLibrary.Get Request    session    ${SERVICE_FUNCTION_URI}/non-existing-sf
     Should Be Equal As Strings    ${resp.status_code}    404
 
 Delete A Service Function
     [Documentation]    Delete A Service Function
     Add Elements To URI From File    ${SERVICE_FUNCTIONS_URI}    ${SERVICE_FUNCTIONS_FILE}
-    Remove All Elements At URI    ${SERVICE_FUNCTIONS_URI}service-function/dpi-102-1
+    Remove All Elements At URI    ${SERVICE_FUNCTION_URI}/dpi-102-1
     ${resp}    RequestsLibrary.Get Request    session    ${SERVICE_FUNCTIONS_URI}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     Should Not Contain    ${resp.content}    dpi-102-1
@@ -60,7 +60,7 @@ Delete A Non-existing Empty Service Function
     ${body}    OperatingSystem.Get File    ${SERVICE_FUNCTIONS_FILE}
     ${jsonbody}    To Json    ${body}
     ${functions}    Get From Dictionary    ${jsonbody}    service-functions
-    ${resp}    RequestsLibrary.Delete Request    session    ${SERVICE_FUNCTIONS_URI}service-function/non-existing-sf
+    ${resp}    RequestsLibrary.Delete Request    session    ${SERVICE_FUNCTION_URI}/non-existing-sf
     Should Be Equal As Strings    ${resp.status_code}    404
     ${resp}    RequestsLibrary.Get Request    session    ${SERVICE_FUNCTIONS_URI}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
@@ -79,31 +79,31 @@ Get Service Function DPL
     [Documentation]    Get Service Function Data Plane Locator
     Add Elements To URI From File    ${SF_DPI102100_URI}    ${SF_DPI102100_FILE}
     ${elements}=    Create List    100    10100
-    Check For Elements At URI    ${SF_DPI102100_URI}sf-data-plane-locator/dpl-100    ${elements}
+    Check For Elements At URI    ${SF_DPI102100_URI}/sf-data-plane-locator/dpl-100    ${elements}
 
 Put Service Function DPL
     [Documentation]    Put Service Function Data Plane Locator
     Add Elements To URI From File    ${SF_DPI102100_URI}    ${SF_DPI102100_FILE}
-    Add Elements To URI From File    ${SF_DPI102100_URI}sf-data-plane-locator/dpl-101    ${SF_DPL101_FILE}
+    Add Elements To URI From File    ${SF_DPI102100_URI}/sf-data-plane-locator/dpl-101    ${SF_DPL101_FILE}
     ${elements}=    Create List    dpl-101    10101
-    Check For Elements At URI    ${SF_DPI102100_URI}sf-data-plane-locator/dpl-101    ${elements}
+    Check For Elements At URI    ${SF_DPI102100_URI}/sf-data-plane-locator/dpl-101    ${elements}
     Check For Elements At URI    ${SF_DPI102100_URI}    ${elements}
 
 Put Service Function DPL to a Non-existing Service Function
     [Documentation]    Put Service Function DPL to a Non-existing Service Function
     [Tags]    exclude
-    Add Elements To URI From File    ${SF_DPI102100_URI}sf-data-plane-locator/dpl-101    ${SF_DPL101_FILE}
+    Add Elements To URI From File    ${SF_DPI102100_URI}/sf-data-plane-locator/dpl-101    ${SF_DPL101_FILE}
     ${resp}    RequestsLibrary.Get Request    session    ${SERVICE_FUNCTIONS_URI}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     Should Contain    ${resp.content}    dpi-102-100
     ${elements}=    Create List    dpl-101    10101
-    Check For Elements At URI    ${SF_DPI102100_URI}sf-data-plane-locator/dpl-101    ${elements}
+    Check For Elements At URI    ${SF_DPI102100_URI}/sf-data-plane-locator/dpl-101    ${elements}
     Check For Elements At URI    ${SF_DPI102100_URI}    ${elements}
 
 Delete Service Function DPL
     [Documentation]    Delete Service Function Data Plane Locator
     Add Elements To URI From File    ${SF_DPI102100_URI}    ${SF_DPI102100_FILE}
-    Remove All Elements At URI    ${SF_DPI102100_URI}sf-data-plane-locator/dpl-100
+    Remove All Elements At URI    ${SF_DPI102100_URI}/sf-data-plane-locator/dpl-100
     ${resp}    RequestsLibrary.Get Request    session    ${SF_DPI102100_URI}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     Should Not Contain    ${resp.content}    dpl-100
@@ -114,8 +114,8 @@ Init Suite
     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
     log    ${ODL_STREAM}
     Set Suite Variable    ${VERSION_DIR}    master
-    Set Suite Variable    ${SERVICE_FUNCTIONS_URI}    /restconf/config/service-function:service-functions/
-    Set Suite Variable    ${SERVICE_FUNCTIONS_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-functions.json
-    Set Suite Variable    ${SF_DPI102100_URI}    /restconf/config/service-function:service-functions/service-function/dpi-102-100/
-    Set Suite Variable    ${SF_DPI102100_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/sf_dpi_102_100.json
-    Set Suite Variable    ${SF_DPL101_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/sf_dpl_101.json
+    Set Suite Variable    ${TEST_DIR}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}
+    Set Suite Variable    ${SERVICE_FUNCTIONS_FILE}    ${TEST_DIR}/service-functions.json
+    Set Suite Variable    ${SF_DPI102100_URI}    ${SERVICE_FUNCTION_URI}/dpi-102-100
+    Set Suite Variable    ${SF_DPI102100_FILE}    ${TEST_DIR}/sf_dpi_102_100.json
+    Set Suite Variable    ${SF_DPL101_FILE}    ${TEST_DIR}/sf_dpl_101.json