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.txt
21 Resource ../../../libraries/FlowLib.txt
22 Resource ../../../libraries/SwitchUtils.txt
23 Library ../../../libraries/RequestsLibrary.py
24 Library ../../../libraries/Common.py
25 Variables ../../../variables/Variables.py
26 Library ../../../libraries/SwitchClasses/${SWITCH_CLASS}.py
30 ${SWITCH_IP} ${MININET}
32 ${REST_CON} /restconf/config/opendaylight-inventory:nodes
33 ${REST_OPR} /restconf/operational/opendaylight-inventory:nodes
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". */
47 ${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). */
49 *** Test Cases *** output port tableID flowID priority
50 INPORT [Documentation] ${INPORT_doc}
52 ${TEST_NAME} 200 161 1
54 TABLE [Documentation] ${TABLE_doc}
56 ${TEST_NAME} 200 261 65535
58 NORMAL [Documentation] ${NORMAL_doc}
60 ${TEST_NAME} 200 361 9
62 FLOOD [Documentation] ${FLOOD_doc}
64 ${TEST_NAME} 200 81 255
66 ALL [Documentation] ${ALL_doc}
68 ${TEST_NAME} 200 88 42
70 CONTROLLER [Documentation] ${CONTROLLER_doc}
72 ${TEST_NAME} 200 21 21
74 LOCAL [Documentation] ${LOCAL_doc}
76 ${TEST_NAME} 200 32 12345
78 ANY [Documentation] ${ANY_doc}
80 ${TEST_NAME} 200 111 54321
83 Create And Remove Flow
84 [Arguments] ${output_port} ${table_id} ${flow_id} ${priority}
85 ##The dictionaries here will be used to populate the match and action elements of the flow mod
86 ${ethernet_match_dict}= Create Dictionary type=${eth_type} destination=${eth_dst} source=${eth_src}
87 ${ipv4_match_dict}= Create Dictionary source=${ipv4_src} destination=${ipv4_dst}
88 ##flow is a python Object to build flow details, including the xml format to send to controller
89 ${flow}= Create Inventory Flow
90 Set "${flow}" "table_id" With "${table_id}"
91 Set "${flow}" "id" With "${flow_id}"
92 Set "${flow}" "priority" With "${priority}"
93 Clear Flow Actions ${flow}
94 Set Flow Output Action ${flow} 0 0 ${output_port}
95 Set Flow Ethernet Match ${flow} ${ethernet_match_dict}
96 Set Flow IPv4 Match ${flow} ${ipv4_match_dict}
97 Log Flow XML is ${flow.xml}
98 Call Method ${test_switch} create_flow_match_elements ${flow.xml}
99 Log ${test_switch.flow_validations}
100 ${dpid_id}= Get Switch Datapath ID ${test_switch}
101 Add Flow To Controller And Verify ${flow.xml} openflow:${dpid_id} ${flow.table_id} ${flow.id}
102 Validate Switch Output ${test_switch} ${test_switch.dump_all_flows} ${test_switch.flow_validations}
103 Remove Flow From Controller And Verify ${flow.xml} openflow:${dpid_id} ${flow.table_id} ${flow.id}
104 Validate Switch Output ${test_switch} ${test_switch.dump_all_flows} ${test_switch.flow_validations} false
106 OpenFlow Actions Suite Setup
107 ${test_switch}= Get Switch ${SWITCH_CLASS}
108 Set Suite Variable ${test_switch}
109 Call Method ${test_switch} set_mgmt_ip ${SWITCH_IP}
110 Call Method ${test_switch} set_controller_ip ${CONTROLLER}
111 Run Command On Remote System ${CONTROLLER} ps -elf | grep java
112 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}
113 Ping ${test_switch.mgmt_ip}
114 Initialize Switch ${test_switch}
115 Configure OpenFlow ${test_switch}
116 Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
118 OpenFlow Actions Suite Teardown
119 Cleanup Switch ${test_switch}
120 SSHLibrary.Close All Connections
121 Telnet.Close All Connections