2 Documentation Test suite for OpenFlow group
3 Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
4 Suite Teardown Delete All Sessions
7 Library OperatingSystem
8 Library ../../../libraries/RequestsLibrary.py
9 Library ../../../libraries/Common.py
10 Variables ../../../variables/Variables.py
11 Resource ../../../libraries/Utils.txt
14 ${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes/
15 ${REST_CONTEXT_CF} /restconf/config/opendaylight-inventory:nodes/node/openflow:1
16 ${REST_CONTEXT_OP} /restconf/operational/opendaylight-inventory:nodes/node/openflow:1
17 ${GROUP} ${CURDIR}/../../../variables/xmls/g4.xml
18 ${FLOW} ${CURDIR}/../../../variables/xmls/f50.xml
24 [Documentation] Get the inventory to make sure openflow:1 comes up
25 ${resp} RequestsLibrary.Get session ${REST_CONTEXT}
27 Should Be Equal As Strings ${resp.status_code} 200
28 Should Contain ${resp.content} openflow:1
31 [Documentation] Add a group using RESTCONF
33 ${body} OperatingSystem.Get File ${GROUP}
34 Set Suite Variable ${body}
35 ${resp} Putxml session ${REST_CONTEXT_CF}/group/1 data=${body}
37 Should Be Equal As Strings ${resp.status_code} 200
39 Verify after adding group config
40 [Documentation] Get the group stat in config
41 ${resp} RequestsLibrary.Get session ${REST_CONTEXT_CF}/group/1
43 Should Be Equal As Strings ${resp.status_code} 200
44 Should Contain ${resp.content} ${GROUP_NAME}
46 Verify after adding group operational
47 [Documentation] Get the group stat in operational
48 ${elements}= Create List group-statistics group-desc
49 Wait Until Keyword Succeeds 60s 2s Check For Elements At URI ${REST_CONTEXT_OP}/group/1 ${elements}
51 Add a flow that includes a group
52 [Documentation] Push a flow through RESTCONF
54 ${body} OperatingSystem.Get File ${FLOW}
55 Set Suite Variable ${body}
56 ${resp} Putxml session ${REST_CONTEXT_CF}/table/0/flow/1 data=${body}
58 Should Be Equal As Strings ${resp.status_code} 200
60 Verify after adding flow config
61 [Documentation] Verify the flow
63 ${resp} RequestsLibrary.Get session ${REST_CONTEXT_CF}/table/0/flow/1
65 Should Be Equal As Strings ${resp.status_code} 200
66 Should Contain ${resp.content} ${FLOW_NAME}
68 Verify after adding flow operational
69 [Documentation] Verify the flow
70 ${elements}= Create List group-action group-id
71 Wait Until Keyword Succeeds 60s 2s Check For Elements At URI ${REST_CONTEXT_OP}/table/0/flow/1 ${elements}
74 [Documentation] Remove the flow
75 ${resp} RequestsLibrary.Delete session ${REST_CONTEXT_CF}/table/0/flow/1
76 Should Be Equal As Strings ${resp.status_code} 200
78 Verify after deleting flow
79 [Documentation] Verify the flow removal
81 ${resp} RequestsLibrary.Get session ${REST_CONTEXT_CF}/table/0/flow/1
82 Should Not Contain ${resp.content} ${FLOW_NAME}
85 [Documentation] Remove the group
87 ${resp} RequestsLibrary.Delete session ${REST_CONTEXT_CF}/group/1
89 Should Be Equal As Strings ${resp.status_code} 200
91 Verify after deleting group
92 [Documentation] Verify the flow removal
94 ${resp} RequestsLibrary.Get session ${REST_CONTEXT_CF}/group/1
95 Should Not Contain ${resp.content} ${GROUP_NAME}