Merge "Reworked FlowConfigBlaster to be able to batch multiple flows in a single...
[integration/test.git] / test / csit / suites / openflowplugin / Flows_OF13 / 319__metadata_mask.robot
1 *** Settings ***
2 Documentation     Test suite for metadata and mask
3 Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
4 Suite Teardown    Delete All Sessions
5 Library           SSHLibrary
6 Library           Collections
7 Library           OperatingSystem
8 Library           ../../../libraries/RequestsLibrary.py
9 Library           ../../../libraries/Common.py
10 Variables         ../../../variables/Variables.py
11
12 *** Variables ***
13 ${REST_CON}       /restconf/config/opendaylight-inventory:nodes
14 ${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
15 ${FILE}           ${CURDIR}/../../../variables/xmls/f20.xml
16 ${FLOW}           143
17 ${TABLE}          2
18 @{FLOWELMENTS}    metadata=0x1010/0x12d692    LOCAL
19
20 *** Test Cases ***
21 Add a flow - Output to physical port#
22     [Documentation]    Push a flow through REST-API
23     [Tags]    Push
24     ${body}    OperatingSystem.Get File    ${FILE}
25     Set Suite Variable    ${body}
26     ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    data=${body}
27     Should Be Equal As Strings    ${resp.status_code}    200
28
29 Verify after adding flow config - Output to physical port#
30     [Documentation]    Verify the flow
31     [Tags]    Get
32     ${resp}    get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
33     Should Be Equal As Strings    ${resp.status_code}    200
34     compare xml    ${body}    ${resp.content}
35
36 Verify flows after adding flow config on OVS
37     [Documentation]    Checking Flows on switch
38     [Tags]    Switch
39     sleep    1
40     write    dpctl dump-flows -O OpenFlow13
41     ${body}    OperatingSystem.Get File    ${FILE}
42     ${switchouput}    Read Until    >
43     : FOR    ${flowElement}    IN    @{FLOWELMENTS}
44     \    should Contain    ${switchouput}    ${flowElement}
45
46 Remove a flow - Output to physical port#
47     [Documentation]    Remove a flow
48     [Tags]    remove
49     ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
50     Should Be Equal As Strings    ${resp.status_code}    200
51
52 Verify after deleting flow config - Output to physical port#
53     [Documentation]    Verify the flow
54     [Tags]    Get
55     ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
56     Should Not Contain    ${resp.content}    ${FLOW}
57
58 Verify flows after deleting flow config on OVS
59     [Documentation]    Checking Flows on switch
60     [Tags]    Switch
61     Sleep    1
62     write    dpctl dump-flows -O OpenFlow13
63     ${body}    OperatingSystem.Get File    ${FILE}
64     ${switchouput}    Read Until    >
65     : FOR    ${flowElement}    IN    @{FLOWELMENTS}
66     \    should Not Contain    ${switchouput}    ${flowElement}