@{lines} Split To Lines ${output}
${match_result} Set Variable
${action_result} Set Variable
- : FOR ${line} IN @{lines}
- \ ${match} Get Matches Part ${line}
- \ ${action} Get Actions Part ${line}
- \ ${match_result} Check Match ${match} @{flow_match_criteria}
- \ ${action_result} Check Match ${action} @{flow_action_criteria}
- \ Run Keyword If "${match_result}" == "TRUE" and "${action_result}" == "TRUE" Return From Keyword ${line}
+ FOR ${line} IN @{lines}
+ ${match} Get Matches Part ${line}
+ ${action} Get Actions Part ${line}
+ ${match_result} Check Match ${match} @{flow_match_criteria}
+ ${action_result} Check Match ${action} @{flow_action_criteria}
+ Run Keyword If "${match_result}" == "TRUE" and "${action_result}" == "TRUE" Return From Keyword ${line}
+ END
Log ${flow_match_criteria}
Log ${flow_action_criteria}
Fail Flow not found!
[Arguments] ${string} @{match_criteria}
[Documentation] Applies 'grep' on the string argument for each criterion.
${conditions} Set Variable
- : FOR ${criterio} IN @{match_criteria}
- \ ${grep_criterio} Catenate | grep ${criterio}
- \ ${conditions} Catenate ${conditions} ${grep_criterio}
- \ ${debug_output} OperatingSystem.Run echo "${string}" ${conditions}
- \ Log ${debug_output}
- \ Run Keyword If "${debug_output}" == "${EMPTY}" Log ${criterio}
+ FOR ${criterio} IN @{match_criteria}
+ ${grep_criterio} Catenate | grep ${criterio}
+ ${conditions} Catenate ${conditions} ${grep_criterio}
+ ${debug_output} OperatingSystem.Run echo "${string}" ${conditions}
+ Log ${debug_output}
+ Run Keyword If "${debug_output}" == "${EMPTY}" Log ${criterio}
+ END
${output} OperatingSystem.Run echo "${string}" ${conditions}
Log ${output}
Run Keyword If "${output}" == "${EMPTY}" Return From Keyword FALSE
Wait Until Keyword Succeeds 120s 20s Count Flows On Switch ${switch_name}
SSHLibrary.Close Connection
+Show Switch Status
+ [Arguments] ${switch_name}
+ [Documentation] Shows status of a switch for easier debugging.
+ ${stdout} ${stderr} SSHLibrary.Execute Command sudo ovs-ofctl dump-flows ${switch_name} -OOpenFlow13 return_stderr=True
+ Log ${stdout}
+ ${stdout} ${stderr} SSHLibrary.Execute Command sudo ovs-vsctl show return_stderr=True
+ Log ${stdout}
+
Count Flows On Switch
[Arguments] ${switch_name}
${out} SSHLibrary.Execute Command printf "%d" $(($(sudo ovs-ofctl dump-flows ${switch_name} -OOpenFlow13 | wc -l)-1))