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 Request
27 ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
28 ... headers=${HEADERS_XML}
30 BuiltIn.Should_Match "${resp.status_code}" "20?"
32 Verify after adding flow config - Sending IPv4 Dest Address and Eth type
33 [Documentation] Verify the flow
34 ${resp} RequestsLibrary.Get Request
36 ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config
37 Should Be Equal As Strings ${resp.status_code} 200
38 Should Contain ${resp.text} 139
40 Verify after adding flow operational - Sending IPv4 Dest Address and Eth type
41 [Documentation] Verify the flow
42 ${elements} Create List 10.0.10.1
43 Wait Until Keyword Succeeds
46 ... Check For Elements At URI
47 ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139?content=nonconfig
50 Modify a flow - Output to physical port#
51 [Documentation] Push a flow through REST-API
52 ${resp} RequestsLibrary.Put Request
54 ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
55 ... headers=${HEADERS_XML}
57 Should Be Equal As Strings ${resp.status_code} 204
59 Verify after modifying flow config - Output to physical port#
60 [Documentation] Verify the flow
61 ${resp} RequestsLibrary.Get Request
63 ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config
64 Should Be Equal As Strings ${resp.status_code} 200
65 Should Contain ${resp.text} 10.0.20.1
67 Verify after modifying flow operational - Output to physical port#
68 [Documentation] Verify the flow
69 ${elements} Create List 10.0.20.1
70 Wait Until Keyword Succeeds
73 ... Check For Elements At URI
74 ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139?content=nonconfig
77 Remove a flow - Output to physical port#
78 [Documentation] Remove a flow
79 ${resp} RequestsLibrary.Delete Request
81 ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
82 Should Be Equal As Strings ${resp.status_code} 204
84 Verify after deleting flow config - Output to physical port#
85 [Documentation] Verify the flow
86 ${resp} RequestsLibrary.Get Request
88 ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config
89 Should Be Equal As Strings ${resp.status_code} 200
90 Should Not Contain ${resp.text} 139
92 Verify after deleting flow operational - Output to physical port#
93 [Documentation] Verify the flow
94 ${elements} Create List 10.0.20.1
95 Wait Until Keyword Succeeds
98 ... Check For Elements Not At URI
99 ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=nonconfig