- ${flow_data}= Element To String ${flow_root}
- Log ${flow_data}
- Add Flow To Controller And Verify ${flow_data} ${table_id} ${flow_id}
+ @{OVS_FLOWELEMENTS} Create List dl_dst=${eth_dst} table=${table_id} dl_src=${eth_src} nw_src=${ipv4_src} nw_dst=${ipv4_dst}
+ ... ${additional_ovs_flowelements}
+ ##The dictionaries here will be used to populate the match and action elements of the flow mod
+ ${ethernet_match_dict}= Create Dictionary type=${eth_type} destination=${eth_dst} source=${eth_src}
+ ${ipv4_match_dict}= Create Dictionary source=${ipv4_src} destination=${ipv4_dst}
+ ##flow is a python Object to build flow details, including the xml format to send to controller
+ ${flow}= Create Flow
+ Set "${flow}" "table_id" With "${table_id}"
+ Set "${flow}" "id" With "${flow_id}"
+ Clear Flow Actions ${flow}
+ Set Flow Action ${flow} 0 0 ${flow_action}
+ Set Flow Ethernet Match ${flow} ${ethernet_match_dict}
+ Set Flow IPv4 Match ${flow} ${ipv4_match_dict}
+ ##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)
+ Run Keyword If "set" in "${flow_action}" Add Flow XML Element ${flow} ${action_key} ${action_value} instructions/instruction/apply-actions/action/${flow_action}
+ Log Flow XML is ${flow.xml}
+ Add Flow To Controller And Verify ${flow.xml} ${flow.table_id} ${flow.id}