2 Documentation OF1.3 Suite for flow actions
4 ... - output CONTROLLER
12 ... NOTE: for OVS, INPORT does not appear to be supported
15 Library OperatingSystem
18 Resource ../../../libraries/Utils.robot
19 Resource ../../../libraries/FlowLib.robot
20 Resource ../../../libraries/SwitchUtils.robot
21 Resource ../../../libraries/OVSDB.robot
22 Library RequestsLibrary
23 Library ../../../libraries/Common.py
24 Variables ../../../variables/Variables.py
25 Library ../../../libraries/SwitchClasses/${SWITCH_CLASS}.py
27 Suite Setup OpenFlow Actions Suite Setup
28 Suite Teardown OpenFlow Actions Suite Teardown
29 Test Template Create And Remove Flow
34 ${SWITCH_IP} ${TOOLS_SYSTEM_IP}
35 ${SWITCH_PROMPT} ${TOOLS_SYSTEM_PROMPT}
37 ${ipv4_src} 11.3.0.0/16
38 ${ipv4_dst} 99.0.0.0/8
40 ${eth_src} 00:ab:cd:ef:01:23
41 ${eth_dst} ff:ff:ff:ff:ff:ff
42 ##documentation strings
44 ... OF1.3: OFPP_INPORT = 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
46 ... 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. */
47 ${NORMAL_doc} OF1.3 OFPP_NORMAL = 0xfffffffa, /* Process with normal L2/L3 switching. */
49 ... OF1.3 OFPP_FLOOD = 0xfffffffb, /* All physical ports in VLAN, except input port and those blocked or link down. */
50 ${ALL_doc} OF1.3: OFPP_ALL = 0xfffffffc, /* All physical ports except input port. */
51 ${CONTROLLER_doc} OF1.3 OFPP_CONTROLLER = 0xfffffffd, /* Send to controller. */
52 ${LOCAL_doc} OF1.3 OFPP_LOCAL = 0xfffffffe, /* Local openflow "port". */
55 *** Test Cases *** output port tableID flowID priority
56 INPORT [Documentation] ${INPORT_doc}
58 ${TEST_NAME} 200 161 1
59 TABLE [Documentation] ${TABLE_doc}
61 ${TEST_NAME} 200 261 65535
62 NORMAL [Documentation] ${NORMAL_doc}
64 ${TEST_NAME} 200 361 9
65 FLOOD [Documentation] ${FLOOD_doc}
67 ${TEST_NAME} 200 81 255
68 ALL [Documentation] ${ALL_doc}
70 ${TEST_NAME} 200 88 42
71 CONTROLLER [Documentation] ${CONTROLLER_doc}
73 ${TEST_NAME} 200 21 21
74 LOCAL [Documentation] ${LOCAL_doc}
76 ${TEST_NAME} 200 32 12345
80 Create And Remove Flow
81 [Arguments] ${output_port} ${table_id} ${flow_id} ${priority}
82 ##The dictionaries here will be used to populate the match and action elements of the flow mod
83 ${ethernet_match_dict}= Create Dictionary type=${eth_type} destination=${eth_dst} source=${eth_src}
84 ${ipv4_match_dict}= Create Dictionary source=${ipv4_src} destination=${ipv4_dst}
85 ##flow is a python Object to build flow details, including the xml format to send to controller
86 ${flow}= Create Inventory Flow
87 Set "${flow}" "table_id" With "${table_id}"
88 Set "${flow}" "id" With "${flow_id}"
89 Set "${flow}" "priority" With "${priority}"
90 Clear Flow Actions ${flow}
91 Set Flow Output Action ${flow} 0 0 ${output_port}
92 Set Flow Ethernet Match ${flow} ${ethernet_match_dict}
93 Set Flow IPv4 Match ${flow} ${ipv4_match_dict}
94 Log Flow XML is ${flow.xml}
95 Call Method ${test_switch} create_flow_match_elements ${flow.xml}
96 Log ${test_switch.flow_validations}
97 ${dpid_id}= Get Switch Datapath ID ${test_switch}
98 Wait Until Keyword Succeeds
101 ... Add Flow To Controller And Verify
103 ... openflow%3A${dpid_id}
106 Wait Until Keyword Succeeds
109 ... Validate Switch Output
111 ... ${test_switch.dump_all_flows}
112 ... ${test_switch.flow_validations}
113 Wait Until Keyword Succeeds
116 ... Remove Flow From Controller And Verify
117 ... openflow%3A${dpid_id}
120 Wait Until Keyword Succeeds
123 ... Validate Switch Output
125 ... ${test_switch.dump_all_flows}
126 ... ${test_switch.flow_validations}
129 OpenFlow Actions Suite Setup
130 ${test_switch}= Get Switch ${SWITCH_CLASS}
131 Set Suite Variable ${test_switch}
132 Call Method ${test_switch} set_mgmt_ip ${SWITCH_IP}
133 Call Method ${test_switch} set_controller_ip ${ODL_SYSTEM_IP}
134 Call Method ${test_switch} set_mgmt_prompt ${SWITCH_PROMPT}
135 Run Command On Controller ${ODL_SYSTEM_IP} ps -elf | grep java
137 ... MAKE: ${test_switch.make}\nMODEL: ${test_switch.model}\nIP: ${test_switch.mgmt_ip}\nPROMPT: ${test_switch.mgmt_prompt}\nCONTROLLER_IP: ${test_switch.of_controller_ip}\nMGMT_PROTOCOL: ${test_switch.mgmt_protocol}
138 Ping ${test_switch.mgmt_ip}
139 Initialize Switch ${test_switch}
140 Configure OpenFlow ${test_switch}
141 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
143 OpenFlow Actions Suite Teardown
144 Clean OVSDB Test Environment
145 Cleanup Switch ${test_switch}
146 SSHLibrary.Close All Connections
147 Telnet.Close All Connections