2 Documentation Test suite for RESTCONF FRM
5 Library RequestsLibrary
6 Library ../../../libraries/Common.py
7 Variables ../../../variables/Variables.py
8 Resource ../../../libraries/Utils.robot
9 Resource ../../../variables/openflowplugin/Variables.robot
11 Suite Setup Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
12 Suite Teardown Delete All Sessions
17 ... <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>
19 ... <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>
23 Add a flow - Sending IPv4 Dest Address and Eth type
24 [Documentation] Push a flow through REST-API
25 ${resp} RequestsLibrary.PUT On Session
27 ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
28 ... headers=${HEADERS_XML}
31 Verify after adding flow config - Sending IPv4 Dest Address and Eth type
32 [Documentation] Verify the flow
33 ${resp} RequestsLibrary.GET On Session
35 ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config
36 ... expected_status=200
37 Should Contain ${resp.text} 139
39 Verify after adding flow operational - Sending IPv4 Dest Address and Eth type
40 [Documentation] Verify the flow
41 ${elements} Create List 10.0.10.1
42 Wait Until Keyword Succeeds
45 ... Check For Elements At URI
46 ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139?content=nonconfig
49 Modify a flow - Output to physical port#
50 [Documentation] Push a flow through REST-API
51 ${resp} RequestsLibrary.PUT On Session
53 ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
54 ... headers=${HEADERS_XML}
56 ... expected_status=204
58 Verify after modifying flow config - Output to physical port#
59 [Documentation] Verify the flow
60 ${resp} RequestsLibrary.GET On Session
62 ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config
63 ... expected_status=200
64 Should Contain ${resp.text} 10.0.20.1
66 Verify after modifying flow operational - Output to physical port#
67 [Documentation] Verify the flow
68 ${elements} Create List 10.0.20.1
69 Wait Until Keyword Succeeds
72 ... Check For Elements At URI
73 ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139?content=nonconfig
76 Remove a flow - Output to physical port#
77 [Documentation] Remove a flow
78 ${resp} RequestsLibrary.DELETE On Session
80 ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
81 ... expected_status=204
83 Verify after deleting flow config - Output to physical port#
84 [Documentation] Verify the flow
85 ${resp} RequestsLibrary.GET On Session
87 ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config
88 ... expected_status=200
89 Should Not Contain ${resp.text} 139
91 Verify after deleting flow operational - Output to physical port#
92 [Documentation] Verify the flow
93 ${elements} Create List 10.0.20.1
94 Wait Until Keyword Succeeds
97 ... Check For Elements Not At URI
98 ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=nonconfig