2 Documentation Test suite for setting up infrastructure for demo-symmetric-chain
3 Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
4 Suite Teardown Delete All Sessions
5 Library RequestsLibrary
6 Library OperatingSystem
7 Variables ../../../../../variables/Variables.py
8 Resource ../../../../../libraries/Utils.robot
9 Resource ../Variables.robot
12 ${GBP_TENANT_ID} f5c7d344-d1c7-4208-8531-2c2693657e12
13 ${TENANT_PATH} /restconf/config/policy:tenants/tenant/${GBP_TENANT_ID}
14 ${TENANT_FILE} ${CURDIR}/../../../../../variables/gbp/demo-symmetric-chain/tenants.json
16 ${TUNNELS_PATH} /restconf/config/opendaylight-inventory:nodes
17 ${TUNNELS_FILE} ${CURDIR}/../../../../../variables/gbp/demo-symmetric-chain/tunnels.json
19 ${ENDPOINTS_PATH} /restconf/operations/endpoint:register-endpoint
21 ${SF_PATH} /restconf/config/service-function:service-functions
22 ${SF_FILE} ${CURDIR}/../../../../../variables/gbp/demo-symmetric-chain/service_functions.json
24 ${SFF_PATH} /restconf/config/service-function-forwarder:service-function-forwarders
25 ${SFF_FILE} ${CURDIR}/../../../../../variables/gbp/demo-symmetric-chain/service_function_forwarders.json
27 ${SFC_PATH} /restconf/config/service-function-chain:service-function-chains
28 ${SFC_FILE} ${CURDIR}/../../../../../variables/gbp/demo-symmetric-chain/service_function_chains.json
30 ${SFP_PATH} /restconf/config/service-function-path:service-function-paths
31 ${SFP_FILE} ${CURDIR}/../../../../../variables/gbp/demo-symmetric-chain/service_function_paths.json
33 ${h35_2_FILE} ${CURDIR}/../../../../../variables/gbp/demo-symmetric-chain/vethl-h35_2.json
34 ${h35_3_FILE} ${CURDIR}/../../../../../variables/gbp/demo-symmetric-chain/vethl-h35_3.json
35 ${h35_4_FILE} ${CURDIR}/../../../../../variables/gbp/demo-symmetric-chain/vethl-h35_4.json
36 ${h35_5_FILE} ${CURDIR}/../../../../../variables/gbp/demo-symmetric-chain/vethl-h35_5.json
37 ${h36_2_FILE} ${CURDIR}/../../../../../variables/gbp/demo-symmetric-chain/vethl-h36_2.json
38 ${h36_3_FILE} ${CURDIR}/../../../../../variables/gbp/demo-symmetric-chain/vethl-h36_3.json
39 ${h36_4_FILE} ${CURDIR}/../../../../../variables/gbp/demo-symmetric-chain/vethl-h36_4.json
40 ${h36_5_FILE} ${CURDIR}/../../../../../variables/gbp/demo-symmetric-chain/vethl-h36_5.json
42 @{ENDPOINT_FILES} ${h35_2_FILE} ${h35_3_FILE} ${h35_4_FILE} ${h35_5_FILE} ${h36_2_FILE}
43 ... ${h36_3_FILE} ${h36_4_FILE} ${h36_5_FILE}
47 [Documentation] Register Service Functions to ODL
48 ${json_to_edit} OperatingSystem.Get File ${SF_FILE}
49 ${edited_json} Replace String ${json_to_edit} _SF1 ${GBPSFC3}
50 ${edited_json} Replace String ${edited_json} _SF2 ${GBPSFC5}
51 ${resp} RequestsLibrary.Put session ${SF_PATH} ${edited_json} ${HEADERS}
52 Should Be Equal As Strings ${resp.status_code} 200
54 Put Service Function Forwarders
55 [Documentation] Register Service Function Forwarders to ODL
56 ${json_to_edit} OperatingSystem.Get File ${SFF_FILE}
57 ${edited_json} Replace String ${json_to_edit} _SFF1 ${GBPSFC2}
58 ${edited_json} Replace String ${edited_json} _SFF2 ${GBPSFC4}
59 ${resp} RequestsLibrary.Put session ${SFF_PATH} ${edited_json} ${HEADERS}
60 Should Be Equal As Strings ${resp.status_code} 200
62 Put Service Function Chains
63 [Documentation] Register Service Function Chains to ODL
64 Add Elements To URI From File ${SFC_PATH} ${SFC_FILE}
66 Put Service Function Paths
67 [Documentation] Register Service Function Paths to ODL
68 Add Elements To URI From File ${SFP_PATH} ${SFP_FILE}
71 [Documentation] Send tunnel augmentation to ODL
72 ${json_to_edit} OperatingSystem.Get File ${TUNNELS_FILE}
73 ${edited_json} Replace String ${json_to_edit} _CLASSIFIER1 ${GBPSFC1}
74 ${edited_json} Replace String ${edited_json} _CLASSIFIER2 ${GBPSFC6}
75 ${resp} RequestsLibrary.Put session ${TUNNELS_PATH} ${edited_json} ${HEADERS}
76 Should Be Equal As Strings ${resp.status_code} 200
79 [Documentation] Send Tenant Data to ODL
80 Add Elements To URI From File ${TENANT_PATH} ${TENANT_FILE}
83 [Documentation] Endpoints registration
84 :FOR ${endpoint_file} IN @{ENDPOINT_FILES}
85 \ Post Elements To URI From File ${ENDPOINTS_PATH} ${endpoint_file}