- Move test using Start_Mininet to Start_Mininet_Single_controller.
- Once this is merged we can move test using Start_suite to
Start_Mininet and delete Start_Suite.
- Finally we can try to move Start_Mininet to
Start_Mininet_Single_controller but this change can take longer.
Change-Id: I311fa5cea75870d86b074bde751503fff7507d0e
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
[Return] ${mininet_conn_id}
Start Mininet Multiple Controllers
- [Arguments] ${mininet} ${controller_index_list}=${EMPTY} ${options}=--topo tree,1 --switch ovsk,protocols=OpenFlow13 ${custom}=${EMPTY} ${ofport}=${ODL_OF_PORT}
+ [Arguments] ${mininet}=${TOOLS_SYSTEM_IP} ${controller_index_list}=${EMPTY} ${options}=--topo tree,1 --switch ovsk,protocols=OpenFlow13 ${custom}=${EMPTY} ${ofport}=${ODL_OF_PORT}
[Documentation] Start Mininet with custom topology and connect to list of controllers in ${controller_index_list} or all if no list is provided.
${index_list} = ClusterManagement__Given_Or_Internal_Index_List given_list=${controller_index_list}
Log Clear any existing mininet
[Return] ${mininet_conn_id}
Send Mininet Command
- [Arguments] ${mininet_conn_id} ${cmd}=help
- [Documentation] Sends Command ${cmd} to Mininet session ${mininet_conn_id} and returns read buffer response.
- SSHLibrary.Switch Connection ${mininet_conn_id}
+ [Arguments] ${mininet_conn}=${EMPTY} ${cmd}=help
+ [Documentation] Sends Command ${cmd} to Mininet session ${mininet_conn} and returns read buffer response.
+ Run Keyword If """${mininet_conn}""" != "" SSHLibrary.Switch Connection ${mininet_conn}
SSHLibrary.Write ${cmd}
${output}= SSHLibrary.Read Until mininet>
[Return] ${output}
[Arguments] ${mininet_conn_list} ${cmd}=help
[Documentation] Sends Command ${cmd} to Mininet sessions in ${mininet_conn_list} and returns list of read buffer responses.
${output_list}= Create List
- : FOR ${mininet_conn_id} IN @{mininet_conn_list}
- \ ${output}= Utils.Send Mininet Command ${mininet_conn_id} ${cmd}
+ : FOR ${mininet_conn} IN @{mininet_conn_list}
+ \ ${output}= Utils.Send Mininet Command ${mininet_conn} ${cmd}
\ Append To List ${output_list} ${output}
[Return] ${output_list}
Stop Mininet And Exit
- [Arguments] ${mininet_conn_id}
- [Documentation] Stops Mininet and exits session ${mininet_conn_id}
- SSHLibrary.Switch Connection ${mininet_conn_id}
+ [Arguments] ${mininet_conn}=${EMPTY}
+ [Documentation] Stops Mininet and exits session ${mininet_conn}
+ Run Keyword If """${mininet_conn}""" != "" SSHLibrary.Switch Connection ${mininet_conn}
SSHLibrary.Write exit
SSHLibrary.Read Until ${TOOLS_SYSTEM_PROMPT}
Close Connection
Stop Mininet And Exit Multiple Sessions
[Arguments] ${mininet_conn_list}
[Documentation] Stops Mininet and exits sessions in ${mininet_conn_list}.
- : FOR ${mininet_conn_id} IN @{mininet_conn_list}
- \ MininetKeywords.Stop Mininet And Exit ${mininet_conn_id}
+ : FOR ${mininet_conn} IN @{mininet_conn_list}
+ \ MininetKeywords.Stop Mininet And Exit ${mininet_conn}
Verify Aggregate Flow From Mininet Session
- [Arguments] ${mininet_conn_id} ${flow_count} ${time_out}
+ [Arguments] ${mininet_conn}=${EMPTY} ${flow_count}=0 ${time_out}=0s
[Documentation] Verify flow count per switch
- Wait Until Keyword Succeeds ${time_out} 2s MininetKeywords.Mininet Sync Status ${mininet_conn_id} ${flow_count}
+ Wait Until Keyword Succeeds ${time_out} 2s MininetKeywords.Mininet Sync Status ${mininet_conn} ${flow_count}
Mininet Sync Status
- [Arguments] ${mininet_id} ${flow_count}
+ [Arguments] ${mininet_conn}=${EMPTY} ${flow_count}=0
[Documentation] Sync with mininet to match exact number of flows
${cmd} = Set Variable dpctl dump-aggregate -O OpenFlow13
- ${output}= MininetKeywords.Send Mininet Command ${mininet_id} ${cmd}
+ ${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}
Stop NIC VTN Rest Test Suite
[Documentation] Stop Nic VTN Renderer Test Suite
- Stop Mininet ${mininet_conn_id}
+ Stop Mininet Simulation
Fetch Intent List
[Documentation] Check if VTN Renderer feature is installed.
Library XML
Variables ../variables/Variables.py
Resource ./Utils.robot
+Resource ./MininetKeywords.robot
*** variable ***
${vlan_topo} sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --custom vlan_vtn_test.py --topo vlantopo
Start vlan_topo
[Documentation] This will start mininet with custom topology on both the Virtual Machines
Install Package On Ubuntu System vlan
- Start Mininet ${TOOLS_SYSTEM_IP} ${vlan_topo} ${CURDIR}/${CREATE_VLAN_TOPOLOGY_FILE_PATH}
+ MininetKeywords.Start Mininet Single Controller ${TOOLS_SYSTEM_IP} ${ODL_SYSTEM_IP} ${vlan_topo} ${CURDIR}/${CREATE_VLAN_TOPOLOGY_FILE_PATH}
Delete a FLOWLIST
[Arguments] ${flowlistname}
Variables ../variables/Variables.py
Resource ./Utils.robot
Resource ./KarafKeywords.robot
+Resource ./MininetKeywords.robot
Resource ./TemplatedRequests.robot
*** Variables ***
-${vlan_topo_10} sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --custom vlan_vtn_test.py --topo vlantopo
-${vlan_topo_13} sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --custom vlan_vtn_test.py --topo vlantopo --switch ovsk,protocols=OpenFlow13
+${vlan_topo_10} --custom vlan_vtn_test.py --topo vlantopo
+${vlan_topo_13} --custom vlan_vtn_test.py --topo vlantopo --switch ovsk,protocols=OpenFlow13
${VERSION_VTN} controller/nb/v2/vtn/version
${VTN_INVENTORY} restconf/operational/vtn-inventory:vtn-nodes
${DUMPFLOWS_OF10} dpctl dump-flows -OOpenFlow10
@{VLANMAP_BRIDGE2_DATAFLOW} "reason":"VLANMAPPED" "tenant-name":"Tenant1" "bridge-name":"vBridge2_vlan"
${out_before_pathpolicy} output:2
${out_after_pathpolicy} output:3
-${pathpolicy_topo_13} sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --custom topo-3sw-2host_multipath.py --topo pathpolicytopo --switch ovsk,protocols=OpenFlow13
-${pathpolicy_topo_10} sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --custom topo-3sw-2host_multipath.py --topo pathpolicytopo --switch ovsk,protocols=OpenFlow10
+${pathpolicy_topo_13} --custom topo-3sw-2host_multipath.py --topo pathpolicytopo --switch ovsk,protocols=OpenFlow13
+${pathpolicy_topo_10} --custom topo-3sw-2host_multipath.py --topo pathpolicytopo --switch ovsk,protocols=OpenFlow10
@{PATHMAP_ATTR} "index":"1" "condition":"flowcond_path" "policy":"1"
${policy_id} 1
${in_port} 1
Start PathSuiteVtnMaTest
[Documentation] Start VTN Manager Test Suite and Mininet
Start SuiteVtnMaTest
- Start Mininet ${TOOLS_SYSTEM_IP} ${pathpolicy_topo_13} ${custom}
+ MininetKeywords.Start Mininet Single Controller ${TOOLS_SYSTEM_IP} ${ODL_SYSTEM_IP} ${pathpolicy_topo_13} ${custom}
Start PathSuiteVtnMaTestOF10
[Documentation] Start VTN Manager Test Suite and Mininet in Open Flow 10 Specification
Start SuiteVtnMaTest
- Start Mininet ${TOOLS_SYSTEM_IP} ${pathpolicy_topo_10} ${custom}
+ MininetKeywords.Start Mininet Single Controller ${TOOLS_SYSTEM_IP} ${ODL_SYSTEM_IP} ${pathpolicy_topo_10} ${custom}
Stop PathSuiteVtnMaTest
[Documentation] Cleanup/Shutdown work at the completion of all tests.
Delete All Sessions
- Stop Mininet ${mininet_conn_id}
+ MininetKeywords.Stop Mininet And Exit
DataFlowsForBridge
[Arguments] ${resp} @{BRIDGE_DATAFLOW}
[Arguments] ${OF}
[Documentation] Create custom topology for vlan functionality
Install Package On Ubuntu System vlan
- Run Keyword If '${OF}' == 'OF13' Start Mininet ${TOOLS_SYSTEM_IP} ${vlan_topo_13} ${CURDIR}/${CREATE_VLAN_TOPOLOGY_FILE_PATH}
- ... ELSE IF '${OF}' == 'OF10' Start Mininet ${TOOLS_SYSTEM_IP} ${vlan_topo_10} ${CURDIR}/${CREATE_VLAN_TOPOLOGY_FILE_PATH}
+ Run Keyword If '${OF}' == 'OF13' MininetKeywords.Start Mininet Single Controller ${TOOLS_SYSTEM_IP} ${ODL_SYSTEM_IP} ${vlan_topo_13} ${CURDIR}/${CREATE_VLAN_TOPOLOGY_FILE_PATH}
+ ... ELSE IF '${OF}' == 'OF10' MininetKeywords.Start Mininet Single Controller ${TOOLS_SYSTEM_IP} ${ODL_SYSTEM_IP} ${vlan_topo_10}
+ ... ${CURDIR}/${CREATE_VLAN_TOPOLOGY_FILE_PATH}
Get flow
[Arguments] ${vtn_name}
Library ../../../libraries/Common.py
Variables ../../../variables/Variables.py
Resource ../../../libraries/Utils.robot
+Resource ../../../libraries/MininetKeywords.robot
Resource ../../../libraries/OVSDB.robot
*** Variables ***
${OVSDB_PORT} 6634
${OVSDB_CONFIG_DIR} ${CURDIR}/../../../variables/ovsdb
@{node_list1} ovsdb://${TOOLS_SYSTEM_2_IP}:${OVSDB_PORT} ${TOOLS_SYSTEM_2_IP} ${OVSDB_PORT} ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT} ${TOOLS_SYSTEM_IP} ${OVSDB_PORT}
-${start1} sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --switch=ovsk,protocols=OpenFlow13 --custom ovsdb.py --topo host,1
-${start2} sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --switch=ovsk,protocols=OpenFlow13 --custom ovsdb.py --topo host,2
+${start1} --switch=ovsk,protocols=OpenFlow13 --custom ovsdb.py --topo host,1
+${start2} --switch=ovsk,protocols=OpenFlow13 --custom ovsdb.py --topo host,2
*** Test Cases ***
Make the OVS instance to listen for connection
Start the Mininet and create custom topology
[Documentation] This will start mininet with custom topology on both the Virtual Machines
- ${conn_id1} Start Mininet ${TOOLS_SYSTEM_2_IP} ${start1} ${OVSDB_CONFIG_DIR}/ovsdb.py
+ ${conn_id1} MininetKeywords.Start Mininet Single Controller ${TOOLS_SYSTEM_2_IP} ${ODL_SYSTEM_IP} ${start1} ${OVSDB_CONFIG_DIR}/ovsdb.py
Set Global Variable ${conn_id1}
- ${conn_id2} Start Mininet ${TOOLS_SYSTEM_IP} ${start2} ${OVSDB_CONFIG_DIR}/ovsdb.py
+ ${conn_id2} MininetKeywords.Start Mininet Single Controller ${TOOLS_SYSTEM_IP} ${ODL_SYSTEM_IP} ${start2} ${OVSDB_CONFIG_DIR}/ovsdb.py
Set Global Variable ${conn_id2}
Get Operational Topology with custom topology