Refactor SFC_Basic tests to not use RSP RPCs 73/74273/24
authorebrjohn <bjohnson@inocybe.com>
Fri, 20 Jul 2018 10:38:57 +0000 (12:38 +0200)
committerJamo Luhrsen <jluhrsen@redhat.com>
Tue, 31 Jul 2018 23:20:40 +0000 (23:20 +0000)
- The RSPs are no longer created via RPCs, but instead
  are created internally when the SFP is created.
- Once this patch is in, I will refactor the rest of
  the SFC CSIT to not use RSP RPCs.
- Working Sandbox:
  https://jenkins.opendaylight.org/sandbox/job/sfc-csit-3node-rest-basic-all-fluorine

Change-Id: Ifbd4b3343362df0509f1cfbcd59865b9672c329b
Signed-off-by: Brady Johnson <bjohnson@inocybe.com>
csit/libraries/SFC/SfcKeywords.robot
csit/suites/sfc/SFC_Basic/060__sfc_service_paths.robot
csit/suites/sfc/SFC_Basic/070__sfc_rendered_service_paths.robot
csit/variables/sfc/Modules.py
csit/variables/sfc/Variables.robot

index f6309b293b2af9b1742b18c683a25c0c255db7be..2dafb53d85f5ce895da6be8c33be2f070267dc45 100644 (file)
@@ -1,38 +1,96 @@
 *** Settings ***
 *** Settings ***
+Documentation     Common Keywords for the SFC Test suites.
+Library           Collections
+Resource          ../../../libraries/Utils.robot
 
 *** Variables ***
 
 *** Keywords ***
 Post Elements To URI As JSON
     [Arguments]    ${uri}    ${data}
 
 *** Variables ***
 
 *** Keywords ***
 Post Elements To URI As JSON
     [Arguments]    ${uri}    ${data}
-    ${resp}    RequestsLibrary.Post Request    session    ${uri}    data=${data}    headers=${headers}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    ${resp}    RequestsLibrary.Post Request    session    ${uri}    data=${data}    headers=${headers}
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
 
 Get JSON Elements From URI
     [Arguments]    ${uri}
 
 Get JSON Elements From URI
     [Arguments]    ${uri}
-    ${resp}    RequestsLibrary.Get Request    session    ${uri}
-    ${value}    To Json    ${resp.content}
-    [Return]    ${value}
+    ${resp} =    RequestsLibrary.Get Request    session    ${uri}
+    [Return]    ${resp.json()}
 
 Check Classifier Flows
 
 Check Classifier Flows
-    ${flowList}=    DockerSfc.Get Flows In Docker Containers
-    log    ${flowList}
-    Should Contain Match    ${flowList}    *actions=pop_nsh*
-    Should Contain Match    ${flowList}    *actions=push_nsh*
+    ${flowList} =    DockerSfc.Get Flows In Docker Containers
+    BuiltIn.log    ${flowList}
+    BuiltIn.Should Contain Match    ${flowList}    *actions=pop_nsh*
+    BuiltIn.Should Contain Match    ${flowList}    *actions=push_nsh*
 
 Check Service Function Types Added
     [Arguments]    ${elements}
     [Documentation]    Check that the service function types are updated with the service function names
 
 Check Service Function Types Added
     [Arguments]    ${elements}
     [Documentation]    Check that the service function types are updated with the service function names
-    Check For Elements At URI    ${SERVICE_FUNCTION_TYPES_URI}    ${elements}
+    Utils.Check For Elements At URI    ${SERVICE_FUNCTION_TYPES_URI}    ${elements}
 
 Check Service Function Types Removed
     [Arguments]    ${elements}
     [Documentation]    Check that the service function names are removed from the service function types
 
 Check Service Function Types Removed
     [Arguments]    ${elements}
     [Documentation]    Check that the service function names are removed from the service function types
-    Check For Elements Not At URI    ${SERVICE_FUNCTION_TYPES_URI}    ${elements}
+    Utils.Check For Elements Not At URI    ${SERVICE_FUNCTION_TYPES_URI}    ${elements}
+
+Check Empty Service Function Paths State
+    [Documentation]    Check that the service function paths state is empty after deleting SFPs
+    Utils.Check For Specific Number Of Elements At URI    ${SERVICE_FUNCTION_PATHS_STATE_URI}    service-function-path-state    0
+
+Check Rendered Service Path Created
+    [Arguments]    ${sfp_name}
+    [Documentation]    Check that the Rendered Service Path is created
+    ${sfp_name_elements_list} =    BuiltIn.Create List    ${sfp_name}
+    Utils.Check For Elements At URI    ${SERVICE_FUNCTION_PATHS_STATE_URI}    ${sfp_name_elements_list}
+
+Check Rendered Service Path Deleted
+    [Arguments]    ${sfp_name}
+    [Documentation]    Check that the Rendered Service Path is deleted
+    ${sfp_name_elements_list} =    BuiltIn.Create List    ${sfp_name}
+    Utils.Check For Elements Not At URI    ${SERVICE_FUNCTION_PATHS_STATE_URI}    ${sfp_name_elements_list}
+
+Get Rendered Service Path Name
+    [Arguments]    ${sfp_name}    ${get_reverse}=False
+    [Documentation]    Given an SFP name, do a get on ${SERVICE_FUNCTION_PATH_STATE_URI} to get the RSP name
+    ${resp} =    RequestsLibrary.Get Request    session    ${SERVICE_FUNCTION_PATH_STATE_URI}${sfp_name}
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    # should be like this: {"service-function-path-state":[{"name":"SFC1-100","sfp-rendered-service-path":[{"name":"SFC1-100-Path-183"}]}]}
+    ${sfp_rendered_service_path_list} =    Collections.Get_From_Dictionary    ${resp.json()}    service-function-path-state
+    ${sfp_rendered_service_path_dict} =    Collections.Get_From_List    ${sfp_rendered_service_path_list}    0
+    ${sfp_state_list} =    Collections.Get_From_Dictionary    ${sfp_rendered_service_path_dict}    sfp-rendered-service-path
+    ${list_length} =    BuiltIn.Get Length    ${sfp_state_list}
+    # The "sfp-rendered-service-path" will only have 1 or 2 entries, depending on chain symmetry config.
+    # The RSP name will be "<SfpName>-Path-<PathId>" and the optional symmetric name will be <SfpName>-Path-<PathId>-Reverse"
+    ${value} =    BuiltIn.Set Variable    None
+    : FOR    ${i}    IN RANGE    ${list_length}
+    \    ${rsp_name_dict} =    Collections.Get From List    ${sfp_state_list}    ${i}
+    \    ${name} =    Collections.Get_From_Dictionary    ${rsp_name_dict}    name
+    \    @{matches} =    String.Get Regexp Matches    ${name}    .*Reverse$
+    \    ${matches_length} =    BuiltIn.Get Length    ${matches}
+    \    ${value} =    BuiltIn.Set Variable If    "${get_reverse}" == "False" and 0 == ${matches_length}    ${name}    "${get_reverse}" == "True" and 0 < ${matches_length}    ${name}
+    \    ...    "${value}" != "None"    ${value}
+    [Return]    ${value}
+
+Create Sfp And Wait For Rsp Creation
+    [Arguments]    ${sfp_file_name}    ${created_sfps}
+    [Documentation]    Given an SFP name, create it and wait for the associated RSPs to be created
+    Utils.Add Elements To URI From File And Verify    ${SERVICE_FUNCTION_PATHS_URI}    ${sfp_file_name}
+    BuiltIn.Run Keyword If    len(${created_sfps}) > 0    BuiltIn.Wait Until Keyword Succeeds    60s    2s    Utils.Check For Elements At URI    ${SERVICE_FUNCTION_PATHS_STATE_URI}
+    ...    ${created_sfps}
+
+Delete Sfp And Wait For Rsps Deletion
+    [Arguments]    ${sfp_name}
+    [Documentation]    Given an SFP name, delete it and wait for the associated SFP state and RSPs to be deleted
+    Utils.Remove All Elements At URI And Verify    ${SERVICE_FUNCTION_PATH_URI}${sfp_name}
+    BuiltIn.Wait Until Keyword Succeeds    60s    2s    Check Rendered Service Path Deleted    ${sfp_name}
+
+Delete All Sfps And Wait For Rsps Deletion
+    [Documentation]    Delete all SFPs and wait for the RSPs to be deleted
+    Utils.Remove All Elements At URI And Verify    ${SERVICE_FUNCTION_PATHS_URI}
+    BuiltIn.Wait Until Keyword Succeeds    60s    2s    Check Empty Service Function Paths State
 
 Switch Ips In Json Files
     [Arguments]    ${json_dir}    ${container_names}
     ${normalized_dir}=    OperatingSystem.Normalize Path    ${json_dir}/*.json
     : FOR    ${cont_name}    IN    @{container_names}
 
 Switch Ips In Json Files
     [Arguments]    ${json_dir}    ${container_names}
     ${normalized_dir}=    OperatingSystem.Normalize Path    ${json_dir}/*.json
     : FOR    ${cont_name}    IN    @{container_names}
-    \    ${cont_ip}=    Get Docker IP    ${cont_name}
+    \    ${cont_ip} =    Get Docker IP    ${cont_name}
     \    OperatingSystem.Run    sudo sed -i 's/${cont_name}/${cont_ip}/g' ${normalized_dir}
     \    OperatingSystem.Run    sudo sed -i 's/${cont_name}/${cont_ip}/g' ${normalized_dir}
index bf028be4fe6c46d1b5a91ae4cc65e0197d5ad86c..f3bd49d524b3e1b74a7d994d5b8482792592729b 100644 (file)
@@ -71,8 +71,8 @@ Delete A Non-existing Empty Service Function Path
     ${path}    Get From Dictionary    ${result}    service-function-paths
     Lists Should be Equal    ${path}    ${paths}
 
     ${path}    Get From Dictionary    ${result}    service-function-paths
     Lists Should be Equal    ${path}    ${paths}
 
-Put one Service Function
-    [Documentation]    Put one Service Function
+Put One Service Function Path
+    [Documentation]    Put one Service Function Path
     Add Elements To URI From File    ${SERVICE_FUNCTION_PATH400_URI}    ${SERVICE_FUNCTION_PATH400_FILE}
     ${resp}    RequestsLibrary.Get Request    session    ${SERVICE_FUNCTION_PATH400_URI}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     Add Elements To URI From File    ${SERVICE_FUNCTION_PATH400_URI}    ${SERVICE_FUNCTION_PATH400_FILE}
     ${resp}    RequestsLibrary.Get Request    session    ${SERVICE_FUNCTION_PATH400_URI}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
index 6230d2d0cea81ae37a9cfc4c10ba6b5ffcdc0f5e..b22ad64ecc843b08894d96830077f4e457f34a69 100644 (file)
@@ -1,5 +1,5 @@
 *** Settings ***
 *** Settings ***
-Documentation     Test suite for SFC Service Functions, Operates functions from Restconf APIs.
+Documentation     Test suite for SFC Rendered Service Paths, Operates functions from Restconf APIs.
 Suite Setup       Init Suite
 Suite Teardown    Delete All Sessions
 Library           SSHLibrary
 Suite Setup       Init Suite
 Suite Teardown    Delete All Sessions
 Library           SSHLibrary
@@ -15,259 +15,184 @@ Resource          ../../../libraries/TemplatedRequests.robot
 *** Test Cases ***
 Basic Environment Setup Tests
     [Documentation]    Prepare Basic Test Environment
 *** Test Cases ***
 Basic Environment Setup Tests
     [Documentation]    Prepare Basic Test Environment
-    Add Elements To URI From File    ${SERVICE_FORWARDERS_URI}    ${SERVICE_FORWARDERS_FILE}
-    Add Elements To URI From File    ${SERVICE_NODES_URI}    ${SERVICE_NODES_FILE}
-    Add Elements To URI From File    ${SERVICE_FUNCTIONS_URI}    ${SERVICE_FUNCTIONS_FILE}
-    Wait Until Keyword Succeeds    60s    2s    Check Service Function Types Added    ${SERVICE_FUNCTION_NAMES}
-    Add Elements To URI From File    ${SERVICE_CHAINS_URI}    ${SERVICE_CHAINS_FILE}
-    Add Elements To URI From File    ${SERVICE_FUNCTION_PATHS_URI}    ${SERVICE_FUNCTION_PATHS_FILE}
-
-Create and Get Rendered Service Path
-    [Documentation]    Create and Get Rendered Service Path Through RESTConf APIs
-    Post Elements To URI As JSON    ${OPERATIONS_CREATE_RSP_URI}    ${CREATE_RSP1_INPUT}
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    ${elements}=    Create List    "name":"SFC1-100-RSP-1"    "parent-service-function-path":"SFC1-100"    "hop-number":0    "service-index":255    "hop-number":1
-    ...    "service-index":254    "hop-number":2    "service-index":253
-    Check For Elements At URI    ${OPERATIONAL_RSPS_URI}    ${elements}
-
-Create Get Rendered Service Path Failure
-    [Documentation]    Create Rendered Service Path Failure Cases
-    ${resp}    RequestsLibrary.Post Request    session    ${OPERATIONS_CREATE_RSP_URI}    data=${CREATE_RSP_FAILURE_INPUT}    headers=${headers}
-    Should Be Equal As Strings    ${resp.status_code}    500
+    Utils.Add Elements To URI From File    ${SERVICE_FORWARDERS_URI}    ${SERVICE_FORWARDERS_FILE}
+    Utils.Add Elements To URI From File    ${SERVICE_NODES_URI}    ${SERVICE_NODES_FILE}
+    Utils.Add Elements To URI From File    ${SERVICE_FUNCTIONS_URI}    ${SERVICE_FUNCTIONS_FILE}
+    BuiltIn.Wait Until Keyword Succeeds    60s    2s    SfcKeywords.Check Service Function Types Added    ${SERVICE_FUNCTION_NAMES}
+    Utils.Add Elements To URI From File    ${SERVICE_CHAINS_URI}    ${SERVICE_CHAINS_FILE}
+    # Creates SFPs: SFC1-100, SFC1-200, SFC1-300, SFC2-100, and SFC2-200
+    ${created_sfps} =    BuiltIn.Create List    "SFC1-100"    "SFC1-200"    "SFC1-300"    "SFC2-100"    "SFC2-200"
+    SfcKeywords.Create Sfp And Wait For Rsp Creation    ${SERVICE_FUNCTION_PATHS_FILE}    ${created_sfps}
 
 Get Rendered Service Path By Name
 
 Get Rendered Service Path By Name
-    [Documentation]    Get Rendered Service Path By Name Through RESTConf APIs
-    Post Elements To URI As JSON    ${OPERATIONS_CREATE_RSP_URI}    ${CREATE_RSP1_INPUT}
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    ${elements}=    Create List    "name":"SFC1-100-RSP-1"    "parent-service-function-path":"SFC1-100"    "hop-number":0    "service-index":255    "hop-number":1
-    ...    "service-index":254    "hop-number":2    "service-index":253
-    Check For Elements At URI    ${OPERATIONAL_RSPS_URI}    ${elements}
+    [Documentation]    Get The Rendered Service Path Created in "Basic Environment Setup Tests" By Name Via RESTConf APIs
+    ${sfp_name} =    BuiltIn.Set Variable    SFC1-100
+    ${rsp_name} =    SfcKeywords.Get Rendered Service Path Name    ${sfp_name}
+    ${resp} =    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSP_URI}${rsp_name}
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    # The RSP should not be symetric, so only 1 should be created for the SFP
+    Utils.Check For Specific Number Of Elements At URI    ${SERVICE_FUNCTION_PATH_STATE_URI}${sfp_name}    "sfp-rendered-service-path"    1
+    ${elements} =    BuiltIn.Create List    "parent-service-function-path":"SFC1-100"    "hop-number":0    "service-index":255    "hop-number":1    "service-index":254
+    ...    "hop-number":2    "service-index":253
+    Utils.Check For Elements At URI    ${OPERATIONAL_RSPS_URI}    ${elements}
 
 
-Get Non Existing Rendered Service Path
-    [Documentation]    Get Non Existing Rendered Service Path Through RESTConf APIs
-    Post Elements To URI As JSON    ${OPERATIONS_CREATE_RSP_URI}    ${CREATE_RSP1_INPUT}
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}rendered-service-path/non-existing-rsp
-    Should Be Equal As Strings    ${resp.status_code}    404
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    Should Not Contain    ${resp.content}    non-existing-rsp
+Get Rendered Service Path Hop
+    [Documentation]    Check Rendered Service Path Hops Created in "Basic Environment Setup Tests"
+    ${sfp_name} =    BuiltIn.Set Variable    SFC1-100
+    ${rsp_name} =    SfcKeywords.Get Rendered Service Path Name    ${sfp_name}
+    ${resp} =    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSP_URI}${rsp_name}/rendered-service-path-hop/0/
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    ${elements} =    BuiltIn.Create List    "hop-number":0    "service-index":255    "service-function-name":"dpi
+    Utils.Check For Elements At URI    ${OPERATIONAL_RSP_URI}${rsp_name}/rendered-service-path-hop/0/    ${elements}
+    ${elements} =    BuiltIn.Create List    "hop-number":1    "service-index":254    "service-function-name":"napt44
+    Utils.Check For Elements At URI    ${OPERATIONAL_RSP_URI}${rsp_name}/rendered-service-path-hop/1/    ${elements}
+    ${elements} =    BuiltIn.Create List    "hop-number":2    "service-index":253    "service-function-name":"firewall
+    Utils.Check For Elements At URI    ${OPERATIONAL_RSP_URI}${rsp_name}/rendered-service-path-hop/2/    ${elements}
+    ${resp} =    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSP_URI}${rsp_name}/rendered-service-path-hop/3/
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    404
 
 Delete one Rendered Service Path By Name
 
 Delete one Rendered Service Path By Name
-    [Documentation]    Delete One Rendered Service Path By Name Through RESTConf APIs
-    Post Elements To URI As JSON    ${OPERATIONS_CREATE_RSP_URI}    ${CREATE_RSP1_INPUT}
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    Should Contain    ${resp.content}    "name":"SFC1-100-RSP-1"
-    Post Elements To URI As JSON    ${OPERATIONS_DELETE_RSP_URI}    ${DELETE_RSP1_INPUT}
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1
-    Should Be Equal As Strings    ${resp.status_code}    404
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    Should Not Contain    ${resp.content}    "name":"SFC1-100-RSP-1"
-
-Delete Non Existing Rendered Service Path By Name
-    [Documentation]    Delete One Rendered Service Path By Name Through RESTConf APIs
-    Post Elements To URI As JSON    ${OPERATIONS_CREATE_RSP_URI}    ${CREATE_RSP1_INPUT}
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    Should Contain    ${resp.content}    "name":"SFC1-100-RSP-1"
-    Post Elements To URI As JSON    ${OPERATIONS_DELETE_RSP_URI}    ${DELETE_RSP2_INPUT}
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    Should Not Contain    ${resp.content}    {"rendered-service-paths":{}}
-
-Get Rendered Service Path Hop
-    [Documentation]    Get Rendered Service Path By Name Through RESTConf APIs
-    Post Elements To URI As JSON    ${OPERATIONS_CREATE_RSP_URI}    ${CREATE_RSP1_INPUT}
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1/rendered-service-path-hop/0/
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    ${elements}=    Create List    "hop-number":0    "service-index":255    "service-function-name":"dpi
-    Check For Elements At URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1/rendered-service-path-hop/0/    ${elements}
-    ${elements}=    Create List    "hop-number":1    "service-index":254    "service-function-name":"napt44
-    Check For Elements At URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1/rendered-service-path-hop/1/    ${elements}
-    ${elements}=    Create List    "hop-number":2    "service-index":253    "service-function-name":"firewall
-    Check For Elements At URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1/rendered-service-path-hop/2/    ${elements}
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1/rendered-service-path-hop/3/
-    Should Be Equal As Strings    ${resp.status_code}    404
-    Post Elements To URI As JSON    ${OPERATIONS_DELETE_RSP_URI}    ${DELETE_RSP1_INPUT}
+    [Documentation]    Delete One Rendered Service Path By deleting the parent Service Function Path
+    ...    The RSP to be deleted was created in "Basic Environment Setup Tests"
+    ${sfp_name} =    BuiltIn.Set Variable    SFC2-200
+    ${rsp_name} =    SfcKeywords.Get Rendered Service Path Name    ${sfp_name}
+    # First verify that the RSP exists
+    ${resp} =    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSP_URI}${rsp_name}
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    SfcKeywords.Delete Sfp And Wait For Rsps Deletion    ${sfp_name}
 
 Generate RSPs with Random Schedule Algorithm type
     [Documentation]    Generate RSPs with Random Schedule Algorithm type Through RESTConf APIs
 
 Generate RSPs with Random Schedule Algorithm type
     [Documentation]    Generate RSPs with Random Schedule Algorithm type Through RESTConf APIs
-    Remove All Elements At URI    ${SERVICE_SCHED_TYPES_URI}
-    Add Elements To URI From File    ${SERVICE_RANDOM_SCHED_TYPE_URI}    ${SERVICE_RANDOM_SCHED_TYPE_FILE}
-    Post Elements To URI As JSON    ${OPERATIONS_CREATE_RSP_URI}    ${CREATE_RSP1_INPUT}
-    ${elements}=    Create List    "hop-number":0    "service-index":255    "service-function-name":"dpi
-    Check For Elements At URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1/rendered-service-path-hop/0/    ${elements}
-    ${elements}=    Create List    "hop-number":1    "service-index":254    "service-function-name":"napt44
-    Check For Elements At URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1/rendered-service-path-hop/1/    ${elements}
-    ${elements}=    Create List    "hop-number":2    "service-index":253    "service-function-name":"firewall
-    Check For Elements At URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1/rendered-service-path-hop/2/    ${elements}
-    Post Elements To URI As JSON    ${OPERATIONS_CREATE_RSP_URI}    ${CREATE_RSP2_INPUT}
-    ${elements}=    Create List    "hop-number":0    "service-index":255    "service-function-name":"dpi
-    Check For Elements At URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-2/rendered-service-path-hop/0/    ${elements}
-    ${elements}=    Create List    "hop-number":1    "service-index":254    "service-function-name":"napt44
-    Check For Elements At URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-2/rendered-service-path-hop/1/    ${elements}
-    ${elements}=    Create List    "hop-number":2    "service-index":253    "service-function-name":"firewall
-    Check For Elements At URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-2/rendered-service-path-hop/2/    ${elements}
-    Post Elements To URI As JSON    ${OPERATIONS_DELETE_RSP_URI}    ${DELETE_RSP1_INPUT}
-    Post Elements To URI As JSON    ${OPERATIONS_DELETE_RSP_URI}    ${DELETE_RSP2_INPUT}
+    Utils.Remove All Elements At URI    ${SERVICE_SCHED_TYPES_URI}
+    Utils.Add Elements To URI From File    ${SERVICE_RANDOM_SCHED_TYPE_URI}    ${SERVICE_RANDOM_SCHED_TYPE_FILE}
+    SfcKeywords.Delete All Sfps And Wait For Rsps Deletion
+    # Create the SFPs which will create the RSPs with the Random scheduler
+    ${created_sfps} =    BuiltIn.Create List    "SFC1-100"    "SFC1-200"    "SFC1-300"    "SFC2-100"    "SFC2-200"
+    SfcKeywords.Create Sfp And Wait For Rsp Creation    ${SERVICE_FUNCTION_PATHS_FILE}    ${created_sfps}
+    ${sfp_name} =    BuiltIn.Set Variable    SFC1-100
+    ${rsp_name} =    SfcKeywords.Get Rendered Service Path Name    ${sfp_name}
+    ${elements} =    BuiltIn.Create List    "hop-number":0    "service-index":255    "service-function-name":"dpi
+    Utils.Check For Elements At URI    ${OPERATIONAL_RSP_URI}${rsp_name}/rendered-service-path-hop/0/    ${elements}
+    ${elements} =    BuiltIn.Create List    "hop-number":1    "service-index":254    "service-function-name":"napt44
+    Utils.Check For Elements At URI    ${OPERATIONAL_RSP_URI}${rsp_name}/rendered-service-path-hop/1/    ${elements}
+    ${elements} =    BuiltIn.Create List    "hop-number":2    "service-index":253    "service-function-name":"firewall
+    Utils.Check For Elements At URI    ${OPERATIONAL_RSP_URI}${rsp_name}/rendered-service-path-hop/2/    ${elements}
 
 Generate RSPs with Round Robin Schedule Algorithm type
     [Documentation]    Generate RSPs with Round Robin Schedule Algorithm type
     [Tags]    exclude
 
 Generate RSPs with Round Robin Schedule Algorithm type
     [Documentation]    Generate RSPs with Round Robin Schedule Algorithm type
     [Tags]    exclude
-    Remove All Elements At URI    ${SERVICE_SCHED_TYPES_URI}
-    Add Elements To URI From File    ${SERVICE_ROUNDROBIN_SCHED_TYPE_URI}    ${SERVICE_ROUNDROBIN_SCHED_TYPE_FILE}
-    Post Elements To URI As JSON    ${OPERATIONS_CREATE_RSP_URI}    ${CREATE_RSP1_INPUT}
-    Post Elements To URI As JSON    ${OPERATIONS_CREATE_RSP_URI}    ${CREATE_RSP2_INPUT}
-    Post Elements To URI As JSON    ${OPERATIONS_CREATE_RSP_URI}    ${CREATE_RSP3_INPUT}
-    Post Elements To URI As JSON    ${OPERATIONS_CREATE_RSP_URI}    ${CREATE_RSP4_INPUT}
-    Post Elements To URI As JSON    ${OPERATIONS_CREATE_RSP_URI}    ${CREATE_RSP5_INPUT}
-    Post Elements To URI As JSON    ${OPERATIONS_CREATE_RSP_URI}    ${CREATE_RSP6_INPUT}
-    ${path1_hop0}    Get JSON Elements From URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1/rendered-service-path-hop/0/
-    ${path1_hop1}    Get JSON Elements From URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1/rendered-service-path-hop/1/
-    ${path1_hop2}    Get JSON Elements From URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1/rendered-service-path-hop/2/
-    ${path2_hop0}    Get JSON Elements From URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-2/rendered-service-path-hop/0/
-    ${path2_hop1}    Get JSON Elements From URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-2/rendered-service-path-hop/1/
-    ${path2_hop2}    Get JSON Elements From URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-2/rendered-service-path-hop/2/
-    ${path3_hop0}    Get JSON Elements From URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-3/rendered-service-path-hop/0/
-    ${path3_hop1}    Get JSON Elements From URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-3/rendered-service-path-hop/1/
-    ${path3_hop2}    Get JSON Elements From URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-3/rendered-service-path-hop/2/
-    ${path4_hop0}    Get JSON Elements From URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-4/rendered-service-path-hop/0/
-    ${path4_hop1}    Get JSON Elements From URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-4/rendered-service-path-hop/1/
-    ${path4_hop2}    Get JSON Elements From URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-4/rendered-service-path-hop/2/
-    ${path5_hop0}    Get JSON Elements From URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-5/rendered-service-path-hop/0/
-    ${path5_hop1}    Get JSON Elements From URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-5/rendered-service-path-hop/1/
-    ${path5_hop2}    Get JSON Elements From URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-5/rendered-service-path-hop/2/
-    ${path6_hop0}    Get JSON Elements From URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-6/rendered-service-path-hop/0/
-    ${path6_hop1}    Get JSON Elements From URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-6/rendered-service-path-hop/1/
-    ${path6_hop2}    Get JSON Elements From URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-6/rendered-service-path-hop/2/
-    Should Be Equal    ${path1_hop0}    ${path4_hop0}
-    Should Not Be Equal    ${path1_hop0}    ${path2_hop0}
-    Should Be Equal    ${path1_hop1}    ${path4_hop1}
-    Should Not Be Equal    ${path1_hop1}    ${path2_hop1}
-    Should Be Equal    ${path1_hop2}    ${path4_hop2}
-    Should Not Be Equal    ${path1_hop2}    ${path2_hop2}
-    Should Be Equal    ${path2_hop0}    ${path5_hop0}
-    Should Not Be Equal    ${path2_hop0}    ${path3_hop0}
-    Should Be Equal    ${path2_hop1}    ${path5_hop1}
-    Should Not Be Equal    ${path2_hop1}    ${path3_hop1}
-    Should Be Equal    ${path2_hop2}    ${path5_hop2}
-    Should Not Be Equal    ${path2_hop2}    ${path3_hop2}
-    Should Be Equal    ${path3_hop0}    ${path6_hop0}
-    Should Not Be Equal    ${path3_hop0}    ${path1_hop0}
-    Should Be Equal    ${path3_hop1}    ${path6_hop1}
-    Should Not Be Equal    ${path3_hop1}    ${path1_hop1}
-    Should Be Equal    ${path3_hop2}    ${path6_hop2}
-    Should Not Be Equal    ${path3_hop2}    ${path1_hop2}
-    Post Elements To URI As JSON    ${OPERATIONS_DELETE_RSP_URI}    ${DELETE_RSP1_INPUT}
-    Post Elements To URI As JSON    ${OPERATIONS_DELETE_RSP_URI}    ${DELETE_RSP2_INPUT}
-    Post Elements To URI As JSON    ${OPERATIONS_DELETE_RSP_URI}    ${DELETE_RSP3_INPUT}
-    Post Elements To URI As JSON    ${OPERATIONS_DELETE_RSP_URI}    ${DELETE_RSP4_INPUT}
-    Post Elements To URI As JSON    ${OPERATIONS_DELETE_RSP_URI}    ${DELETE_RSP5_INPUT}
-    Post Elements To URI As JSON    ${OPERATIONS_DELETE_RSP_URI}    ${DELETE_RSP6_INPUT}
+    Utils.Remove All Elements At URI    ${SERVICE_SCHED_TYPES_URI}
+    Utils.Add Elements To URI From File    ${SERVICE_ROUNDROBIN_SCHED_TYPE_URI}    ${SERVICE_ROUNDROBIN_SCHED_TYPE_FILE}
+    SfcKeywords.Delete All Sfps And Wait For Rsps Deletion
+    # Create the SFPs which will create the RSPs with the Random scheduler
+    ${created_sfps} =    BuiltIn.Create List    "SFC1-100"    "SFC1-200"    "SFC1-300"    "SFC2-100"    "SFC2-200"
+    SfcKeywords.Create Sfp And Wait For Rsp Creation    ${SERVICE_FUNCTION_PATHS_FILE}    ${created_sfps}
+    ${rsp1_name} =    SfcKeywords.Get Rendered Service Path Name    SFC1-100
+    ${rsp2_name} =    SfcKeywords.Get Rendered Service Path Name    SFC1-200
+    ${rsp3_name} =    SfcKeywords.Get Rendered Service Path Name    SFC1-300
+    ${rsp4_name} =    SfcKeywords.Get Rendered Service Path Name    SFC2-100
+    ${rsp5_name} =    SfcKeywords.Get Rendered Service Path Name    SFC2-200
+    ${path1_hop0} =    SfcKeywords.Get JSON Elements From URI    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/0/
+    ${path1_hop1} =    SfcKeywords.Get JSON Elements From URI    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/1/
+    ${path1_hop2} =    SfcKeywords.Get JSON Elements From URI    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/2/
+    ${path2_hop0} =    SfcKeywords.Get JSON Elements From URI    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/0/
+    ${path2_hop1} =    SfcKeywords.Get JSON Elements From URI    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/1/
+    ${path2_hop2} =    SfcKeywords.Get JSON Elements From URI    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/2/
+    ${path3_hop0} =    SfcKeywords.Get JSON Elements From URI    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/0/
+    ${path3_hop1} =    SfcKeywords.Get JSON Elements From URI    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/1/
+    ${path3_hop2} =    SfcKeywords.Get JSON Elements From URI    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/2/
+    ${path4_hop0} =    SfcKeywords.Get JSON Elements From URI    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/0/
+    ${path4_hop1} =    SfcKeywords.Get JSON Elements From URI    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/1/
+    ${path4_hop2} =    SfcKeywords.Get JSON Elements From URI    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/2/
+    ${path5_hop0} =    SfcKeywords.Get JSON Elements From URI    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/0/
+    ${path5_hop1} =    SfcKeywords.Get JSON Elements From URI    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/1/
+    ${path5_hop2} =    SfcKeywords.Get JSON Elements From URI    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/2/
+    BuiltIn.Should Be Equal    ${path1_hop0}    ${path4_hop0}
+    BuiltIn.Should Not Be Equal    ${path1_hop0}    ${path2_hop0}
+    BuiltIn.Should Be Equal    ${path1_hop1}    ${path4_hop1}
+    BuiltIn.Should Not Be Equal    ${path1_hop1}    ${path2_hop1}
+    BuiltIn.Should Be Equal    ${path1_hop2}    ${path4_hop2}
+    BuiltIn.Should Not Be Equal    ${path1_hop2}    ${path2_hop2}
+    BuiltIn.Should Be Equal    ${path2_hop0}    ${path5_hop0}
+    BuiltIn.Should Not Be Equal    ${path2_hop0}    ${path3_hop0}
+    BuiltIn.Should Be Equal    ${path2_hop1}    ${path5_hop1}
+    BuiltIn.Should Not Be Equal    ${path2_hop1}    ${path3_hop1}
+    BuiltIn.Should Be Equal    ${path2_hop2}    ${path5_hop2}
+    BuiltIn.Should Not Be Equal    ${path2_hop2}    ${path3_hop2}
+    BuiltIn.Should Be Equal    ${path3_hop0}    ${path1_hop0}
+    BuiltIn.Should Not Be Equal    ${path3_hop0}    ${path1_hop0}
+    BuiltIn.Should Be Equal    ${path3_hop1}    ${path1_hop1}
+    BuiltIn.Should Not Be Equal    ${path3_hop1}    ${path1_hop1}
+    BuiltIn.Should Be Equal    ${path3_hop2}    ${path1_hop2}
+    BuiltIn.Should Not Be Equal    ${path3_hop2}    ${path1_hop2}
 
 Generate RSPs with Shortest Path Schedule Algorithm type
     [Documentation]    Generate RSPs with Shortest Path Schedule Algorithm type Through RESTConf APIs
 
 Generate RSPs with Shortest Path Schedule Algorithm type
     [Documentation]    Generate RSPs with Shortest Path Schedule Algorithm type Through RESTConf APIs
-    Remove All Elements At URI    ${SERVICE_SCHED_TYPES_URI}
-    Add Elements To URI From File    ${SERVICE_SHORTESTPATH_SCHED_TYPE_URI}    ${SERVICE_SHORTESTPATH_SCHED_TYPE_FILE}
-    Post Elements To URI As JSON    ${OPERATIONS_CREATE_RSP_URI}    ${CREATE_RSP1_INPUT}
-    ${elements}=    Create List    "hop-number":0    "service-index":255    "service-function-name":"dpi-1
-    Check For Elements At URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1/rendered-service-path-hop/0/    ${elements}
-    ${elements}=    Create List    "hop-number":1    "service-index":254    "service-function-name":"napt44
-    Check For Elements At URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1/rendered-service-path-hop/1/    ${elements}
-    ${elements}=    Create List    "hop-number":2    "service-index":253    "service-function-name":"firewall
-    Check For Elements At URI    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1/rendered-service-path-hop/2/    ${elements}
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1/rendered-service-path-hop/0/
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    ${fwd_hop1}    Extract Value From Content    ${resp.content}    /rendered-service-path-hop/0/service-function-forwarder
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1/rendered-service-path-hop/1/
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    ${fwd_hop2}    Extract Value From Content    ${resp.content}    /rendered-service-path-hop/0/service-function-forwarder
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-1/rendered-service-path-hop/2/
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    ${fwd_hop3}    Extract Value From Content    ${resp.content}    /rendered-service-path-hop/0/service-function-forwarder
-    Should Be Equal    ${fwd_hop1}    ${fwd_hop2}
-    Should Be Equal    ${fwd_hop2}    ${fwd_hop3}
-    Post Elements To URI As JSON    ${OPERATIONS_CREATE_RSP_URI}    ${CREATE_RSP2_INPUT}
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-2/rendered-service-path-hop/0/
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    ${fwd_hop1}    Extract Value From Content    ${resp.content}    /rendered-service-path-hop/0/service-function-forwarder
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-2/rendered-service-path-hop/1/
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    ${fwd_hop2}    Extract Value From Content    ${resp.content}    /rendered-service-path-hop/0/service-function-forwarder
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}rendered-service-path/SFC1-100-RSP-2/rendered-service-path-hop/2/
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    ${fwd_hop3}    Extract Value From Content    ${resp.content}    /rendered-service-path-hop/0/service-function-forwarder
-    Should Be Equal    ${fwd_hop1}    ${fwd_hop2}
-    Should Be Equal    ${fwd_hop2}    ${fwd_hop3}
-    Post Elements To URI As JSON    ${OPERATIONS_DELETE_RSP_URI}    ${DELETE_RSP1_INPUT}
-    Post Elements To URI As JSON    ${OPERATIONS_DELETE_RSP_URI}    ${DELETE_RSP2_INPUT}
+    Utils.Remove All Elements At URI    ${SERVICE_SCHED_TYPES_URI}
+    Utils.Add Elements To URI From File    ${SERVICE_SHORTESTPATH_SCHED_TYPE_URI}    ${SERVICE_SHORTESTPATH_SCHED_TYPE_FILE}
+    SfcKeywords.Delete All Sfps And Wait For Rsps Deletion
+    # Create the SFPs which will create the RSPs with the Random scheduler
+    ${created_sfps} =    BuiltIn.Create List    "SFC1-100"    "SFC1-200"    "SFC1-300"    "SFC2-100"    "SFC2-200"
+    SfcKeywords.Create Sfp And Wait For Rsp Creation    ${SERVICE_FUNCTION_PATHS_FILE}    ${created_sfps}
+    ${rsp1_name} =    SfcKeywords.Get Rendered Service Path Name    SFC1-100
+    ${rsp2_name} =    SfcKeywords.Get Rendered Service Path Name    SFC1-200
+    ${rsp3_name} =    SfcKeywords.Get Rendered Service Path Name    SFC1-300
+    ${rsp4_name} =    SfcKeywords.Get Rendered Service Path Name    SFC2-100
+    ${rsp5_name} =    SfcKeywords.Get Rendered Service Path Name    SFC2-200
+    ${elements} =    BuiltIn.Create List    "hop-number":0    "service-index":255    "service-function-name":"dpi-1
+    Utils.Check For Elements At URI    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/0/    ${elements}
+    ${elements} =    BuiltIn.Create List    "hop-number":1    "service-index":254    "service-function-name":"napt44
+    Utils.Check For Elements At URI    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/1/    ${elements}
+    ${elements} =    BuiltIn.Create List    "hop-number":2    "service-index":253    "service-function-name":"firewall
+    Utils.Check For Elements At URI    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/2/    ${elements}
+    ${resp} =    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/0/
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    ${fwd_hop1} =    Utils.Extract Value From Content    ${resp.content}    /rendered-service-path-hop/0/service-function-forwarder
+    ${resp} =    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/1/
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    ${fwd_hop2} =    Utils.Extract Value From Content    ${resp.content}    /rendered-service-path-hop/0/service-function-forwarder
+    ${resp} =    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSP_URI}${rsp1_name}/rendered-service-path-hop/2/
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    ${fwd_hop3} =    Utils.Extract Value From Content    ${resp.content}    /rendered-service-path-hop/0/service-function-forwarder
+    BuiltIn.Should Be Equal    ${fwd_hop1}    ${fwd_hop2}
+    BuiltIn.Should Be Equal    ${fwd_hop2}    ${fwd_hop3}
+    ${resp} =    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSP_URI}${rsp2_name}/rendered-service-path-hop/0/
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    ${fwd_hop1} =    Utils.Extract Value From Content    ${resp.content}    /rendered-service-path-hop/0/service-function-forwarder
+    ${resp} =    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSP_URI}${rsp2_name}/rendered-service-path-hop/1/
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    ${fwd_hop2} =    Utils.Extract Value From Content    ${resp.content}    /rendered-service-path-hop/0/service-function-forwarder
+    ${resp} =    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSP_URI}${rsp2_name}/rendered-service-path-hop/2/
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    ${fwd_hop3} =    Utils.Extract Value From Content    ${resp.content}    /rendered-service-path-hop/0/service-function-forwarder
+    BuiltIn.Should Be Equal    ${fwd_hop1}    ${fwd_hop2}
+    BuiltIn.Should Be Equal    ${fwd_hop2}    ${fwd_hop3}
 
 Clean Datastore After Tests
     [Documentation]    Clean All Items In Datastore After Tests
 
 Clean Datastore After Tests
     [Documentation]    Clean All Items In Datastore After Tests
-    Remove All Elements At URI    ${SERVICE_FUNCTIONS_URI}
-    Wait Until Keyword Succeeds    60s    2s    Check Service Function Types Removed    ${SERVICE_FUNCTION_NAMES}
-    Remove All Elements At URI    ${SERVICE_FORWARDERS_URI}
-    Remove All Elements At URI    ${SERVICE_NODES_URI}
-    Remove All Elements At URI    ${SERVICE_CHAINS_URI}
-    Remove All Elements At URI    ${SERVICE_SCHED_TYPES_URI}
-    Remove All Elements At URI    ${SERVICE_FUNCTION_PATHS_URI}
+    Utils.Remove All Elements At URI    ${SERVICE_FUNCTIONS_URI}
+    BuiltIn.Wait Until Keyword Succeeds    60s    2s    SfcKeywords.Check Service Function Types Removed    ${SERVICE_FUNCTION_NAMES}
+    Utils.Remove All Elements At URI    ${SERVICE_FORWARDERS_URI}
+    Utils.Remove All Elements At URI    ${SERVICE_NODES_URI}
+    Utils.Remove All Elements At URI    ${SERVICE_CHAINS_URI}
+    Utils.Remove All Elements At URI    ${SERVICE_SCHED_TYPES_URI}
+    Utils.Remove All Elements At URI    ${SERVICE_FUNCTION_PATHS_URI}
+    BuiltIn.Wait Until Keyword Succeeds    60s    2s    SfcKeywords.Check Empty Service Function Paths State
 
 *** Keywords ***
 
 *** Keywords ***
-Post Elements To URI As JSON
-    [Arguments]    ${uri}    ${data}
-    ${resp}    RequestsLibrary.Post Request    session    ${uri}    data=${data}    headers=${headers}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-
-Get JSON Elements From URI
-    [Arguments]    ${uri}
-    ${resp}    RequestsLibrary.Get Request    session    ${uri}
-    ${value}    To Json    ${resp.content}
-    [Return]    ${value}
-
 Init Suite
     [Documentation]    Create session and initialize ODL version specific variables
 Init Suite
     [Documentation]    Create session and initialize ODL version specific variables
-    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    @{SERVICE_FUNCTION_NAMES}    "napt44-103-2"    "napt44-103-1"    "dpi-102-2"    "firewall-101-2"    "napt44-104"
+    RequestsLibrary.Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
+    BuiltIn.log    ${ODL_STREAM}
+    BuiltIn.Set Suite Variable    ${VERSION_DIR}    master
+    BuiltIn.Set Suite Variable    ${SERVICE_FUNCTIONS_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-functions.json
+    BuiltIn.Set Suite Variable    @{SERVICE_FUNCTION_NAMES}    "napt44-103-2"    "napt44-103-1"    "dpi-102-2"    "firewall-101-2"    "napt44-104"
     ...    "dpi-102-1"    "firewall-104"    "dpi-102-3"    "firewall-101-1"
     ...    "dpi-102-1"    "firewall-104"    "dpi-102-3"    "firewall-101-1"
-    Set Suite Variable    ${SERVICE_FORWARDERS_URI}    /restconf/config/service-function-forwarder:service-function-forwarders/
-    Set Suite Variable    ${SERVICE_FORWARDERS_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-function-forwarders.json
-    Set Suite Variable    ${SERVICE_NODES_URI}    /restconf/config/service-node:service-nodes/
-    Set Suite Variable    ${SERVICE_NODES_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-nodes.json
-    Set Suite Variable    ${SERVICE_CHAINS_URI}    /restconf/config/service-function-chain:service-function-chains/
-    Set Suite Variable    ${SERVICE_CHAINS_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-function-chains.json
-    Set Suite Variable    ${SERVICE_FUNCTION_PATHS_URI}    /restconf/config/service-function-path:service-function-paths/
-    Set Suite Variable    ${SERVICE_FUNCTION_PATHS_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-function-paths.json
-    Set Suite Variable    ${SERVICE_SCHED_TYPES_URI}    /restconf/config/service-function-scheduler-type:service-function-scheduler-types/
-    Set Suite Variable    ${SERVICE_SCHED_TYPE_URI_BASE}    ${SERVICE_SCHED_TYPES_URI}service-function-scheduler-type/service-function-scheduler-type:
-    Set Suite Variable    ${SERVICE_RANDOM_SCHED_TYPE_URI}    ${SERVICE_SCHED_TYPE_URI_BASE}random
-    Set Suite Variable    ${SERVICE_RANDOM_SCHED_TYPE_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-random-schedule-type.json
-    Set Suite Variable    ${SERVICE_ROUNDROBIN_SCHED_TYPE_URI}    ${SERVICE_SCHED_TYPE_URI_BASE}round-robin
-    Set Suite Variable    ${SERVICE_ROUNDROBIN_SCHED_TYPE_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-roundrobin-schedule-type.json
-    Set Suite Variable    ${SERVICE_LOADBALANCE_SCHED_TYPE_URI}    ${SERVICE_SCHED_TYPE_URI_BASE}load-balance
-    Set Suite Variable    ${SERVICE_LOADBALANCE_SCHED_TYPE_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-loadbalance-schedule-type.json
-    Set Suite Variable    ${SERVICE_SHORTESTPATH_SCHED_TYPE_URI}    ${SERVICE_SCHED_TYPE_URI_BASE}shortest-path
-    Set Suite Variable    ${SERVICE_SHORTESTPATH_SCHED_TYPE_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-shortestpath-schedule-type.json
-    Set Suite Variable    ${RENDERED_SERVICE_PATHS_URI}    /restconf/config/rendered-service-path:rendered-service-paths/
-    Set Suite Variable    ${OPERATIONAL_RSPS_URI}    /restconf/operational/rendered-service-path:rendered-service-paths/
-    Set Suite Variable    ${OPERATIONS_CREATE_RSP_URI}    /restconf/operations/rendered-service-path:create-rendered-path/
-    Set Suite Variable    ${OPERATIONS_DELETE_RSP_URI}    /restconf/operations/rendered-service-path:delete-rendered-path
-    Set Suite Variable    ${CREATE_RSP1_INPUT}    {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-RSP-1"}}
-    Set Suite Variable    ${CREATE_RSP2_INPUT}    {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-RSP-2"}}
-    Set Suite Variable    ${CREATE_RSP3_INPUT}    {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-RSP-3"}}
-    Set Suite Variable    ${CREATE_RSP4_INPUT}    {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-RSP-4"}}
-    Set Suite Variable    ${CREATE_RSP5_INPUT}    {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-RSP-5"}}
-    Set Suite Variable    ${CREATE_RSP6_INPUT}    {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-RSP-6"}}
-    Set Suite Variable    ${CREATE_RSP_FAILURE_INPUT}    {"input":{"parent-service-function-path":"SFC1-empty","name":"SFC1-empty-Path-1"}}
-    Set Suite Variable    ${DELETE_RSP1_INPUT}    {"input":{"name":"SFC1-100-RSP-1"}}
-    Set Suite Variable    ${DELETE_RSP2_INPUT}    {"input":{"name":"SFC1-100-RSP-2"}}
-    Set Suite Variable    ${DELETE_RSP3_INPUT}    {"input":{"name":"SFC1-100-RSP-3"}}
-    Set Suite Variable    ${DELETE_RSP4_INPUT}    {"input":{"name":"SFC1-100-RSP-4"}}
-    Set Suite Variable    ${DELETE_RSP5_INPUT}    {"input":{"name":"SFC1-100-RSP-5"}}
-    Set Suite Variable    ${DELETE_RSP6_INPUT}    {"input":{"name":"SFC1-100-RSP-6"}}
+    BuiltIn.Set Suite Variable    ${SERVICE_FORWARDERS_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-function-forwarders.json
+    BuiltIn.Set Suite Variable    ${SERVICE_NODES_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-nodes.json
+    BuiltIn.Set Suite Variable    ${SERVICE_CHAINS_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-function-chains.json
+    BuiltIn.Set Suite Variable    ${SERVICE_FUNCTION_PATHS_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-function-paths.json
+    BuiltIn.Set Suite Variable    ${SERVICE_RANDOM_SCHED_TYPE_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-random-schedule-type.json
+    BuiltIn.Set Suite Variable    ${SERVICE_ROUNDROBIN_SCHED_TYPE_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-roundrobin-schedule-type.json
+    BuiltIn.Set Suite Variable    ${SERVICE_LOADBALANCE_SCHED_TYPE_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-loadbalance-schedule-type.json
+    BuiltIn.Set Suite Variable    ${SERVICE_SHORTESTPATH_SCHED_TYPE_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-shortestpath-schedule-type.json
index b4553d8a8daf82674991e14323afd3e33883a9d2..2aa7f0c2266a3ec69fe1e04481e09038efc3eb5b 100644 (file)
@@ -18,5 +18,6 @@ sfc_data_models = [
     'operational/ietf-interfaces:interfaces-state',
     'operational/network-topology:network-topology/topology/ovsdb:1',
     'operational/opendaylight-inventory:nodes',
     'operational/ietf-interfaces:interfaces-state',
     'operational/network-topology:network-topology/topology/ovsdb:1',
     'operational/opendaylight-inventory:nodes',
-    'operational/rendered-service-path:rendered-service-path'
+    'operational/rendered-service-path:rendered-service-paths',
+    'operational/service-function-path:service-function-paths-state'
 ]
 ]
index ff0a4c7957c89249135e7005ab45099f3bfa6829..ca91fd3e8c93dc74ee37f70d3e6590715cf970be 100644 (file)
@@ -13,12 +13,18 @@ ${SERVICE_FORWARDER_URI}    ${REST_CONFIG}/service-function-forwarder:service-fu
 ${SERVICE_NODES_URI}    ${REST_CONFIG}/service-node:service-nodes/
 ${SERVICE_CHAINS_URI}    ${REST_CONFIG}/service-function-chain:service-function-chains/
 ${SERVICE_FUNCTION_PATHS_URI}    ${REST_CONFIG}/service-function-path:service-function-paths/
 ${SERVICE_NODES_URI}    ${REST_CONFIG}/service-node:service-nodes/
 ${SERVICE_CHAINS_URI}    ${REST_CONFIG}/service-function-chain:service-function-chains/
 ${SERVICE_FUNCTION_PATHS_URI}    ${REST_CONFIG}/service-function-path:service-function-paths/
+${SERVICE_FUNCTION_PATH_URI}    ${SERVICE_FUNCTION_PATHS_URI}service-function-path/
+${SERVICE_FUNCTION_PATHS_STATE_URI}    ${REST_OPER}/service-function-path:service-function-paths-state/
+${SERVICE_FUNCTION_PATH_STATE_URI}    ${SERVICE_FUNCTION_PATHS_STATE_URI}service-function-path-state/
 ${SERVICE_SCHED_TYPES_URI}    ${REST_CONFIG}/service-function-scheduler-type:service-function-scheduler-types/
 ${SERVICE_SCHED_TYPE_URI_BASE}    ${SERVICE_SCHED_TYPES_URI}service-function-scheduler-type/service-function-scheduler-type:
 ${SERVICE_RANDOM_SCHED_TYPE_URI}    ${SERVICE_SCHED_TYPE_URI_BASE}random
 ${SERVICE_SCHED_TYPES_URI}    ${REST_CONFIG}/service-function-scheduler-type:service-function-scheduler-types/
 ${SERVICE_SCHED_TYPE_URI_BASE}    ${SERVICE_SCHED_TYPES_URI}service-function-scheduler-type/service-function-scheduler-type:
 ${SERVICE_RANDOM_SCHED_TYPE_URI}    ${SERVICE_SCHED_TYPE_URI_BASE}random
+${SERVICE_LOADBALANCE_SCHED_TYPE_URI}    ${SERVICE_SCHED_TYPE_URI_BASE}load-balance
 ${SERVICE_ROUNDROBIN_SCHED_TYPE_URI}    ${SERVICE_SCHED_TYPE_URI_BASE}round-robin
 ${SERVICE_ROUNDROBIN_SCHED_TYPE_URI}    ${SERVICE_SCHED_TYPE_URI_BASE}round-robin
+${SERVICE_SHORTESTPATH_SCHED_TYPE_URI}    ${SERVICE_SCHED_TYPE_URI_BASE}shortest-path
 ${SERVICE_METADATA_URI}    ${REST_CONFIG}/service-function-path-metadata:service-function-metadata/
 ${OPERATIONAL_RSPS_URI}    ${REST_OPER}/rendered-service-path:rendered-service-paths/
 ${SERVICE_METADATA_URI}    ${REST_CONFIG}/service-function-path-metadata:service-function-metadata/
 ${OPERATIONAL_RSPS_URI}    ${REST_OPER}/rendered-service-path:rendered-service-paths/
+${OPERATIONAL_RSP_URI}    ${OPERATIONAL_RSPS_URI}rendered-service-path/
 ${OPERATIONS_CREATE_RSP_URI}    ${REST_RPC}/rendered-service-path:create-rendered-path/
 ${OPERATIONS_DELETE_RSP_URI}    ${REST_RPC}/rendered-service-path:delete-rendered-path/
 ${RENDERED_SERVICE_PATHS_URI}    ${REST_CONFIG}/rendered-service-path:rendered-service-paths/
 ${OPERATIONS_CREATE_RSP_URI}    ${REST_RPC}/rendered-service-path:create-rendered-path/
 ${OPERATIONS_DELETE_RSP_URI}    ${REST_RPC}/rendered-service-path:delete-rendered-path/
 ${RENDERED_SERVICE_PATHS_URI}    ${REST_CONFIG}/rendered-service-path:rendered-service-paths/