Step 1: Move vm scripts to the right place
[integration/test.git] / test / csit / suites / openflowplugin / Flows_OF13 / 315__timeout_vlan_pcp_vlan.robot
1 *** Settings ***
2 Documentation     Test suite for Time our values and Vlan and PCP Vlan
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/f16.xml
15 ${FLOW}           139
16 ${TABLE}          2
17 @{FLOWELMENTS}    table=2    priority=16    dl_vlan=78    dl_vlan_pcp=3
18 ...               dl_src=00:00:00:11:23:ae    dl_dst=ff:ff:29:01:19:61    dec_ttl
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
39     sleep    1
40     write    dpctl dump-flows -O OpenFlow13
41     ${switchoutput}    Read Until     mininet>
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     ${switchoutput}    Read Until     mininet>
63     : FOR    ${flowElement}    IN    @{FLOWELMENTS}
64     \    should Not Contain    ${switchoutput}    ${flowElement}