2 Documentation Test suite for SFC Service Function Paths validation. This validation is in charge of verifying that the SF types for the SFs defined in newly added SFPs are consistent with SF types defined in the referenced SFC.
4 Suite Teardown Delete All Sessions
5 Test Setup Remove All Elements If Exist ${SERVICE_FUNCTION_PATHS_URI}
6 Test Teardown Clean_All_URIs
9 Library OperatingSystem
10 Library RequestsLibrary
11 Resource ../../../variables/Variables.robot
12 Resource ../../../variables/sfc/Variables.robot
13 Resource ../../../libraries/Utils.robot
14 Resource ../../../libraries/TemplatedRequests.robot
17 Add Service Function Path referencing a non-existing SF
18 [Documentation] Add Service Function Paths from JSON file
19 Add Elements To URI From File And Check Server Error ${SERVICE_FUNCTION_PATHS_URI} ${SERVICE_FUNCTION_PATHS_WITH_HOP_FILE}
20 ${body} OperatingSystem.Get File ${SERVICE_FUNCTION_PATHS_WITH_HOP_FILE}
21 ${jsonbody} To Json ${body}
22 ${paths} Get From Dictionary ${jsonbody} service-function-paths
23 ${resp} RequestsLibrary.Get Request session ${SERVICE_FUNCTION_PATHS_URI}
24 Should Be Equal As Strings ${resp.status_code} 404
26 Add Service Function Path referencing a non-existing SFC
27 [Documentation] Add Service Function Paths from JSON file
28 Add Elements To URI From File ${SERVICE_FUNCTIONS_URI} ${SERVICE_FUNCTIONS_FILE}
29 Add Elements To URI From File And Check Server Error ${SERVICE_FUNCTION_PATHS_URI} ${SERVICE_FUNCTION_PATHS_WITH_HOP_FILE}
30 ${body} OperatingSystem.Get File ${SERVICE_FUNCTION_PATHS_WITH_HOP_FILE}
31 ${jsonbody} To Json ${body}
32 ${paths} Get From Dictionary ${jsonbody} service-function-paths
33 ${resp} RequestsLibrary.Get Request session ${SERVICE_FUNCTION_PATHS_URI}
34 Should Be Equal As Strings ${resp.status_code} 404
35 Remove All Elements At URI ${SERVICE_FUNCTIONS_URI}
37 Add Service Function Path where SFC types size and hop sizes differ
38 [Documentation] Add Service Function Paths from JSON file
39 Add Elements To URI From File ${SERVICE_FUNCTIONS_URI} ${SERVICE_FUNCTIONS_FILE}
40 Add Elements To URI From File ${SERVICE_CHAINS_URI} ${SERVICE_CHAINS_FILE}
41 Add Elements To URI From File And Check Server Error ${SERVICE_FUNCTION_PATHS_URI} ${SERVICE_FUNCTION_PATHS_WITH_HOP_FILE}
42 ${body} OperatingSystem.Get File ${SERVICE_FUNCTION_PATHS_WITH_HOP_FILE}
43 ${jsonbody} To Json ${body}
44 ${paths} Get From Dictionary ${jsonbody} service-function-paths
45 ${resp} RequestsLibrary.Get Request session ${SERVICE_FUNCTION_PATHS_URI}
46 Should Be Equal As Strings ${resp.status_code} 404
47 Remove All Elements At URI ${SERVICE_CHAINS_URI}
48 Remove All Elements At URI ${SERVICE_FUNCTIONS_URI}
50 Add Service Function Path where SFC types size and types for SFs in hops differ
51 [Documentation] Add Service Function Paths from JSON file
52 Add Elements To URI From File ${SERVICE_FUNCTIONS_URI} ${SERVICE_FUNCTIONS_FILE}
53 Add Elements To URI From File ${SERVICE_CHAINS_URI} ${SERVICE_CHAINS_FILE}
54 Add Elements To URI From File And Check Server Error ${SERVICE_FUNCTION_PATHS_URI} ${SERVICE_FUNCTION_PATHS_WITH_THREE_HOPS_FILE}
55 ${body} OperatingSystem.Get File ${SERVICE_FUNCTION_PATHS_WITH_HOP_FILE}
56 ${jsonbody} To Json ${body}
57 ${paths} Get From Dictionary ${jsonbody} service-function-paths
58 ${resp} RequestsLibrary.Get Request session ${SERVICE_FUNCTION_PATHS_URI}
59 Should Be Equal As Strings ${resp.status_code} 404
60 Remove All Elements At URI ${SERVICE_FUNCTIONS_URI}
61 Remove All Elements At URI ${SERVICE_CHAINS_URI}
63 Add Service Function Path where SFC types size and types for SFs in hops match
64 [Documentation] Add Service Function Paths from JSON file
65 Add Elements To URI From File ${SERVICE_FUNCTIONS_URI} ${SERVICE_FUNCTIONS_FILE}
66 Add Elements To URI From File ${SERVICE_CHAINS_URI} ${SERVICE_CHAINS_FILE_FW_NAPT44_DPI}
67 Add Elements To URI From File And Verify ${SERVICE_FUNCTION_PATHS_URI} ${SERVICE_FUNCTION_PATHS_WITH_THREE_HOPS_FILE}
68 ${body} OperatingSystem.Get File ${SERVICE_FUNCTION_PATHS_FILE}
69 ${jsonbody} To Json ${body}
70 ${paths} Get From Dictionary ${jsonbody} service-function-paths
71 ${resp} RequestsLibrary.Get Request session ${SERVICE_FUNCTION_PATHS_URI}
72 Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
73 ${result} To JSON ${resp.content}
74 ${path} Get From Dictionary ${result} service-function-paths
75 Lists Should be Equal ${path} ${paths}
79 [Documentation] Initialize session and ODL version specific variables
80 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
82 Set Suite Variable ${VERSION_DIR} master
83 Set Suite Variable ${SFC_JSON_TEST_FILES_DIR} ${CURDIR}/../../../variables/sfc/${VERSION_DIR}
84 Set Suite Variable ${SERVICE_FUNCTION_PATHS_FILE} ${SFC_JSON_TEST_FILES_DIR}/service-function-paths.json
85 Set Suite Variable ${SERVICE_FUNCTION_PATH400_URI} ${SERVICE_FUNCTION_PATHS_URI}/SFC1-400
86 Set Suite Variable ${SERVICE_FUNCTION_PATH400_FILE} ${SFC_JSON_TEST_FILES_DIR}/sfp_sfc1_path400.json
87 Set Suite Variable ${SERVICE_FUNCTION_PATHS_WITH_HOP_FILE} ${SFC_JSON_TEST_FILES_DIR}/service-function-paths-with-one-hop.json
88 Set Suite Variable ${SERVICE_FUNCTION_PATHS_WITH_THREE_HOPS_FILE} ${SFC_JSON_TEST_FILES_DIR}/service-function-paths-with-three-hops-firewall-napt44-dpi.json
89 Set Suite Variable ${SERVICE_FUNCTIONS_FILE} ${SFC_JSON_TEST_FILES_DIR}/service-functions.json
90 Set Suite Variable ${SERVICE_CHAINS_FILE} ${SFC_JSON_TEST_FILES_DIR}/service-function-chains.json
91 Set Suite Variable ${SERVICE_CHAINS_FILE_FW_NAPT44_DPI} ${SFC_JSON_TEST_FILES_DIR}/service-function-chain-firewall-napt44-dpi.json
94 [Documentation] Deletes all the elements which might have been created during SFP validation tests
95 Utils.Remove All Elements If Exist ${SERVICE_FUNCTIONS_URI}
96 Utils.Remove All Elements If Exist ${SERVICE_CHAINS_URI}
97 Utils.Remove All Elements If Exist ${SERVICE_FUNCTION_PATHS_URI}