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