2 Documentation Test suite for RESTCONF FRM
3 Suite Setup Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
4 Suite Teardown Delete All Sessions
6 Library RequestsLibrary
7 Library ../../../libraries/Common.py
8 Variables ../../../variables/Variables.py
9 Resource ../../../libraries/Utils.robot
10 Resource ../../../variables/openflowplugin/Variables.robot
13 ${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>
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>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>
17 Add a flow - Sending IPv4 Dest Address and Eth type
18 [Documentation] Push a flow through REST-API
19 ${resp} RequestsLibrary.Put Request session ${RFC8040_NODES_API}/node=openflow%3A1/table=2/flow=139 headers=${HEADERS_XML} data=${BODY1}
20 BuiltIn.Should_Match "${resp.status_code}" "20?"
22 Verify after adding flow config - Sending IPv4 Dest Address and Eth type
23 [Documentation] Verify the flow
24 ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A1/table=2?content=config
25 Should Be Equal As Strings ${resp.status_code} 200
26 Should Contain ${resp.text} 139
28 Verify after adding flow operational - Sending IPv4 Dest Address and Eth type
29 [Documentation] Verify the flow
30 ${elements}= Create List 10.0.10.1
31 Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1/table=2/flow=139?content=nonconfig ${elements}
33 Modify a flow - Output to physical port#
34 [Documentation] Push a flow through REST-API
35 ${resp} RequestsLibrary.Put Request session ${RFC8040_NODES_API}/node=openflow%3A1/table=2/flow=139 headers=${HEADERS_XML} data=${BODY2}
36 Should Be Equal As Strings ${resp.status_code} 204
38 Verify after modifying flow config - Output to physical port#
39 [Documentation] Verify the flow
40 ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A1/table=2?content=config
41 Should Be Equal As Strings ${resp.status_code} 200
42 Should Contain ${resp.text} 10.0.20.1
44 Verify after modifying flow operational - Output to physical port#
45 [Documentation] Verify the flow
46 ${elements}= Create List 10.0.20.1
47 Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1/table=2/flow=139?content=nonconfig ${elements}
49 Remove a flow - Output to physical port#
50 [Documentation] Remove a flow
51 ${resp} RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=openflow%3A1/table=2/flow=139
52 Should Be Equal As Strings ${resp.status_code} 204
54 Verify after deleting flow config - Output to physical port#
55 [Documentation] Verify the flow
56 ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A1/table=2?content=config
57 Should Be Equal As Strings ${resp.status_code} 200
58 Should Not Contain ${resp.text} 139
60 Verify after deleting flow operational - Output to physical port#
61 [Documentation] Verify the flow
62 ${elements}= Create List 10.0.20.1
63 Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${RFC8040_NODES_API}/node=openflow%3A1/table=2?content=nonconfig ${elements}