Migrate Get Requests invocations(libraries)
[integration/test.git] / csit / suites / openflowplugin / MD_SAL_NSF_OF10 / 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 ${BODY2}
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.20.1/32</ipv4-destination></match><id>152</id><table_id>0</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><output-action><output-node-connector>openflow:1:1</output-node-connector></output-action></action></apply-actions></instruction></instructions></flow>
18
19
20 *** Test Cases ***
21 Add a flow - Output to physical port#
22     [Documentation]    Push a flow through REST-API
23     ${resp}    RequestsLibrary.PUT On Session
24     ...    session
25     ...    url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=152
26     ...    headers=${HEADERS_XML}
27     ...    data=${BODY2}
28
29 Verify after adding flow config - Output to physical port#
30     [Documentation]    Verify the flow
31     ${resp}    RequestsLibrary.GET On Session
32     ...    session
33     ...    url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0?content=config
34     ...    expected_status=200
35     Should Contain    ${resp.text}    152
36
37 Verify after adding flow operational - Output to physical port#
38     [Documentation]    Verify the flow
39     ${elements}    Create List    10.0.20.1
40     Wait Until Keyword Succeeds
41     ...    10s
42     ...    2s
43     ...    Check For Elements At URI
44     ...    ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=152?content=nonconfig
45     ...    ${elements}
46
47 Remove a flow - Output to physical port#
48     [Documentation]    Remove a flow
49     ${resp}    RequestsLibrary.DELETE On Session
50     ...    session
51     ...    url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=152
52     ...    expected_status=204
53
54 Verify after deleting flow config - Output to physical port#
55     [Documentation]    Verify the flow
56     ${resp}    RequestsLibrary.GET On Session
57     ...    session
58     ...    url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0?content=config
59     ...    expected_status=200
60     Should Not Contain    ${resp.text}    152
61     #    Standing bug #368 - This has been fixed
62
63 Verify after deleting flow operational - Output to physical port#
64     [Documentation]    Verify the flow
65     ${elements}    Create List    10.0.20.1
66     Wait Until Keyword Succeeds
67     ...    10s
68     ...    2s
69     ...    Check For Elements Not At URI
70     ...    ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0?content=nonconfig
71     ...    ${elements}