3 Resource ./sdnc-properties.robot
6 Library RequestsLibrary
7 Library OperatingSystem
12 Create SDNC RESTCONF Session
13 [Documentation] Create session to OpenDaylight controller
14 ${auth}= Create List ${ODL_USER} ${ODL_PASSWORD}
15 Create Session sdnc_restconf ${SDNC_RESTCONF_URL} auth=${auth}
17 Send Post Request And Validate Response
18 [Documentation] Send POST request to passed URL and validate received response
19 [Arguments] ${path} ${body} ${resp_code}
20 Create SDNC RESTCONF Session
21 &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json
22 ${resp}= POST On Session sdnc_restconf ${path} headers=${headers} json=${body} expected_status=${resp_code}
24 Send Empty Post Request And Validate Response
25 [Documentation] Send POST request to passed URL and validate received response
26 [Arguments] ${path} ${resp_code}
27 Create SDNC RESTCONF Session
28 &{headers}= Create Dictionary Content-Type=application/json Content-Length=0 Accept=application/json
29 ${resp}= POST On Session sdnc_restconf ${path} headers=${headers} expected_status=${resp_code}
31 Send Get Request And Validate Response Sdnc
32 [Documentation] Send request to passed url and validate received response
33 [Arguments] ${path} ${resp_code}
34 CREATE SDNC RESTCONF Session
35 &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
36 ${resp}= GET On Session sdnc_restconf ${path} headers=${headers} expected_status=${resp_code}
38 Send Get Request And Validate TLS Connection Response
39 [Documentation] Send request to passed url and validate received response
40 [Arguments] ${path} ${resp_code}
41 Create SDNC RESTCONF Session
42 ${mount}= Get File ${REQUEST_DATA_PATH}${/}mount.xml
43 &{headers}= Create Dictionary Content-Type=application/xml Accept=application/xml
44 ${resp}= PUT On Session sdnc_restconf ${path} data=${mount} headers=${headers} expected_status=201
46 &{headers1}= Create Dictionary Content-Type=application/json Accept=application/json
47 ${resp1}= GET On Session sdnc_restconf ${PNFSIM_MOUNT_PATH} headers=${headers1} expected_status=${resp_code}
50 Send Delete Request And Validate PNF Mount Deleted
51 [Documentation] Send request to passed url and validate received response
52 [Arguments] ${path} ${resp_code}
53 Create SDNC RESTCONF Session
54 ${mount}= Get File ${REQUEST_DATA_PATH}${/}mount.xml
55 &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
56 ${deleteresponse}= DELETE On Session sdnc_restconf ${path} data=${mount} headers=${headers} expected_status=${resp_code}
58 ${del_topology}= DELETE On Session sdnc_restconf ${SDNC_NETWORK_TOPOLOGY} expected_status=${resp_code}
59 ${del_keystore}= DELETE On Session sdnc_restconf ${SDNC_KEYSTORE_CONFIG_PATH}