Merge "Bug 1731: Breaking dependency cycle between features-{mdsal,aaa}"
[integration.git] / test / csit / suites / base-of13 / 070__Flows_OF13 / 400__actions.txt
1 *** Settings ***
2 Documentation     OF1.3 Suite for flow actions
3 ...               - output ALL
4 ...               - output CONTROLLER
5 ...               - output TABLE
6 ...               - output IN_PORT
7 ...               - output LOCAL
8 ...               - output NORMAL
9 ...               - output FLOOD
10 ...               - output ANY
11 ...
12 ...               NOTE: for OVS, IN_PORT does not appear to be supported
13 Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
14 Suite Teardown    Delete All Sessions
15 Test Template     Create And Remove Flow
16 Library           SSHLibrary
17 Library           Collections
18 Library           OperatingSystem
19 Library           String
20 Library           XML
21 Resource          ../../../libraries/FlowLib.txt
22 Library           ../../../libraries/RequestsLibrary.py
23 Library           ../../../libraries/Common.py
24 Variables         ../../../variables/Variables.py
25
26 *** Variables ***
27 ${REST_CON}       /restconf/config/opendaylight-inventory:nodes
28 ${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
29 ${GENERIC_ACTION_FLOW_FILE}    ${CURDIR}/../../../variables/xmls/genericActionFlow.xml
30 ${MININET_CMD}    sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,1 --switch ovsk,protocols=OpenFlow13
31 ${ipv4_src}       11.3.0.0/16
32 ${ipv4_dst}       99.0.0.0/8
33 ${eth_type}       0x800
34 ${eth_src}        00:ab:cd:ef:01:23
35 ${eth_dst}        ff:ff:ff:ff:ff:ff
36 ${node_id}        openflow:1
37 ##documentation strings
38 ${IN_PORT_doc}    OF1.3: OFPP_IN_PORT = 0xfffffff8, /* Send the packet out the input port. This\nreserved port must be explicitly used\nin order to send back out of the input\nport. */\n
39 ${TABLE_doc}      OF1.3: OFPP_TABLE = 0xfffffff9, /* Submit the packet to the first flow table NB: This destination port can only be used in packet-out messages. */
40 ${NORMAL_doc}     OF1.3 OFPP_NORMAL = 0xfffffffa, /* Process with normal L2/L3 switching. */
41 ${FLOOD_doc}      OF1.3 OFPP_FLOOD = 0xfffffffb, /* All physical ports in VLAN, except input port and those blocked or link down. */
42 ${ALL_doc}        OF1.3: OFPP_ALL = 0xfffffffc, /* All physical ports except input port. */
43 ${CONTROLLER_doc}    OF1.3 OFPP_CONTROLLER = 0xfffffffd, /* Send to controller. */
44 ${LOCAL_doc}      OF1.3 OFPP_LOCAL = 0xfffffffe, /* Local openflow "port". */
45 ${ANY_doc}        OF1.3 OFPP_ANY = 0xffffffff /* Wildcard port used only for flow mod (delete) and flow stats requests. Selects all flows regardless of output port (including flows with no output port). */
46
47 *** Test Cases ***    output port        tableID              flowID    verify OVS?    OVS specific strings
48 IN_PORT               [Documentation]    ${IN_PORT_doc}
49                       [Tags]             in_port
50                       ${TEST_NAME}       22                   161       no             actions=${TEST_NAME}
51
52 TABLE                 [Documentation]    ${TABLE_doc}
53                       [Tags]             table
54                       ${TEST_NAME}       29                   261       yes            actions=${TEST_NAME}
55
56 NORMAL                [Documentation]    ${NORMAL_doc}
57                       [Tags]             normal
58                       ${TEST_NAME}       13                   361       yes            actions=${TEST_NAME}
59
60 FLOOD                 [Documentation]    ${FLOOD_doc}
61                       [Tags]             flood
62                       ${TEST_NAME}       47                   81        yes            actions=${TEST_NAME}
63
64 ALL                   [Documentation]    ${ALL_doc}
65                       [Tags]             all
66                       ${TEST_NAME}       42                   88        yes            actions=${TEST_NAME}
67
68 CONTROLLER            [Documentation]    ${CONTROLLER_doc}
69                       [Tags]             controller
70                       ${TEST_NAME}       81                   21        yes            actions=${TEST_NAME}
71
72 LOCAL                 [Documentation]    ${LOCAL_doc}
73                       [Tags]             local
74                       ${TEST_NAME}       122                  32        yes            actions=${TEST_NAME}
75
76 ANY                   [Documentation]    ${ANY_doc}
77                       [Tags]             any
78                       ${TEST_NAME}       222                  111       yes            actions=${TEST_NAME}
79
80 *** Keywords ***
81 Create And Remove Flow
82     [Arguments]    ${output_port}    ${table_id}    ${flow_id}    ${verify_switch_flag}    ${additional_ovs_flowelements}
83     Remove Default Flows    ${node_id}
84     Run Keyword If    "${output_port}" == "IN_PORT"    Pass Execution    Skipping ${output_port} test and marking it passed
85     Run Keyword If    "${output_port}" == "ANY"    Pass Execution    Skipping ${output_port} test and marking it passed
86     @{OVS_FLOWELEMENTS}    Create List    dl_dst=${eth_dst}    table=${table_id}    dl_src=${eth_src}    nw_src=${ipv4_src}    nw_dst=${ipv4_dst}
87     ...    ${additional_ovs_flowelements}
88     ##The dictionaries here will be used to populate the match and action elements of the flow mod
89     ${ethernet_match_dict}=    Create Dictionary    type=${eth_type}    destination=${eth_dst}    source=${eth_src}
90     ${ipv4_match_dict}=    Create Dictionary    source=${ipv4_src}    destination=${ipv4_dst}
91     ##flow is a python Object to build flow details, including the xml format to send to controller
92     ${flow}=    Create Flow
93     Set "${flow}" "table_id" With "${table_id}"
94     Set "${flow}" "id" With "${flow_id}"
95     Clear Flow Actions    ${flow}
96     Set Flow Output Action    ${flow}    0    0    ${output_port}
97     Set Flow Ethernet Match    ${flow}    ${ethernet_match_dict}
98     Set Flow IPv4 Match    ${flow}    ${ipv4_match_dict}
99     Log    Flow XML is ${flow.xml}
100     Add Flow To Controller And Verify    ${flow.xml}    ${node_id}    ${flow.table_id}    ${flow.id}
101     Run Keyword If    "${verify_switch_flag}" == "yes"    Verify Flow On Mininet Switch    ${OVS_FLOWELEMENTS}
102     Remove Flow From Controller And Verify    ${flow.xml}    ${node_id}    ${flow.table_id}    ${flow.id}
103     Run Keyword If    "${verify_switch_flag}" == "yes"    Verify Flow Does Not Exist On Mininet Switch    ${OVS_FLOWELEMENTS}