2 Documentation OF1.3 Suite for flow actions
4 ... - output CONTROLLER
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
18 Library OperatingSystem
21 Resource ../../../libraries/FlowLib.txt
22 Library ../../../libraries/RequestsLibrary.py
23 Library ../../../libraries/Common.py
24 Variables ../../../variables/Variables.py
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
34 ${eth_src} 00:ab:cd:ef:01:23
35 ${eth_dst} ff:ff:ff:ff:ff:ff
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). */
47 *** Test Cases *** output port tableID flowID verify OVS? OVS specific strings
48 IN_PORT [Documentation] ${IN_PORT_doc}
50 ${TEST_NAME} 22 161 no actions=${TEST_NAME}
52 TABLE [Documentation] ${TABLE_doc}
54 ${TEST_NAME} 29 261 yes actions=${TEST_NAME}
56 NORMAL [Documentation] ${NORMAL_doc}
58 ${TEST_NAME} 13 361 yes actions=${TEST_NAME}
60 FLOOD [Documentation] ${FLOOD_doc}
62 ${TEST_NAME} 47 81 yes actions=${TEST_NAME}
64 ALL [Documentation] ${ALL_doc}
66 ${TEST_NAME} 42 88 yes actions=${TEST_NAME}
68 CONTROLLER [Documentation] ${CONTROLLER_doc}
70 ${TEST_NAME} 81 21 yes actions=${TEST_NAME}
72 LOCAL [Documentation] ${LOCAL_doc}
74 ${TEST_NAME} 122 32 yes actions=${TEST_NAME}
76 ANY [Documentation] ${ANY_doc}
78 ${TEST_NAME} 222 111 yes actions=${TEST_NAME}
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
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}