2 Documentation Test suite for OpenFlow group
3 Suite Setup Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
4 Suite Teardown Delete All Sessions
7 Library OperatingSystem
8 Library RequestsLibrary
9 Library ../../../libraries/Common.py
10 Variables ../../../variables/Variables.py
11 Resource ../../../libraries/Utils.robot
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 ${node_list}= Create List openflow:1
26 Wait Until Keyword Succeeds 40s 1s Check For Elements At URI ${REST_CONTEXT_OP} ${node_list}
29 [Documentation] Add a group using RESTCONF
31 ${body} OperatingSystem.Get File ${GROUP}
32 Set Suite Variable ${body}
33 ${resp} RequestsLibrary.Put Request session ${REST_CONTEXT_CF}/group/1 headers=${HEADERS_XML} data=${body}
35 Should Be Equal As Strings ${resp.status_code} 200
37 Verify after adding group config
38 [Documentation] Get the group stat in config
39 ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT_CF}/group/1
41 Should Be Equal As Strings ${resp.status_code} 200
42 Should Contain ${resp.content} ${GROUP_NAME}
44 Verify after adding group operational
45 [Documentation] Get the group stat in operational
46 ${elements}= Create List group-statistics ref-count packet-count byte-count buckets
47 ... weight group-select
48 Wait Until Keyword Succeeds 6s 2s Check For Elements At URI ${REST_CONTEXT_OP}/group/1 ${elements}
50 Add a flow that includes a group
51 [Documentation] Push a flow through RESTCONF
53 ${body} OperatingSystem.Get File ${FLOW}
54 Set Suite Variable ${body}
55 ${resp} RequestsLibrary.Put Request session ${REST_CONTEXT_CF}/table/0/flow/1 headers=${HEADERS_XML} data=${body}
57 Should Be Equal As Strings ${resp.status_code} 200
59 Verify after adding flow config
60 [Documentation] Verify the flow
62 ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT_CF}/table/0/flow/1
64 Should Be Equal As Strings ${resp.status_code} 200
65 Should Contain ${resp.content} ${FLOW_NAME}
67 Verify after adding flow operational
68 [Documentation] Verify the flow
69 ${elements}= Create List group-action group-id
70 Wait Until Keyword Succeeds 6s 2s Check For Elements At URI ${REST_CONTEXT_OP}/table/0/flow/1 ${elements}
73 [Documentation] Remove the flow
74 ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT_CF}/table/0/flow/1
75 Should Be Equal As Strings ${resp.status_code} 200
77 Verify after deleting flow
78 [Documentation] Verify the flow removal
80 ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT_CF}/table/0/flow/1
81 Should Not Contain ${resp.content} ${FLOW_NAME}
84 [Documentation] Remove the group
86 ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT_CF}/group/1
88 Should Be Equal As Strings ${resp.status_code} 200
90 Verify after deleting group
91 [Documentation] Verify the flow removal
93 ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT_CF}/group/1
94 Should Not Contain ${resp.content} ${GROUP_NAME}