+ [Arguments] ${mininet_conn_list}
+ FOR ${mininet_conn} IN @{mininet_conn_list}
+ MininetKeywords.Stop Mininet And Exit ${mininet_conn}
+ END
+
+Disconnect Cluster Mininet
+ [Documentation] Break and restore controller to mininet connection via iptables.
+ [Arguments] ${action}=break ${member_index_list}=${EMPTY}
+ ${index_list}= ClusterManagement.List_Indices_Or_All given_list=${member_index_list}
+ FOR ${index} IN @{index_list}
+ ${rule}= BuiltIn.Set Variable
+ ... OUTPUT -p all --source ${ODL_SYSTEM_${index}_IP} --destination ${TOOLS_SYSTEM_IP} -j DROP
+ ${command}= BuiltIn.Set Variable If
+ ... '${action}'=='restore'
+ ... sudo /sbin/iptables -D ${rule}
+ ... sudo /sbin/iptables -I ${rule}
+ Log To Console ${ODL_SYSTEM_${index}_IP}
+ Utils.Run Command On Controller ${ODL_SYSTEM_${index}_IP} cmd=${command}
+ ${command}= BuiltIn.Set Variable sudo /sbin/iptables -L -n
+ ${output}= Utils.Run Command On Controller cmd=${command}
+ BuiltIn.Log ${output}
+ END
+
+Verify Aggregate Flow From Mininet Session
+ [Documentation] Verify flow count per switch
+ [Arguments] ${mininet_conn}=${EMPTY} ${flow_count}=0 ${time_out}=0s
+ Wait Until Keyword Succeeds
+ ... ${time_out}
+ ... 2s
+ ... MininetKeywords.Check Flows In Mininet
+ ... ${mininet_conn}
+ ... ${flow_count}
+
+Check Flows In Mininet
+ [Documentation] Sync with mininet to match exact number of flows
+ [Arguments] ${mininet_conn}=${EMPTY} ${flow_count}=0
+ IF """${mininet_conn}""" != ""
+ SSHLibrary.Switch Connection ${mininet_conn}
+ END
+ ${cmd}= Set Variable dpctl dump-aggregate -O OpenFlow13
+ ${output}= MininetKeywords.Send Mininet Command ${mininet_conn} ${cmd}
+ ${flows}= String.Get RegExp Matches ${output} (?<=flow_count\=).*?(?=\r)
+ ${total_flows}= BuiltIn.Evaluate sum(map(int, ${flows}))
+ Should Be Equal As Numbers ${total_flows} ${flow_count}
+
+Verify Mininet Ping
+ [Documentation] Send ping from mininet and verify connectivity.
+ [Arguments] ${host1} ${host2}
+ SSHLibrary.Write ${host1} ping -w 3 ${host2}
+ ${result}= SSHLibrary.Read Until mininet>
+ Should Contain ${result} 64 bytes
+
+Verify Mininet No Ping
+ [Documentation] Send ping from mininet and verify no conectivity.
+ [Arguments] ${host1} ${host2}
+ SSHLibrary.Write ${host1} ping -w 3 ${host2}
+ ${result}= SSHLibrary.Read Until mininet>
+ Should Contain ${result} 100% packet loss
+
+Ping All Hosts
+ [Documentation] Do one round of ping from one host to all other hosts in mininet.
+ ... Note that a single ping failure will exit the loop and return a non zero value.
+ [Arguments] @{host_list}
+ ${source}= Get From List ${host_list} ${0}
+ FOR ${h} IN @{host_list}
+ ${status}= Ping Two Hosts ${source} ${h} 1
+ IF ${status}!=${0} BREAK
+ END
+ RETURN ${status}
+
+Ping Two Hosts
+ [Documentation] Ping between mininet hosts. Must be used only after a mininet session is in place.
+ ... Returns non zero value if there is 100% packet loss.
+ [Arguments] ${host1} ${host2} ${pingcount}=2
+ SSHLibrary.Write ${host1} ping -c ${pingcount} ${host2}
+ ${out}= SSHLibrary.Read Until mininet>
+ ${ret}= String.Get Lines Matching Regexp ${out} .*100% packet loss.*
+ ${len}= Get Length ${ret}
+ RETURN ${len}
+
+Get Mininet Hosts
+ [Documentation] Get all the hosts from mininet
+ ${host_list}= Create List
+ SSHLibrary.Write nodes
+ ${out}= SSHLibrary.Read Until mininet>
+ @{words}= String.Split String ${out} ${SPACE}
+ FOR ${item} IN @{words}
+ ${h}= String.Get Lines Matching Regexp ${item} h[0-9]*
+ IF '${h}' != '${EMPTY}'
+ Collections.Append To List ${host_list} ${h}
+ END
+ END
+ RETURN ${host_list}
+
+Install Certificates In Mininet
+ [Documentation] Copy and install certificates in simulator.
+ Comment Copy Certificates
+ SSHLibrary.Put File ${CURDIR}/tls/${switch_private_key} .
+ SSHLibrary.Put File ${CURDIR}/tls/${switch_certificate} .
+ SSHLibrary.Put File ${CURDIR}/tls/${controller_ca_list} .
+ Comment Install Certificates
+ SSHLibrary.Execute Command
+ ... sudo mv ${switch_private_key} /etc/openvswitch && sudo mv ${switch_certificate} /etc/openvswitch && sudo mv ${controller_ca_list} /etc/openvswitch
+ SSHLibrary.Execute Command
+ ... sudo ovs-vsctl set-ssl /etc/openvswitch/${switch_private_key} /etc/openvswitch/${switch_certificate} /etc/openvswitch/${controller_ca_list}
+ ${std_out}= SSHLibrary.Execute Command sudo ovs-vsctl get-ssl
+ Log ${std_out}