Step 2: Move test folder to root
[integration/test.git] / 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           RequestsLibrary
9 Library           ../../../libraries/Common.py
10 Variables         ../../../variables/Variables.py
11
12 *** Variables ***
13 ${REST_CON}       /restconf/config/opendaylight-inventory:nodes
14 ${FILE}           ${CURDIR}/../../../variables/xmls/f20.xml
15 ${FLOW}           143
16 ${TABLE}          2
17 @{FLOWELMENTS}    metadata=0x1010/0x12d692    LOCAL
18
19 *** Test Cases ***
20 Add a flow - Output to physical port#
21     [Documentation]    Push a flow through REST-API
22     [Tags]    Push
23     ${body}    OperatingSystem.Get File    ${FILE}
24     Set Suite Variable    ${body}
25     ${resp}    RequestsLibrary.Put    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${HEADERS_XML}    data=${body}
26     Should Be Equal As Strings    ${resp.status_code}    200
27
28 Verify after adding flow config - Output to physical port#
29     [Documentation]    Verify the flow
30     [Tags]    Get
31     ${resp}    RequestsLibrary.Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${ACCEPT_XML}
32     Should Be Equal As Strings    ${resp.status_code}    200
33     compare xml    ${body}    ${resp.content}
34
35 Verify flows after adding flow config on OVS
36     [Documentation]    Checking Flows on switch
37     [Tags]    Switch
38     sleep    1
39     write    dpctl dump-flows -O OpenFlow13
40     ${body}    OperatingSystem.Get File    ${FILE}
41     ${switchoutput}    Read Until    >
42     : FOR    ${flowElement}    IN    @{FLOWELMENTS}
43     \    should Contain    ${switchoutput}    ${flowElement}
44
45 Remove a flow - Output to physical port#
46     [Documentation]    Remove a flow
47     [Tags]    remove
48     ${resp}    RequestsLibrary.Delete    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
49     Should Be Equal As Strings    ${resp.status_code}    200
50
51 Verify after deleting flow config - Output to physical port#
52     [Documentation]    Verify the flow
53     [Tags]    Get
54     ${resp}    RequestsLibrary.Get    session    ${REST_CON}/node/openflow:1/table/${TABLE}
55     Should Not Contain    ${resp.content}    ${FLOW}
56
57 Verify flows after deleting flow config on OVS
58     [Documentation]    Checking Flows on switch
59     [Tags]    Switch
60     Sleep    1
61     write    dpctl dump-flows -O OpenFlow13
62     ${body}    OperatingSystem.Get File    ${FILE}
63     ${switchoutput}    Read Until    >
64     : FOR    ${flowElement}    IN    @{FLOWELMENTS}
65     \    should Not Contain    ${switchoutput}    ${flowElement}