2 Documentation OF1.3 Suite for flow actions
4 ... - output CONTROLLER
12 ... NOTE: for OVS, INPORT does not appear to be supported
13 Suite Setup OpenFlow Actions Suite Setup
14 Suite Teardown OpenFlow Actions Suite Teardown
15 Test Template Create And Remove Flow
17 Library OperatingSystem
20 Resource ../../../libraries/Utils.robot
21 Resource ../../../libraries/FlowLib.robot
22 Resource ../../../libraries/SwitchUtils.robot
23 Resource ../../../libraries/OVSDB.robot
24 Library RequestsLibrary
25 Library ../../../libraries/Common.py
26 Variables ../../../variables/Variables.py
27 Library ../../../libraries/SwitchClasses/${SWITCH_CLASS}.py
31 ${SWITCH_IP} ${TOOLS_SYSTEM_IP}
32 ${SWITCH_PROMPT} ${TOOLS_SYSTEM_PROMPT}
34 ${ipv4_src} 11.3.0.0/16
35 ${ipv4_dst} 99.0.0.0/8
37 ${eth_src} 00:ab:cd:ef:01:23
38 ${eth_dst} ff:ff:ff:ff:ff:ff
39 ##documentation strings
40 ${INPORT_doc} 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
41 ${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. */
42 ${NORMAL_doc} OF1.3 OFPP_NORMAL = 0xfffffffa, /* Process with normal L2/L3 switching. */
43 ${FLOOD_doc} OF1.3 OFPP_FLOOD = 0xfffffffb, /* All physical ports in VLAN, except input port and those blocked or link down. */
44 ${ALL_doc} OF1.3: OFPP_ALL = 0xfffffffc, /* All physical ports except input port. */
45 ${CONTROLLER_doc} OF1.3 OFPP_CONTROLLER = 0xfffffffd, /* Send to controller. */
46 ${LOCAL_doc} OF1.3 OFPP_LOCAL = 0xfffffffe, /* Local openflow "port". */
48 *** Test Cases *** output port tableID flowID priority
49 INPORT [Documentation] ${INPORT_doc}
51 ${TEST_NAME} 200 161 1
53 TABLE [Documentation] ${TABLE_doc}
55 ${TEST_NAME} 200 261 65535
57 NORMAL [Documentation] ${NORMAL_doc}
59 ${TEST_NAME} 200 361 9
61 FLOOD [Documentation] ${FLOOD_doc}
63 ${TEST_NAME} 200 81 255
65 ALL [Documentation] ${ALL_doc}
67 ${TEST_NAME} 200 88 42
69 CONTROLLER [Documentation] ${CONTROLLER_doc}
71 ${TEST_NAME} 200 21 21
73 LOCAL [Documentation] ${LOCAL_doc}
75 ${TEST_NAME} 200 32 12345
78 Create And Remove Flow
79 [Arguments] ${output_port} ${table_id} ${flow_id} ${priority}
80 ##The dictionaries here will be used to populate the match and action elements of the flow mod
81 ${ethernet_match_dict}= Create Dictionary type=${eth_type} destination=${eth_dst} source=${eth_src}
82 ${ipv4_match_dict}= Create Dictionary source=${ipv4_src} destination=${ipv4_dst}
83 ##flow is a python Object to build flow details, including the xml format to send to controller
84 ${flow}= Create Inventory Flow
85 Set "${flow}" "table_id" With "${table_id}"
86 Set "${flow}" "id" With "${flow_id}"
87 Set "${flow}" "priority" With "${priority}"
88 Clear Flow Actions ${flow}
89 Set Flow Output Action ${flow} 0 0 ${output_port}
90 Set Flow Ethernet Match ${flow} ${ethernet_match_dict}
91 Set Flow IPv4 Match ${flow} ${ipv4_match_dict}
92 Log Flow XML is ${flow.xml}
93 Call Method ${test_switch} create_flow_match_elements ${flow.xml}
94 Log ${test_switch.flow_validations}
95 ${dpid_id}= Get Switch Datapath ID ${test_switch}
96 Wait Until Keyword Succeeds 3s 1s Add Flow To Controller And Verify ${flow.xml} openflow:${dpid_id} ${flow.table_id}
98 Wait Until Keyword Succeeds 3s 1s Validate Switch Output ${test_switch} ${test_switch.dump_all_flows} ${test_switch.flow_validations}
99 Wait Until Keyword Succeeds 3s 1s Remove Flow From Controller And Verify openflow:${dpid_id} ${flow.table_id} ${flow.id}
100 Wait Until Keyword Succeeds 3s 1s Validate Switch Output ${test_switch} ${test_switch.dump_all_flows} ${test_switch.flow_validations}
103 OpenFlow Actions Suite Setup
104 ${test_switch}= Get Switch ${SWITCH_CLASS}
105 Set Suite Variable ${test_switch}
106 Call Method ${test_switch} set_mgmt_ip ${SWITCH_IP}
107 Call Method ${test_switch} set_controller_ip ${ODL_SYSTEM_IP}
108 Call Method ${test_switch} set_mgmt_prompt ${SWITCH_PROMPT}
109 Run Command On Controller ${ODL_SYSTEM_IP} ps -elf | grep java
110 Log MAKE: ${test_switch.make}\n MODEL: ${test_switch.model}\n IP: ${test_switch.mgmt_ip}\n PROMPT: ${test_switch.mgmt_prompt}\n CONTROLLER_IP: ${test_switch.of_controller_ip}\n MGMT_PROTOCOL: ${test_switch.mgmt_protocol}
111 Ping ${test_switch.mgmt_ip}
112 Initialize Switch ${test_switch}
113 Configure OpenFlow ${test_switch}
114 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
116 OpenFlow Actions Suite Teardown
117 Clean OVSDB Test Environment
118 Cleanup Switch ${test_switch}
119 SSHLibrary.Close All Connections
120 Telnet.Close All Connections