Correctly space expected_status
[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 Request
24     ...    session
25     ...    ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=152
26     ...    headers=${HEADERS_XML}
27     ...    data=${BODY2}
28     BuiltIn.Should_Match    "${resp.status_code}"    "20?"
29
30 Verify after adding flow config - Output to physical port#
31     [Documentation]    Verify the flow
32     ${resp}    RequestsLibrary.Get Request
33     ...    session
34     ...    ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0?content=config
35     Should Be Equal As Strings    ${resp.status_code}    200
36     Should Contain    ${resp.text}    152
37
38 Verify after adding flow operational - Output to physical port#
39     [Documentation]    Verify the flow
40     ${elements}    Create List    10.0.20.1
41     Wait Until Keyword Succeeds
42     ...    10s
43     ...    2s
44     ...    Check For Elements At URI
45     ...    ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=152?content=nonconfig
46     ...    ${elements}
47
48 Remove a flow - Output to physical port#
49     [Documentation]    Remove a flow
50     ${resp}    RequestsLibrary.Delete Request
51     ...    session
52     ...    ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=152
53     Should Be Equal As Strings    ${resp.status_code}    204
54
55 Verify after deleting flow config - Output to physical port#
56     [Documentation]    Verify the flow
57     ${resp}    RequestsLibrary.Get Request
58     ...    session
59     ...    ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0?content=config
60     Should Be Equal As Strings    ${resp.status_code}    200
61     Should Not Contain    ${resp.text}    152
62     #    Standing bug #368 - This has been fixed
63
64 Verify after deleting flow operational - Output to physical port#
65     [Documentation]    Verify the flow
66     ${elements}    Create List    10.0.20.1
67     Wait Until Keyword Succeeds
68     ...    10s
69     ...    2s
70     ...    Check For Elements Not At URI
71     ...    ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0?content=nonconfig
72     ...    ${elements}