From d3c16ed0c027021f767ecd0572f9fd3689f62311 Mon Sep 17 00:00:00 2001 From: Luis Gomez Date: Thu, 13 Oct 2016 18:37:49 -0700 Subject: [PATCH] Address Start_Suite KW 1 - 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 --- csit/libraries/MininetKeywords.robot | 30 +++++++++---------- csit/libraries/NicKeywords.robot | 2 +- csit/libraries/VtnCoKeywords.robot | 3 +- csit/libraries/VtnMaKeywords.robot | 20 +++++++------ .../040__Vxlan_Extension_Test.robot | 9 +++--- 5 files changed, 34 insertions(+), 30 deletions(-) diff --git a/csit/libraries/MininetKeywords.robot b/csit/libraries/MininetKeywords.robot index 6a7422e09e..e4f8b9b5e1 100644 --- a/csit/libraries/MininetKeywords.robot +++ b/csit/libraries/MininetKeywords.robot @@ -24,7 +24,7 @@ Start Mininet Single Controller [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 @@ -54,9 +54,9 @@ Start Mininet Multiple Controllers [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} @@ -65,15 +65,15 @@ Send Mininet Command Multiple Sessions [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 @@ -81,19 +81,19 @@ Stop Mininet And Exit 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} diff --git a/csit/libraries/NicKeywords.robot b/csit/libraries/NicKeywords.robot index e934f8031e..bc09383b20 100644 --- a/csit/libraries/NicKeywords.robot +++ b/csit/libraries/NicKeywords.robot @@ -34,7 +34,7 @@ Start NIC VTN Rest Test Suite 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. diff --git a/csit/libraries/VtnCoKeywords.robot b/csit/libraries/VtnCoKeywords.robot index 937122d8b6..dbbcaed476 100644 --- a/csit/libraries/VtnCoKeywords.robot +++ b/csit/libraries/VtnCoKeywords.robot @@ -9,6 +9,7 @@ Library Collections 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 @@ -269,7 +270,7 @@ Create VLANMAP in VBRIDGE 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} diff --git a/csit/libraries/VtnMaKeywords.robot b/csit/libraries/VtnMaKeywords.robot index 83241135bb..0cb1511844 100644 --- a/csit/libraries/VtnMaKeywords.robot +++ b/csit/libraries/VtnMaKeywords.robot @@ -8,11 +8,12 @@ Library RequestsLibrary 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 @@ -35,8 +36,8 @@ ${vlanmap_bridge2} 300 @{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 @@ -154,17 +155,17 @@ Verify Data Flows 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} @@ -251,8 +252,9 @@ Start vlan_topo [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} diff --git a/csit/suites/ovsdb/Southbound_Domain/040__Vxlan_Extension_Test.robot b/csit/suites/ovsdb/Southbound_Domain/040__Vxlan_Extension_Test.robot index df227587a4..4ac30dba35 100644 --- a/csit/suites/ovsdb/Southbound_Domain/040__Vxlan_Extension_Test.robot +++ b/csit/suites/ovsdb/Southbound_Domain/040__Vxlan_Extension_Test.robot @@ -12,14 +12,15 @@ Library RequestsLibrary 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 @@ -42,9 +43,9 @@ Get Operational Topology from OVSDB Node1 and OVSDB Node2 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 -- 2.36.6