2 Documentation Test suite for SFC Persistency. Checks that system persistency is working as expected
4 Suite Teardown Delete All Sessions
7 Library OperatingSystem
8 Library RequestsLibrary
9 Library HttpLibrary.HTTP
10 Library ../../../libraries/SFC/SfcUtils.py
11 Resource ../../../libraries/SFC/SfcKeywords.robot
12 Resource ../../../libraries/ClusterOpenFlow.robot
13 Resource ../../../libraries/CompareStream.robot
14 Resource ../../../libraries/KarafKeywords.robot
15 Resource ../../../variables/sfc/Variables.robot
16 Resource ../../../libraries/Utils.robot
17 Resource ../../../libraries/TemplatedRequests.robot
18 Resource ../../../libraries/SFC/DockerSfc.robot
21 ${JSON_DIR} ${CURDIR}/../../../variables/sfc/master
22 ${SERVICE_FUNCTIONS_FILE} ${JSON_DIR}/service-functions.json
23 ${SERVICE_FORWARDERS_FILE} ${JSON_DIR}/service-function-forwarders.json
24 ${SERVICE_NODES_FILE} ${JSON_DIR}/service-nodes.json
25 ${SERVICE_CHAINS_FILE} ${JSON_DIR}/service-function-chains.json
26 ${SERVICE_FUNCTION_PATHS_FILE} ${JSON_DIR}/service-function-paths.json
27 ${CREATE_RSP1_INPUT} {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-Path-1"}}
28 @{SF_NAMES} napt44-103-2 napt44-103-1 dpi-102-2 firewall-101-2 napt44-104 dpi-102-1 firewall-104
29 ... dpi-102-3 firewall-101-1
32 Add SFC Elements and restart cluster
33 [Documentation] Add SFC Elements, restart the cluster and check that persisted resources are present
35 ${session} = Resolve Http Session for Controller
36 Kill_Members_From_List_Or_All
37 Start_Members_From_List_Or_All wait_for_sync=True
38 Wait until Keyword succeeds 2min 5 sec Get Data From URI session ${SERVICE_FORWARDERS_URI}
39 Wait until Keyword succeeds 2min 5 sec Get Data From URI session ${SERVICE_NODES_URI}
40 Wait until Keyword succeeds 2min 5 sec Get Data From URI session ${SERVICE_FUNCTIONS_URI}
41 Wait Until Keyword Succeeds 2min 5 sec Check Service Function Types Added ${SF_NAMES}
42 Wait until Keyword succeeds 2min 5 sec Get Data From URI session ${SERVICE_CHAINS_URI}
43 Wait until Keyword succeeds 2min 5 sec Get Data From URI session ${SERVICE_FUNCTION_PATHS_URI}
44 Wait until Keyword succeeds 2min 5 sec TemplatedRequests.Get_As_Json_Templated session=${session} folder=${RESTCONF_MODULES_DIR} verify=False
45 # From oxygen, RSPs are persisted between reboots
46 Run_Keyword_If_At_Least_Else oxygen Wait until Keyword succeeds 2min 5 sec Get Data From URI session
47 ... ${OPERATIONAL_RSPS_URI}
48 ... ELSE No Content From URI session ${OPERATIONAL_RSPS_URI}
49 [Teardown] Remove SFC Elements
53 [Documentation] Connect Create session and initialize ODL version specific variables
54 ClusterManagement Setup
55 Create Session session http://${ODL_SYSTEM_1_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
58 [Documentation] Add Elements to the Controller via API REST
59 Add Elements To URI From File ${SERVICE_FORWARDERS_URI} ${SERVICE_FORWARDERS_FILE}
60 Add Elements To URI From File ${SERVICE_NODES_URI} ${SERVICE_NODES_FILE}
61 Add Elements To URI From File ${SERVICE_FUNCTIONS_URI} ${SERVICE_FUNCTIONS_FILE}
62 Wait Until Keyword Succeeds 60s 2s Check Service Function Types Added ${SF_NAMES}
63 Add Elements To URI From File ${SERVICE_CHAINS_URI} ${SERVICE_CHAINS_FILE}
64 Add Elements To URI From File ${SERVICE_FUNCTION_PATHS_URI} ${SERVICE_FUNCTION_PATHS_FILE}
65 Wait until Keyword succeeds 60s 2s Get Data From URI session ${OPERATIONAL_RSPS_URI}
68 [Documentation] Remove Elements from the Controller via API REST
69 Remove All Elements At URI ${SERVICE_FUNCTIONS_URI}
70 Remove All Elements At URI ${SERVICE_FORWARDERS_URI}
71 Remove All Elements At URI ${SERVICE_NODES_URI}
72 Remove All Elements At URI ${SERVICE_CHAINS_URI}
73 Remove All Elements At URI ${SERVICE_FUNCTION_PATHS_URI}
75 Resolve Http Session for Controller
76 ${session} = Resolve_Http_Session_For_Member member_index=1