2 Documentation Test suite for pushing/verify/remove a flow through RESTCONF
3 Suite Setup Create Session session http://${CONTROLLER}:8080 auth=${AUTH} headers=${HEADERS_XML}
4 Suite Teardown Delete All Sessions
6 Library ../../libraries/RequestsLibrary.py
7 Library ../../libraries/Common.py
8 Variables ../../variables/Variables.py
12 ${REST_CON} /restconf/config/opendaylight-inventory:nodes
13 ${REST_OPR} /restconf/operational/opendaylight-inventory:nodes
14 ${BODY2} <flow xmlns="urn:opendaylight:flow:inventory"><priority>2</priority><flow-name>Foo</flow-name><match><ethernet-match><ethernet-type><type>2048</type></ethernet-type></ethernet-match><ipv4-destination>10.0.20.1/32</ipv4-destination></match><id>152</id><table_id>0</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><output-action><output-node-connector>openflow:1:1</output-node-connector></output-action></action></apply-actions></instruction></instructions></flow>
18 Add a flow - Output to physical port#
19 [Documentation] Push a flow through REST-API
21 ${resp} Putxml session ${REST_CON}/node/openflow:1/table/0/flow/152 data=${BODY2}
22 Should Be Equal As Strings ${resp.status_code} 200
24 Verify after adding flow config - Output to physical port#
25 [Documentation] Verify the flow
27 ${resp} Get session ${REST_CON}/node/openflow:1/table/0
28 Should Be Equal As Strings ${resp.status_code} 200
29 Should Contain ${resp.content} 152
31 Verify after adding flow operational - Output to physical port#
32 [Documentation] Verify the flow
35 ${resp} Get session ${REST_OPR}/node/openflow:1/table/0
36 Should Be Equal As Strings ${resp.status_code} 200
37 Should Contain ${resp.content} 10.0.20.1
39 Remove a flow - Output to physical port#
40 [Documentation] Remove a flow
42 ${resp} Delete session ${REST_CON}/node/openflow:1/table/0/flow/152
43 Should Be Equal As Strings ${resp.status_code} 200
45 Verify after deleting flow config - Output to physical port#
46 [Documentation] Verify the flow
48 ${resp} Get session ${REST_CON}/node/openflow:1/table/0
49 Should Be Equal As Strings ${resp.status_code} 200
50 Should Not Contain ${resp.content} 152
52 # Standing bug #368 - This has been fixed
53 Verify after deleting flow operational - Output to physical port#
54 [Documentation] Verify the flow
57 ${resp} Get session ${REST_OPR}/node/openflow:1/table/0
58 Should Be Equal As Strings ${resp.status_code} 200
59 Should Not Contain ${resp.content} 10.0.20.1