Adjust OpenFlow system test for singleton cluster 03/44703/11
authorLuis Gomez <ecelgp@gmail.com>
Fri, 26 Aug 2016 06:05:08 +0000 (23:05 -0700)
committerLuis Gomez <ecelgp@gmail.com>
Sun, 4 Sep 2016 03:43:29 +0000 (03:43 +0000)
All cluster members are device candidates.
This applies to Li plugin in Boron and Carbon.
Avoid Controller connection bounce as this generates unstability.

Change-Id: I70bbee2d178361cfd6fc037bc2c197d45e3be13a
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
csit/libraries/OVSDB.robot
csit/suites/openflowplugin/Clustering/010__Cluster_HA_Owner_Failover.robot
csit/suites/openflowplugin/EntityOwhership/010_Switch_Disconnect.robot
csit/suites/openflowplugin/EntityOwhership/030_Cluster_Sync_Problems.robot

index 6f5286942f6660dc1615afa22f5d5ad50b473908..e15b138d48a9123da4f3e64a1031f38cc2dfa5e2 100644 (file)
@@ -116,7 +116,6 @@ Clean OVSDB Test Environment
 Set Controller In OVS Bridge
     [Arguments]    ${tools_system}    ${bridge}    ${controller_opt}
     [Documentation]    Sets controller for a given OVS ${bridge} using controller options in ${controller_opt}
-    Utils.Run Command On Mininet    ${tools_system}    sudo ovs-vsctl del-controller ${bridge}
     Utils.Run Command On Mininet    ${tools_system}    sudo ovs-vsctl set-controller ${bridge} ${controller_opt}
 
 Add Multiple Managers to OVS
index 7c22be8808fff9ed3f3867293048351836ce4ee9..15d1ff956ffd2a439d13c1ae797b9117538e0172 100644 (file)
@@ -30,10 +30,11 @@ Reconnect Extra Switches To Candidate And Check Entity Owner
     [Documentation]    Connect switches s2 and s3 to candidate instance.
     OVSDB.Set Controller In OVS Bridge    ${TOOLS_SYSTEM_IP}    s2    tcp:${ODL_SYSTEM_${original_candidate}_IP}:6633
     OVSDB.Set Controller In OVS Bridge    ${TOOLS_SYSTEM_IP}    s3    tcp:${ODL_SYSTEM_${original_candidate}_IP}:6633
-    ${owner_list}=    Create List    ${original_candidate}
-    ${owner}    ${candidate_list}    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device    openflow:2    1    ${owner_list}
+    ${member_list} =    BuiltIn.Run_Keyword_If    '${ODL_STREAM}' != 'beryllium' and '${ODL_OF_PLUGIN}' == 'lithium'    Create List    @{ClusterManagement__member_index_list}
+    ...    ELSE    Create List    ${original_candidate}
+    ${owner}    ${candidate_list}    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device    openflow:2    1    ${member_list}
     Should Be Equal    ${owner}    ${original_candidate}
-    ${owner}    ${candidate_list}    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device    openflow:3    1    ${owner_list}
+    ${owner}    ${candidate_list}    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device    openflow:3    1    ${member_list}
     Should Be Equal    ${owner}    ${original_candidate}
 
 Check Network Operational Information Before Fail
index b38ff5eccb4c7635c18e328ac70c41ac6b07ec85..c1cda099975c3c0c75f0549a77947185e2fa5b91 100644 (file)
@@ -92,7 +92,10 @@ Disconnect Switchs Old Master
     ${new_master}=    BuiltIn.Wait Until Keyword Succeeds    5x    3s    Verify New Master Controller Node    ${switch_name}    ${old_master}
     ${owner}    ${followers}=    ClusterManagement.Get Owner And Candidates For Device    openflow:${idx}    openflow    ${active_member}
     Collections.List Should Contain Value    ${old_followers}    ${owner}
-    Check Count Integrity    ${switch_name}    expected_controllers=2
+    BuiltIn.Run Keyword If    '${ODL_STREAM}' != 'beryllium' and '${ODL_OF_PLUGIN}' == 'lithium'    BuiltIn.Wait Until Keyword Succeeds    5x    3s    Check Count Integrity    ${switch_name}
+    ...    expected_controllers=3
+    ...    ELSE    BuiltIn.Wait Until Keyword Succeeds    5x    3s    Check Count Integrity    ${switch_name}
+    ...    expected_controllers=2
     BuiltIn.Should Be Equal As Strings    ${new_master}    ${ODL_SYSTEM_${owner}_IP}
     BuiltIn.Set Test Variable    ${old_owner}
     BuiltIn.Set Test Variable    ${old_followers}
@@ -117,10 +120,12 @@ Disconnect Switchs Follower
     ${old_slave}=    BuiltIn.Set Variable    ${ODL_SYSTEM_${old_follower}_IP}
     OvsManager.Disconnect Switch From Controller And Verify Disconnected    ${switch_name}    ${old_slave}
     BuiltIn.Set Test Variable    ${disc_cntl}    ${old_slave}
-    BuiltIn.Wait Until Keyword Succeeds    5x    3s    Check Count Integrity    ${switch_name}    expected_controllers=2
+    BuiltIn.Run Keyword If    '${ODL_STREAM}' != 'beryllium' and '${ODL_OF_PLUGIN}' == 'lithium'    Check Count Integrity    ${switch_name}    expected_controllers=3
+    ...    ELSE    Check Count Integrity    ${switch_name}    expected_controllers=2
     ${owner}    ${followers}=    ClusterManagement.Get Owner And Candidates For Device    openflow:${idx}    openflow    ${active_member}
     BuiltIn.Should Be Equal    ${owner}    ${old_owner}
-    Collections.List Should Not Contain Value    ${followers}    ${old_follower}
+    BuiltIn.Run Keyword If    '${ODL_STREAM}' != 'beryllium' and '${ODL_OF_PLUGIN}' == 'lithium'    Collections.Lists Should Be Equal    ${followers}    ${old_followers}
+    ...    ELSE    Collections.List Should Not Contain Value    ${followers}    ${old_follower}
     BuiltIn.Should Be Equal As Strings    ${new_master}    ${ODL_SYSTEM_${owner}_IP}
     BuiltIn.Set Test Variable    ${old_owner}
     BuiltIn.Set Test Variable    ${old_followers}
index 11f2583a4650fec5e977f808a6133430b2724e79..3843f0e9c854f476c7e7395b2a69df9004d67a55 100644 (file)
@@ -55,6 +55,8 @@ End Suite
     ClusterManagement.Flush Iptables From List Or All
     RequestsLibrary.Delete All Sessions
     Utils.Stop Suite
+    # This sleep is required to properly deregister the switch.
+    Sleep    5
 
 Are Switches Connected Topo
     [Documentation]    Checks wheather switches are connected to controller