Fix python3 issues in OFP
[integration/test.git] / csit / suites / openflowplugin / MD_SAL_NSF_OF10 / 040_restconf_frm.robot
1 *** Settings ***
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
5 Library           Collections
6 Library           RequestsLibrary
7 Library           ../../../libraries/Common.py
8 Variables         ../../../variables/Variables.py
9 Resource          ../../../libraries/Utils.robot
10
11 *** Variables ***
12 ${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>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>
13
14 *** Test Cases ***
15 Add a flow - Output to physical port#
16     [Documentation]    Push a flow through REST-API
17     ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_NODES_API}/node/openflow:1/table/0/flow/152    headers=${HEADERS_XML}    data=${BODY2}
18     BuiltIn.Should_Match    "${resp.status_code}"    "20?"
19
20 Verify after adding flow config - Output to physical port#
21     [Documentation]    Verify the flow
22     ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}/node/openflow:1/table/0
23     Should Be Equal As Strings    ${resp.status_code}    200
24     Should Contain    ${resp.text}    152
25
26 Verify after adding flow operational - Output to physical port#
27     [Documentation]    Verify the flow
28     ${elements}=    Create List    10.0.20.1
29     Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/flow/152    ${elements}
30
31 Remove a flow - Output to physical port#
32     [Documentation]    Remove a flow
33     ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}/node/openflow:1/table/0/flow/152
34     Should Be Equal As Strings    ${resp.status_code}    200
35
36 Verify after deleting flow config - Output to physical port#
37     [Documentation]    Verify the flow
38     ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}/node/openflow:1/table/0
39     Should Be Equal As Strings    ${resp.status_code}    200
40     Should Not Contain    ${resp.text}    152
41     #    Standing bug #368 - This has been fixed
42
43 Verify after deleting flow operational - Output to physical port#
44     [Documentation]    Verify the flow
45     ${elements}=    Create List    10.0.20.1
46     Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/table/0    ${elements}