Step 2: Move test folder to root
[integration/test.git] / csit / suites / openflowplugin / Flows_OF13 / 306__eth_ip_qos.robot
1 *** Settings ***
2 Documentation     Test suite for IP,Ethernet,DSCP and Action dec TTL
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/f7.xml
15 ${FLOW}           130
16 ${TABLE}          2
17 @{FLOWELMENTS}    dl_dst=ff:ff:ff:ff:ff:aa    table=2    nw_ecn=1    dl_src=00:00:00:11:23:ae    nw_src=10.1.2.0    nw_dst=20.4.0.0    dec_ttl
18 ...               nw_proto=56    nw_tos=60
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}    RequestsLibrary.Put    session    ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}    headers=${HEADERS_XML}    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}    RequestsLibrary.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    ${EMPTY}
39     sleep    1
40     write    dpctl dump-flows -O OpenFlow13
41     ${body}    OperatingSystem.Get File    ${FILE}
42     ${switchoutput}    Read Until    >
43     : FOR    ${flowElement}    IN    @{FLOWELMENTS}
44     \    should Contain    ${switchoutput}    ${flowElement}
45
46 Remove a flow - Output to physical port#
47     [Documentation]    Remove a flow
48     [Tags]    remove
49     ${resp}    RequestsLibrary.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}    RequestsLibrary.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     ${switchoutput}    Read Until    >
65     : FOR    ${flowElement}    IN    @{FLOWELMENTS}
66     \    should Not Contain    ${switchoutput}    ${flowElement}