2 Documentation Test suite for SFC Rendered Service Paths. Logical SFF
6 Library OperatingSystem
7 Library RequestsLibrary
8 Resource ../../../libraries/SFC/SfcKeywords.robot
9 Resource ../../../variables/sfc/Variables.robot
10 Resource ../../../libraries/Utils.robot
11 Resource ../../../libraries/TemplatedRequests.robot
13 Suite Setup Init Suite
14 Suite Teardown Delete All Elements
19 ${TEST_DIR} ${CURDIR}/../../../variables/sfc/${VERSION_DIR}
20 ${SERVICE_FUNCTIONS_FILE} ${TEST_DIR}/service-functions-logicalsff.json
21 ${SERVICE_FORWARDERS_FILE} ${TEST_DIR}/service-function-forwarders-logicallsff.json
22 ${SERVICE_CHAINS_FILE} ${TEST_DIR}/service-function-chains-logicalsff.json
23 ${SERVICE_FUNCTION_PATHS_FILE} ${TEST_DIR}/service-function-paths-logicalsff.json
25 ... {"input":{"name": "RSP1","parent-service-function-path": "SFP1","symmetric": "true"}}
27 ... {"input":{"name": "RSP2","parent-service-function-path": "SFP2","symmetric": "true"}}
28 ${CREATE_RSP_FAILURE_INPUT}
29 ... {"input":{"name": "RSP1","parent-service-function-path": "SFP3","symmetric": "true"}}
30 ${DELETE_RSP1_INPUT} {"input":{"name":"RSP1"}}
31 ${DELETE_RSP1_REVERSE_INPUT} {"input":{"name":"RSP1-Reverse"}}
32 ${DELETE_RSP2_INPUT} {"input":{"name":"RSP2"}}
33 @{SF_NAMES} "name":"firewall-1" "name":"dpi-1"
37 Basic Environment Setup Tests
38 [Documentation] Prepare Basic Test Environment. Logical SFF
39 Utils.Add Elements To URI From File ${SERVICE_FORWARDERS_URI} ${SERVICE_FORWARDERS_FILE}
40 Utils.Add Elements To URI From File ${SERVICE_FUNCTIONS_URI} ${SERVICE_FUNCTIONS_FILE}
41 BuiltIn.Wait Until Keyword Succeeds 60s 2s SfcKeywords.Check Service Function Types Added ${SF_NAMES}
42 Utils.Add Elements To URI From File ${SERVICE_CHAINS_URI} ${SERVICE_CHAINS_FILE}
43 SfcKeywords.Create Sfp And Wait For Rsp Creation ${SERVICE_FUNCTION_PATHS_FILE}
45 Get Rendered Service Path By Name
46 [Documentation] Get Rendered Service Path By Name Through RESTConf APIs. Logical SFF
47 # The RSP should be symetric, so 2 should be created for the SFP
48 ${rsp_name} = SfcKeywords.Get Rendered Service Path Name ${SFP_NAME}
49 Utils.Get URI And Verify ${OPERATIONAL_RSP_URI}/${rsp_name}
50 ${rsp_name_rev} = SfcKeywords.Get Rendered Service Path Name ${SFP_NAME}
51 Utils.Get URI And Verify ${OPERATIONAL_RSP_URI}/${rsp_name_rev}
52 ${elements} = Create List
53 ... "parent-service-function-path":"${SFP_NAME}"
55 ... "service-index":255
57 ... "service-index":254
58 Utils.Check For Elements At URI ${OPERATIONAL_RSPS_URI} ${elements}
60 Delete one Rendered Service Path By Name
61 [Documentation] Delete One Rendered Service Path By Name Through RESTConf APIs. Logical SFF
62 # First verify that the RSPs exist
63 ${rsp_name} = SfcKeywords.Get Rendered Service Path Name ${SFP_NAME}
64 Utils.Get URI And Verify ${OPERATIONAL_RSP_URI}/${rsp_name}
65 ${rsp_name_rev} = SfcKeywords.Get Rendered Service Path Name ${SFP_NAME} True
66 Utils.Get URI And Verify ${OPERATIONAL_RSP_URI}/${rsp_name_rev}
67 # Delete the SFP, which will delete the RSPs
68 SfcKeywords.Delete Sfp And Wait For Rsps Deletion ${SFP_NAME}
70 Get Rendered Service Path Hop
71 [Documentation] Get Rendered Service Path By Name Through RESTConf APIs. Logical SFF
72 # Create the SFP, which will create the RSPs
73 SfcKeywords.Create Sfp And Wait For Rsp Creation ${SERVICE_FUNCTION_PATHS_FILE}
74 ${rsp_name} = SfcKeywords.Get Rendered Service Path Name ${SFP_NAME}
75 ${elements} = BuiltIn.Create List "hop-number":0 "service-index":255 "service-function-name":"dpi-1
76 Utils.Check For Elements At URI ${OPERATIONAL_RSP_URI}/${rsp_name}/rendered-service-path-hop/0/ ${elements}
77 ${elements} = BuiltIn.Create List
79 ... "service-index":254
80 ... "service-function-name":"firewall-1
81 Utils.Check For Elements At URI ${OPERATIONAL_RSP_URI}/${rsp_name}/rendered-service-path-hop/1/ ${elements}
82 ${resp} = RequestsLibrary.Get Request
84 ... ${OPERATIONAL_RSP_URI}/${rsp_name}/rendered-service-path-hop/2/
85 BuiltIn.Should Be Equal As Strings ${resp.status_code} 404
90 [Documentation] Create session and initialize ODL version specific variables
91 RequestsLibrary.Create Session
93 ... http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
95 ... headers=${HEADERS}
96 BuiltIn.log ${ODL_STREAM}
97 BuiltIn.Set Suite Variable ${SFP_NAME} SFP1
98 BuiltIn.Set Suite Variable ${VERSION_DIR} master
99 BuiltIn.Set Suite Variable
100 ... ${SERVICE_FUNCTIONS_FILE}
101 ... ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-functions-logicalsff.json
102 BuiltIn.Set Suite Variable
103 ... ${SERVICE_FORWARDERS_FILE}
104 ... ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-function-forwarders-logicallsff.json
105 BuiltIn.Set Suite Variable
106 ... ${SERVICE_CHAINS_FILE}
107 ... ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-function-chains-logicalsff.json
108 BuiltIn.Set Suite Variable
109 ... ${SERVICE_FUNCTION_PATHS_FILE}
110 ... ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-function-paths-logicalsff.json
111 BuiltIn.Set Suite Variable @{SF_NAMES} "name":"firewall-1" "name":"dpi-1"
114 [Documentation] Delete all provisioned elements
115 Utils.Remove All Elements If Exist ${SERVICE_FUNCTION_PATHS_URI}
116 Utils.Remove All Elements If Exist ${SERVICE_CHAINS_URI}
117 Utils.Remove All Elements If Exist ${SERVICE_FORWARDERS_URI}
118 Utils.Remove All Elements If Exist ${SERVICE_FUNCTIONS_URI}
119 BuiltIn.Wait Until Keyword Succeeds 60s 2s SfcKeywords.Check Service Function Types Removed ${SF_NAMES}
120 RequestsLibrary.Delete All Sessions