Correctly space expected_status
[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 Request
26     ...    session
27     ...    ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
28     ...    headers=${HEADERS_XML}
29     ...    data=${BODY1}
30     BuiltIn.Should_Match    "${resp.status_code}"    "20?"
31
32 Verify after adding flow config - Sending IPv4 Dest Address and Eth type
33     [Documentation]    Verify the flow
34     ${resp}    RequestsLibrary.Get Request
35     ...    session
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
39
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
44     ...    10s
45     ...    2s
46     ...    Check For Elements At URI
47     ...    ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139?content=nonconfig
48     ...    ${elements}
49
50 Modify a flow - Output to physical port#
51     [Documentation]    Push a flow through REST-API
52     ${resp}    RequestsLibrary.Put Request
53     ...    session
54     ...    ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
55     ...    headers=${HEADERS_XML}
56     ...    data=${BODY2}
57     Should Be Equal As Strings    ${resp.status_code}    204
58
59 Verify after modifying flow config - Output to physical port#
60     [Documentation]    Verify the flow
61     ${resp}    RequestsLibrary.Get Request
62     ...    session
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
66
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
71     ...    10s
72     ...    2s
73     ...    Check For Elements At URI
74     ...    ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139?content=nonconfig
75     ...    ${elements}
76
77 Remove a flow - Output to physical port#
78     [Documentation]    Remove a flow
79     ${resp}    RequestsLibrary.Delete Request
80     ...    session
81     ...    ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
82     Should Be Equal As Strings    ${resp.status_code}    204
83
84 Verify after deleting flow config - Output to physical port#
85     [Documentation]    Verify the flow
86     ${resp}    RequestsLibrary.Get Request
87     ...    session
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
91
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
96     ...    10s
97     ...    2s
98     ...    Check For Elements Not At URI
99     ...    ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=nonconfig
100     ...    ${elements}