780c3533222651e469724709aaf43d2c102d5829
[integration/test.git] / test / csit / suites / karaf-compatible / 010__MD_SAL_NSF / 040__restconf_frm.txt
1 *** Settings ***
2 Documentation     Test suite for RESTCONF FRM
3 Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    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 Resource          ../../../libraries/Utils.txt
10
11 *** Variables ***
12 ${REST_CON}       /restconf/config/opendaylight-inventory:nodes
13 ${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
14 ${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>
15
16 *** Test Cases ***
17 Add a flow - Output to physical port#
18     [Documentation]    Push a flow through REST-API
19     [Tags]    Push
20     ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/0/flow/152    data=${BODY2}
21     Should Be Equal As Strings    ${resp.status_code}    200
22
23 Verify after adding flow config - Output to physical port#
24     [Documentation]    Verify the flow
25     [Tags]    Get
26     ${resp}    RequestsLibrary.Get    session    ${REST_CON}/node/openflow:1/table/0
27     Should Be Equal As Strings    ${resp.status_code}    200
28     Should Contain    ${resp.content}    152
29
30 Verify after adding flow operational - Output to physical port#
31     [Documentation]    Verify the flow
32     [Tags]    Get
33     ${elements}=    Create List    10.0.20.1
34     Wait Until Keyword Succeeds    60s    2s    Check For Elements At URI    ${REST_OPR}/node/openflow:1/table/0    ${elements}
35
36 Remove a flow - Output to physical port#
37     [Documentation]    Remove a flow
38     [Tags]    remove
39     ${resp}    RequestsLibrary.Delete    session    ${REST_CON}/node/openflow:1/table/0/flow/152
40     Should Be Equal As Strings    ${resp.status_code}    200
41
42 Verify after deleting flow config - Output to physical port#
43     [Documentation]    Verify the flow
44     [Tags]    Get
45     ${resp}    RequestsLibrary.Get    session    ${REST_CON}/node/openflow:1/table/0
46     Should Be Equal As Strings    ${resp.status_code}    200
47     Should Not Contain    ${resp.content}    152
48     #    Standing bug #368 - This has been fixed
49
50 Verify after deleting flow operational - Output to physical port#
51     [Documentation]    Verify the flow
52     [Tags]    Get
53     ${elements}=    Create List    10.0.20.1
54     Wait Until Keyword Succeeds    60s    2s    Check For Elements Not At URI    ${REST_OPR}/node/openflow:1/table/0    ${elements}