Merge "removing failing tests"
[integration/test.git] / test / csit / suites / karaf-compatible / 070__Flows_OF13 / 305__ttl.txt
1 *** Settings ***
2 Documentation     OF1.3 Suite to cover TTL Actions
3 ...               - Set IP TTL
4 ...               - Decrement IP TTL
5 ...               - Copy TTL outwards
6 ...               - Copy TTL inwards
7 ...               - Set MPLS TTL
8 ...               - Decrement MPLS TTL
9 ...
10 ...               NOTE: for OVS, it appears that set_ttl, and both copy in/out are not supported, so need to skip those checks for now.
11 Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
12 Suite Teardown    Delete All Sessions
13 Test Template     Create And Remove Flow
14 Library           SSHLibrary
15 Library           Collections
16 Library           OperatingSystem
17 Library           String
18 Library           XML
19 Resource          ../../../libraries/FlowLib.txt
20 Library           ../../../libraries/RequestsLibrary.py
21 Library           ../../../libraries/Common.py
22 Variables         ../../../variables/Variables.py
23
24 *** Variables ***
25 ${REST_CON}       /restconf/config/opendaylight-inventory:nodes
26 ${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
27 ${GENERIC_ACTION_FLOW_FILE}    ${CURDIR}/../../../variables/xmls/genericActionFlow.xml
28 ${ipv4_src}       10.1.2.0/24
29 ${ipv4_dst}       40.4.0.0/16
30 ${eth_type}       0x800
31 ${eth_src}        00:00:00:01:23:ae
32 ${eth_dst}        ff:ff:ff:ff:ff:ff
33 ${node_id}        openflow:1
34 ${set_ip_ttl_doc}    OF1.3: \ OFPAT_SET_NW_TTL = 23, /* IP TTL. */\n(currently not supported on OVS)
35 ${dec_ttl_doc}    OF1.3: \ OFPAT_DEC_NW_TTL = 24, /* Decrement IP TTL. */
36 ${copy_ttl_in_doc}    OFPAT_COPY_TTL_IN = 12, /* Copy TTL "inwards" -- from outermost to\nnext-to-outermost */\n(currently NOT supported in OVS)\n
37 ${copy_ttl_out_doc}    OFPAT_COPY_TTL_OUT = 11, /* Copy TTL "outwards" -- from next-to-outermost\nto outermost */\n(currently NOT suported in OVS)
38 ${set_mpls_ttl_doc}    OFPAT_SET_MPLS_TTL = 15, /* MPLS TTL */
39 ${dec_mpls_ttl_doc}    OFPAT_DEC_MPLS_TTL = 16, /* Decrement MPLS TTL */
40
41 *** Test Cases ***    ODL flow action        action key             action value    tableID    flowID    verify OVS?    OVS specific string?
42 Set_IP_TTL            [Documentation]        ${set_ip_ttl_doc}
43                       [Tags]                 ttl                    set
44                       set-nw-ttl-action      nw-ttl                 1               2          101       no             set_ttl
45
46 Dec_TTL               [Documentation]        ${dec_ttl_doc}
47                       [Tags]                 ttl                    dec
48                       dec-nw-ttl             none                   none            3          305       yes            dec_ttl
49
50 Copy_TTL_In           [Documentation]        ${copy_ttl_in_doc}
51                       [Tags]                 ttl                    copyin
52                       copy-ttl-in            none                   none            9          202       no             copy_ttl_in
53
54 Copy_TTL_Out          [Documentation]        ${copy_ttl_out_doc}
55                       [Tags]                 ttl                    copyout
56                       copy-ttl-out           none                   none            8          909       no             copy_ttl_out
57
58 Set_MPLS_TTL          [Documentation]        ${set_mpls_ttl_doc}
59                       [Tags]                 ttl                    setmpls
60                       set-mpls-ttl-action    mpls-ttl               1               4          505       yes            set_mpls_ttl
61
62 Dec_MPLS_TTL          [Documentation]        ${dec_mpls_ttl_doc}
63                       [Tags]                 ttl                    decmpls
64                       dec-mpls-ttl           none                   none            2          1001      yes            dec_mpls_ttl
65
66 *** Keywords ***
67 Create And Remove Flow
68     [Arguments]    ${flow_action}    ${action_key}    ${action_value}    ${table_id}    ${flow_id}    ${verify_switch_flag}
69     ...    ${additional_ovs_flowelements}
70     @{OVS_FLOWELEMENTS}    Create List    dl_dst=${eth_dst}    table=${table_id}    dl_src=${eth_src}    nw_src=${ipv4_src}    nw_dst=${ipv4_dst}
71     ...    ${additional_ovs_flowelements}
72     ##The dictionaries here will be used to populate the match and action elements of the flow mod
73     ${ethernet_match_dict}=    Create Dictionary    type=${eth_type}    destination=${eth_dst}    source=${eth_src}
74     ${ipv4_match_dict}=    Create Dictionary    source=${ipv4_src}    destination=${ipv4_dst}
75     ##flow is a python Object to build flow details, including the xml format to send to controller
76     ${flow}=    Create Inventory Flow
77     Set "${flow}" "table_id" With "${table_id}"
78     Set "${flow}" "id" With "${flow_id}"
79     Clear Flow Actions    ${flow}
80     Set Flow Action    ${flow}    0    0    ${flow_action}
81     Set Flow Ethernet Match    ${flow}    ${ethernet_match_dict}
82     Set Flow IPv4 Match    ${flow}    ${ipv4_match_dict}
83     ##If the ${flow_action} contains the string "set" we need to include a deeper action detail (e.g. set-ttl needs a element to indicate the value to set it to)
84     Run Keyword If    "set" in "${flow_action}"    Add Flow XML Element    ${flow}    ${action_key}    ${action_value}    instructions/instruction/apply-actions/action/${flow_action}
85     Log    Flow XML is ${flow.xml}
86     Add Flow To Controller And Verify    ${flow.xml}    ${node_id}    ${flow.table_id}    ${flow.id}
87     Run Keyword If    "${verify_switch_flag}" == "yes"    Verify Flow On Mininet Switch    ${OVS_FLOWELEMENTS}
88     Remove Flow From Controller And Verify    ${flow.xml}    ${node_id}    ${flow.table_id}    ${flow.id}
89     Run Keyword If    "${verify_switch_flag}" == "yes"    Verify Flow Does Not Exist On Mininet Switch    ${OVS_FLOWELEMENTS}