2 Documentation OF1.3 Suite to cover TTL Actions
5 ... - Copy TTL outwards
8 ... - Decrement MPLS TTL
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
16 Library OperatingSystem
18 Library RequestsLibrary
20 Resource ../../../libraries/FlowLib.robot
21 Library ../../../libraries/Common.py
22 Variables ../../../variables/Variables.py
25 ${REST_CON} /restconf/config/opendaylight-inventory:nodes
26 ${GENERIC_ACTION_FLOW_FILE} ${CURDIR}/../../../variables/xmls/genericActionFlow.xml
27 ${ipv4_src} 10.1.2.0/24
28 ${ipv4_dst} 40.4.0.0/16
30 ${eth_src} 00:00:00:01:23:ae
31 ${eth_dst} ff:ff:ff:ff:ff:ff
33 ${set_ip_ttl_doc} OF1.3: \ OFPAT_SET_NW_TTL = 23, /* IP TTL. */\n(currently not supported on OVS)
34 ${dec_ttl_doc} OF1.3: \ OFPAT_DEC_NW_TTL = 24, /* Decrement IP TTL. */
35 ${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
36 ${copy_ttl_out_doc} OFPAT_COPY_TTL_OUT = 11, /* Copy TTL "outwards" -- from next-to-outermost\nto outermost */\n(currently NOT suported in OVS)
37 ${set_mpls_ttl_doc} OFPAT_SET_MPLS_TTL = 15, /* MPLS TTL */
38 ${dec_mpls_ttl_doc} OFPAT_DEC_MPLS_TTL = 16, /* Decrement MPLS TTL */
40 *** Test Cases *** ODL flow action action key action value tableID flowID priority verify OVS? OVS specific string?
41 Set_IP_TTL [Documentation] ${set_ip_ttl_doc}
43 set-nw-ttl-action nw-ttl 1 2 101 10 no set_ttl
45 Dec_TTL [Documentation] ${dec_ttl_doc}
47 dec-nw-ttl none none 3 305 311 yes dec_ttl
49 Copy_TTL_In [Documentation] ${copy_ttl_in_doc}
51 copy-ttl-in none none 9 202 9 no copy_ttl_in
53 Copy_TTL_Out [Documentation] ${copy_ttl_out_doc}
55 copy-ttl-out none none 8 909 4242 no copy_ttl_out
57 Set_MPLS_TTL [Documentation] ${set_mpls_ttl_doc}
59 set-mpls-ttl-action mpls-ttl 1 4 505 9021 yes set_mpls_ttl
61 Dec_MPLS_TTL [Documentation] ${dec_mpls_ttl_doc}
63 dec-mpls-ttl none none 2 1001 81 yes dec_mpls_ttl
66 Create And Remove Flow
67 [Arguments] ${flow_action} ${action_key} ${action_value} ${table_id} ${flow_id} ${priority}
68 ... ${verify_switch_flag} ${additional_ovs_flowelements}
69 @{OVS_FLOWELEMENTS} Create List dl_dst=${eth_dst} table=${table_id} dl_src=${eth_src} nw_src=${ipv4_src} nw_dst=${ipv4_dst}
70 ... ${additional_ovs_flowelements}
71 ##The dictionaries here will be used to populate the match and action elements of the flow mod
72 ${ethernet_match_dict}= Create Dictionary type=${eth_type} destination=${eth_dst} source=${eth_src}
73 ${ipv4_match_dict}= Create Dictionary source=${ipv4_src} destination=${ipv4_dst}
74 ##flow is a python Object to build flow details, including the xml format to send to controller
75 ${flow}= Create Inventory Flow
76 Set "${flow}" "table_id" With "${table_id}"
77 Set "${flow}" "id" With "${flow_id}"
78 Set "${flow}" "priority" With "${priority}"
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}