2 Documentation Test suite for OpenFlow group
6 Library OperatingSystem
7 Library RequestsLibrary
8 Library ../../../libraries/Common.py
9 Variables ../../../variables/Variables.py
10 Resource ../../../variables/openflowplugin/Variables.robot
11 Resource ../../../libraries/Utils.robot
13 Suite Setup Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
14 Suite Teardown Delete All Sessions
18 ${REST_CONTEXT} ${RFC8040_NODES_API}/node=openflow%3A1
19 ${GROUP} ${CURDIR}/../../../variables/xmls/g4.xml
20 ${FLOW} ${CURDIR}/../../../variables/xmls/f50.xml
27 [Documentation] Get the inventory to make sure openflow:1 comes up
28 ${node_list} Create List openflow:1
29 Wait Until Keyword Succeeds
32 ... Check For Elements At URI
33 ... ${REST_CONTEXT}?${RFC8040_OPERATIONAL_CONTENT}
37 [Documentation] Add a group using RESTCONF
39 ${body} OperatingSystem.Get File ${GROUP}
40 Set Suite Variable ${body}
41 ${resp} RequestsLibrary.PUT On Session
43 ... url=${REST_CONTEXT}/flow-node-inventory:group=1
44 ... headers=${HEADERS_XML}
48 Verify after adding group config
49 [Documentation] Get the group stat in config
50 ${resp} RequestsLibrary.GET On Session
52 ... ${REST_CONTEXT}/flow-node-inventory:group=1?${RFC8040_CONFIG_CONTENT}
53 ... expected_status=200
55 Should Contain ${resp.content} ${GROUP_NAME}
57 Verify after adding group operational
58 [Documentation] Get the group stat in operational
59 ${elements} Create List group-statistics ref-count packet-count byte-count buckets
60 ... weight group-select
61 Wait Until Keyword Succeeds
64 ... Check For Elements At URI
65 ... ${REST_CONTEXT}/flow-node-inventory:group=1?${RFC8040_OPERATIONAL_CONTENT}
68 Add a flow that includes a group
69 [Documentation] Push a flow through RESTCONF
71 ${body} OperatingSystem.Get File ${FLOW}
72 Set Suite Variable ${body}
73 ${resp} RequestsLibrary.PUT On Session
75 ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=1
76 ... headers=${HEADERS_XML}
80 Verify after adding flow config
81 [Documentation] Verify the flow
83 ${resp} RequestsLibrary.GET On Session
85 ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=1?${RFC8040_CONFIG_CONTENT}
86 ... expected_status=200
88 Should Contain ${resp.content} ${FLOW_NAME}
90 Verify after adding flow operational
91 [Documentation] Verify the flow
92 ${elements} Create List group-action group-id
93 Wait Until Keyword Succeeds
96 ... Check For Elements At URI
97 ... ${REST_CONTEXT}/flow-node-inventory:table=0/flow=1?${RFC8040_OPERATIONAL_CONTENT}
101 [Documentation] Remove the flow
102 ${resp} RequestsLibrary.DELETE On Session
104 ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=1
105 ... expected_status=200
107 Verify after deleting flow
108 [Documentation] Verify the flow removal
110 ${resp} RequestsLibrary.GET On Session
112 ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=1?${RFC8040_CONFIG_CONTENT}
113 Should Not Contain ${resp.content} ${FLOW_NAME}
116 [Documentation] Remove the group
118 ${resp} RequestsLibrary.DELETE On Session
120 ... url=${REST_CONTEXT}/flow-node-inventory:group=1
121 ... expected_status=200
124 Verify after deleting group
125 [Documentation] Verify the flow removal
127 ${resp} RequestsLibrary.GET On Session
129 ... url=${REST_CONTEXT}/flow-node-inventory:group=1?${RFC8040_CONFIG_CONTENT}
130 Should Not Contain ${resp.content} ${GROUP_NAME}