Migrate Get Requests invocations(libraries)
[integration/test.git] / csit / suites / openflowplugin / MD_SAL_NSF_OF13 / 040_restconf_frm.robot
1 *** Settings ***
2 Documentation       Test suite for RESTCONF FRM
3
4 Library             Collections
5 Library             RequestsLibrary
6 Library             ../../../libraries/Common.py
7 Variables           ../../../variables/Variables.py
8 Resource            ../../../libraries/Utils.robot
9 Resource            ../../../variables/openflowplugin/Variables.robot
10
11 Suite Setup         Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
12 Suite Teardown      Delete All Sessions
13
14
15 *** Variables ***
16 ${BODY1}
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>
18 ${BODY2}
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>
20
21
22 *** Test Cases ***
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
26     ...    session
27     ...    url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
28     ...    headers=${HEADERS_XML}
29     ...    data=${BODY1}
30
31 Verify after adding flow config - Sending IPv4 Dest Address and Eth type
32     [Documentation]    Verify the flow
33     ${resp}    RequestsLibrary.GET On Session
34     ...    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
38
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
43     ...    10s
44     ...    2s
45     ...    Check For Elements At URI
46     ...    ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139?content=nonconfig
47     ...    ${elements}
48
49 Modify a flow - Output to physical port#
50     [Documentation]    Push a flow through REST-API
51     ${resp}    RequestsLibrary.PUT On Session
52     ...    session
53     ...    url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
54     ...    headers=${HEADERS_XML}
55     ...    data=${BODY2}
56     ...    expected_status=204
57
58 Verify after modifying flow config - Output to physical port#
59     [Documentation]    Verify the flow
60     ${resp}    RequestsLibrary.GET On Session
61     ...    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
65
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
70     ...    10s
71     ...    2s
72     ...    Check For Elements At URI
73     ...    ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139?content=nonconfig
74     ...    ${elements}
75
76 Remove a flow - Output to physical port#
77     [Documentation]    Remove a flow
78     ${resp}    RequestsLibrary.DELETE On Session
79     ...    session
80     ...    url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
81     ...    expected_status=204
82
83 Verify after deleting flow config - Output to physical port#
84     [Documentation]    Verify the flow
85     ${resp}    RequestsLibrary.GET On Session
86     ...    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
90
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
95     ...    10s
96     ...    2s
97     ...    Check For Elements Not At URI
98     ...    ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=nonconfig
99     ...    ${elements}