2 Documentation Test reconciliation of chained groups and flows after switch is restart.
3 Suite Setup Initialization Phase
4 Suite Teardown Final Phase
6 Library OperatingSystem
7 Library RequestsLibrary
8 Resource ../../../libraries/MininetKeywords.robot
9 Resource ../../../libraries/FlowLib.robot
10 Resource ../../../libraries/Utils.robot
11 Variables ../../../variables/Variables.py
14 ${XmlsDir} ${CURDIR}/../../../variables/xmls
20 Add Group 1 And Verify In Config Datastore
21 [Documentation] Add a group and verify.
22 ${body}= OperatingSystem.Get File ${XmlsDir}/${groupfile1}
23 FlowLib.Add Group To Controller And Verify ${body} openflow:1 1
25 Verify After Adding Group 1 In Operational DataStore
26 [Documentation] Get the group stats in operational.
27 ${elements}= BuiltIn.Create List group-statistics ref-count packet-count byte-count buckets
28 ... weight group-select
29 BuiltIn.Wait Until Keyword Succeeds 10s 1s Utils.Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1/group/1 ${elements}
31 Add Group 2 And Verify In Config Datastore
32 [Documentation] Add a group and verify.
33 ${body}= OperatingSystem.Get File ${XmlsDir}/${groupfile2}
34 FlowLib.Add Group To Controller And Verify ${body} openflow:1 2
36 Verify After Adding Group 2 In Operational DataStore
37 [Documentation] Get the group stats in operational.
38 ${elements}= BuiltIn.Create List group-statistics ref-count packet-count byte-count buckets
39 ... watch_group watch_port group-ff
40 BuiltIn.Wait Until Keyword Succeeds 10s 1s Utils.Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1/group/2 ${elements}
42 Add Flow And Verify In Config Datastore
43 [Documentation] Add a flow pointing to the group and verify.
44 ${body} OperatingSystem.Get File ${XmlsDir}/${flowfile}
45 FlowLib.Add Flow To Controller And Verify ${body} openflow:1 0 1
47 Verify After Adding Flow In Operational DataStore
48 [Documentation] Get the flow stats in operational.
49 ${elements}= BuiltIn.Create List group-action group-id
50 BuiltIn.Wait Until Keyword Succeeds 10s 1s Utils.Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/flow/1 ${elements}
53 [Documentation] Restart Mininet and verify.
54 MininetKeywords.Stop Mininet And Exit ${mininet_conn_id}
55 ${mininet_conn_id}= MininetKeywords.Start Mininet Single Controller
56 BuiltIn.Set Suite Variable ${mininet_conn_id}
57 BuiltIn.Wait Until Keyword Succeeds 10s 1s Are Switches Connected Topo
59 Verify Group 1 In Operational DataStore
60 [Documentation] Get the group stats in operational.
61 ${elements}= BuiltIn.Create List group-statistics ref-count packet-count byte-count buckets
62 ... weight group-select
63 BuiltIn.Wait Until Keyword Succeeds 10s 1s Utils.Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1/group/1 ${elements}
65 Verify Group 2 In Operational DataStore
66 [Documentation] Get the group stats in operational.
67 ${elements}= BuiltIn.Create List group-statistics ref-count packet-count byte-count buckets
68 ... watch_group watch_port group-ff
69 BuiltIn.Wait Until Keyword Succeeds 10s 1s Utils.Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1/group/2 ${elements}
71 Verify Flow In Operational DataStore
72 [Documentation] Get the flow stats in operational.
73 ${elements}= BuiltIn.Create List group-action group-id
74 BuiltIn.Wait Until Keyword Succeeds 10s 1s Utils.Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/flow/1 ${elements}
76 Remove Flow And Verify In Config Datastore
77 [Documentation] Remove the flow and verify.
78 FlowLib.Remove Flow From Controller And Verify openflow:1 0 1
80 Verify After Removing Flow In Operational DataStore
81 [Documentation] Get the flow stats in operational.
82 BuiltIn.Wait Until Keyword Succeeds 10s 1s Utils.No Content From URI session ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/flow/1
84 Remove Group 2 And Verify In Config Datastore
85 [Documentation] Remove the group and verify.
86 FlowLib.Remove Group From Controller And Verify openflow:1 2
88 Verify After Removing Group 2 In Operational DataStore
89 [Documentation] Get the group stats in operational.
90 BuiltIn.Wait Until Keyword Succeeds 10s 1s Utils.No Content From URI session ${OPERATIONAL_NODES_API}/node/openflow:1/group/2
92 Remove Group 1 And Verify In Config Datastore
93 [Documentation] Remove the group and verify.
94 FlowLib.Remove Group From Controller And Verify openflow:1 1
96 Verify After Removing Group 1 In Operational DataStore
97 [Documentation] Get the group stats in operational.
98 BuiltIn.Wait Until Keyword Succeeds 10s 1s Utils.No Content From URI session ${OPERATIONAL_NODES_API}/node/openflow:1/group/1
102 [Documentation] Starts mininet and verify if topology is in operational datastore.
103 RequestsLibrary.Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
104 ${mininet_conn_id}= MininetKeywords.Start Mininet Single Controller
105 BuiltIn.Set Suite Variable ${mininet_conn_id}
106 BuiltIn.Wait Until Keyword Succeeds 10s 1s Are Switches Connected Topo
109 [Documentation] Stops mininet.
110 MininetKeywords.Stop Mininet And Exit ${mininet_conn_id}
111 RequestsLibrary.Delete All Sessions
113 Are Switches Connected Topo
114 [Documentation] Checks wheather switches are connected to controller
115 ${resp}= RequestsLibrary.Get Request session ${OPERATIONAL_TOPO_API}/topology/flow:1 headers=${ACCEPT_XML}
117 ${count}= XML.Get Element Count ${resp.content} xpath=node
118 Should Be Equal As Numbers ${count} 1