2 Documentation Test suite for RESTCONF FRM
3 Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} 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
9 Resource ../../../libraries/Utils.txt
12 ${REST_CON} /restconf/config/opendaylight-inventory:nodes
13 ${REST_OPR} /restconf/operational/opendaylight-inventory:nodes
14 ${BODY1} <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.10.1/32</ipv4-destination></match><id>139</id><table_id>2</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><dec-nw-ttl/></action></apply-actions></instruction></instructions></flow>
15 ${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>139</id><table_id>2</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><output-action><output-node-connector>1</output-node-connector><max-length>60</max-length></output-action></action></apply-actions></instruction></instructions></flow>
18 Add a flow - Sending IPv4 Dest Address and Eth type
19 [Documentation] Push a flow through REST-API
20 ${resp} Putxml session ${REST_CON}/node/openflow:1/table/2/flow/139 data=${BODY1}
21 Should Be Equal As Strings ${resp.status_code} 200
23 Verify after adding flow config - Sending IPv4 Dest Address and Eth type
24 [Documentation] Verify the flow
25 ${resp} RequestsLibrary.Get session ${REST_CON}/node/openflow:1/table/2
26 Should Be Equal As Strings ${resp.status_code} 200
27 Should Contain ${resp.content} 139
29 Verify after adding flow operational - Sending IPv4 Dest Address and Eth type
30 [Documentation] Verify the flow
31 ${elements}= Create List 10.0.10.1
32 Wait Until Keyword Succeeds 60s 2s Check For Elements At URI ${REST_OPR}/node/openflow:1/table/2 ${elements}
34 Modify a flow - Output to physical port#
35 [Documentation] Push a flow through REST-API
36 ${resp} Putxml session ${REST_CON}/node/openflow:1/table/2/flow/139 data=${BODY2}
37 Should Be Equal As Strings ${resp.status_code} 200
39 Verify after modifying flow config - Output to physical port#
40 [Documentation] Verify the flow
41 ${resp} RequestsLibrary.Get session ${REST_CON}/node/openflow:1/table/2
42 Should Be Equal As Strings ${resp.status_code} 200
43 Should Contain ${resp.content} 10.0.20.1
45 Verify after modifying flow operational - Output to physical port#
46 [Documentation] Verify the flow
47 ${elements}= Create List 10.0.20.1
48 Wait Until Keyword Succeeds 90s 2s Check For Elements At URI ${REST_OPR}/node/openflow:1/table/2/flow/139 ${elements}
50 Remove a flow - Output to physical port#
51 [Documentation] Remove a flow
52 ${resp} RequestsLibrary.Delete session ${REST_CON}/node/openflow:1/table/2/flow/139
53 Should Be Equal As Strings ${resp.status_code} 200
55 Verify after deleting flow config - Output to physical port#
56 [Documentation] Verify the flow
57 ${resp} RequestsLibrary.Get session ${REST_CON}/node/openflow:1/table/2
58 Should Be Equal As Strings ${resp.status_code} 200
59 Should Not Contain ${resp.content} 139
61 Verify after deleting flow operational - Output to physical port#
62 [Documentation] Verify the flow
63 ${elements}= Create List 10.0.20.1
64 Wait Until Keyword Succeeds 60s 2s Check For Elements Not At URI ${REST_OPR}/node/openflow:1/table/2 ${elements}