Created RESTCONF for base edition with of13 plugin
[integration/test.git] / test / csit / suites / base-of13 / 010__restconf_flows.txt
1 *** Settings ***
2 Documentation     Test suite for pushing/verify/remove a flow through RESTCONF
3 Suite Setup       Create Session   session   http://${CONTROLLER}:8080   auth=${AUTH}   headers=${HEADERS_XML}
4 Suite Teardown    Delete All Sessions
5 Library           Collections
6 Library           ../../libraries/RequestsLibrary.py
7 Library           ../../libraries/Common.py
8 Variables         ../../variables/Variables.py
9
10 *** Variables ***
11
12 ${REST_CON}        /restconf/config/opendaylight-inventory:nodes
13 ${REST_OPR}        /restconf/operational/opendaylight-inventory:nodes
14 ${BODY}            <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.2/24</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>
15
16 *** Test Cases *** 
17 Add a flow
18     [Documentation]    Push a flow through REST-API
19     [Tags]   Push
20     ${resp}   Putxml    session   ${REST_CON}/node/openflow:1/table/2/flow/139    data=${BODY}
21     Should Be Equal As Strings    ${resp.status_code}    200
22         
23 Verify after adding flow config
24     [Documentation]    Verify the flow
25     [Tags]   Get
26     ${resp}    Get    session     ${REST_CON}/node/openflow:1/table/2
27     Should Be Equal As Strings    ${resp.status_code}    200  
28     Should Contain     ${resp.content}    10.0.10.2/24
29     Should Contain     ${resp.content}    2048
30
31 Verify after adding flow operational
32     [Documentation]    Verify the flow
33     [Tags]   Get
34     ${resp}    Get    session     ${REST_OPR}/node/openflow:1/table/2
35     Should Be Equal As Strings    ${resp.status_code}    200
36     Should Contain     ${resp.content}    "flow-node-inventory:id": 2
37
38 Remove a flow
39     [Documentation]    Remove a flow
40     [Tags]    remove
41     ${resp}   Delete    session   ${REST_CON}/node/openflow:1/table/2/flow/139    
42     Should Be Equal As Strings    ${resp.status_code}    200
43    
44 Verify after deleting flow config
45     [Documentation]    Verify the flow
46     [Tags]   Get
47     ${resp}    Get    session     ${REST_CON}/node/openflow:1/table/2
48     Should Be Equal As Strings    ${resp.status_code}    404  
49     Should Contain    ${resp.content}    No data exists
50     Should Not Contain     ${resp.content}    10.0.10.2/24
51     Should Not Contain     ${resp.content}    2048
52
53