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
19 Resource ../../../libraries/FlowLib.txt
20 Library ../../../libraries/RequestsLibrary.py
21 Library ../../../libraries/Common.py
22 Variables ../../../variables/Variables.py
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 ${MININET_CMD} sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,1 --switch ovsk,protocols=OpenFlow13
29 ${ipv4_src} 10.1.2.0/24
30 ${ipv4_dst} 40.4.0.0/16
32 ${eth_src} 00:00:00:01:23:ae
33 ${eth_dst} ff:ff:ff:ff:ff:ff
35 ${set_ip_ttl_doc} OF1.3: \ OFPAT_SET_NW_TTL = 23, /* IP TTL. */\n(currently not supported on OVS)
36 ${dec_ttl_doc} OF1.3: \ OFPAT_DEC_NW_TTL = 24, /* Decrement IP TTL. */
37 ${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
38 ${copy_ttl_out_doc} OFPAT_COPY_TTL_OUT = 11, /* Copy TTL "outwards" -- from next-to-outermost\nto outermost */\n(currently NOT suported in OVS)
39 ${set_mpls_ttl_doc} OFPAT_SET_MPLS_TTL = 15, /* MPLS TTL */
40 ${dec_mpls_ttl_doc} OFPAT_DEC_MPLS_TTL = 16, /* Decrement MPLS TTL */
42 *** Test Cases *** ODL flow action action key action value tableID flowID verify OVS? OVS specific string?
43 Set_IP_TTL [Documentation] ${set_ip_ttl_doc}
45 set-nw-ttl-action nw-ttl 1 2 101 no set_ttl
47 Dec_TTL [Documentation] ${dec_ttl_doc}
49 dec-nw-ttl none none 3 305 yes dec_ttl
51 Copy_TTL_In [Documentation] ${copy_ttl_in_doc}
53 copy-ttl-in none none 9 202 no copy_ttl_in
55 Copy_TTL_Out [Documentation] ${copy_ttl_out_doc}
57 copy-ttl-out none none 8 909 no copy_ttl_out
59 Set_MPLS_TTL [Documentation] ${set_mpls_ttl_doc}
61 set-mpls-ttl-action mpls-ttl 1 4 505 yes set_mpls_ttl
63 Dec_MPLS_TTL [Documentation] ${dec_mpls_ttl_doc}
65 dec-mpls-ttl none none 2 1001 yes dec_mpls_ttl
68 Create And Remove Flow
69 [Arguments] ${flow_action} ${action_key} ${action_value} ${table_id} ${flow_id} ${verify_switch_flag}
70 ... ${additional_ovs_flowelements}
71 @{OVS_FLOWELEMENTS} Create List dl_dst=${eth_dst} table=${table_id} dl_src=${eth_src} nw_src=${ipv4_src} nw_dst=${ipv4_dst}
72 ... ${additional_ovs_flowelements}
73 ##The dictionaries here will be used to populate the match and action elements of the flow mod
74 ${ethernet_match_dict}= Create Dictionary type=${eth_type} destination=${eth_dst} source=${eth_src}
75 ${ipv4_match_dict}= Create Dictionary source=${ipv4_src} destination=${ipv4_dst}
76 ##flow is a python Object to build flow details, including the xml format to send to controller
78 Set "${flow}" "table_id" With "${table_id}"
79 Set "${flow}" "id" With "${flow_id}"
80 Clear Flow Actions ${flow}
81 Set Flow Action ${flow} 0 0 ${flow_action}
82 Set Flow Ethernet Match ${flow} ${ethernet_match_dict}
83 Set Flow IPv4 Match ${flow} ${ipv4_match_dict}
84 ##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)
85 Run Keyword If "set" in "${flow_action}" Add Flow XML Element ${flow} ${action_key} ${action_value} instructions/instruction/apply-actions/action/${flow_action}
86 Log Flow XML is ${flow.xml}
87 Add Flow To Controller And Verify ${flow.xml} ${node_id} ${flow.table_id} ${flow.id}
88 Run Keyword If "${verify_switch_flag}" == "yes" Verify Flow On Mininet Switch ${OVS_FLOWELEMENTS}
89 Remove Flow From Controller And Verify ${flow.xml} ${node_id} ${flow.table_id} ${flow.id}
90 Run Keyword If "${verify_switch_flag}" == "yes" Verify Flow Does Not Exist On Mininet Switch ${OVS_FLOWELEMENTS}