From 3a3597aa67f26e589e998a9cfa56d9998307cba4 Mon Sep 17 00:00:00 2001 From: Tomas Markovic Date: Tue, 19 Jun 2018 07:13:36 +0200 Subject: [PATCH] Add bgp isolation clustering test Now that we are going to look at clustering tests with more focus, we want even this one to work, so adding it back to releng. Change-Id: I1c6603783cc236c7e2d309cfd30b3b4ba3e89fa8 Signed-off-by: Tomas Markovic --- ...robot => 040_bgp_ha_karaf_isolation.robot} | 26 ++++++++++--------- .../040_bgp_ha_karaf_restart.robot | 23 ++++++++-------- ...stop.robot => 040_bgp_ha_karaf_stop.robot} | 23 ++++++++-------- ...t.robot => 050_bmp_ha_karaf_restart.robot} | 0 ...stop.robot => 050_bmp_ha_karaf_stop.robot} | 0 ....robot => 060_pcep_ha_karaf_restart.robot} | 0 ...top.robot => 060_pcep_ha_karaf_stop.robot} | 0 csit/testplans/bgpcep-bgpclustering-ha.txt | 11 ++++---- 8 files changed, 44 insertions(+), 39 deletions(-) rename csit/suites/bgpcep/bgpclustering/{bgp_ha_karaf_isolation.robot => 040_bgp_ha_karaf_isolation.robot} (87%) rename csit/suites/bgpcep/bgpclustering/{050_bgp_ha_karaf_stop.robot => 040_bgp_ha_karaf_stop.robot} (90%) rename csit/suites/bgpcep/bgpclustering/{060_bmp_ha_karaf_restart.robot => 050_bmp_ha_karaf_restart.robot} (100%) rename csit/suites/bgpcep/bgpclustering/{070_bmp_ha_karaf_stop.robot => 050_bmp_ha_karaf_stop.robot} (100%) rename csit/suites/bgpcep/bgpclustering/{080_pcep_ha_karaf_restart.robot => 060_pcep_ha_karaf_restart.robot} (100%) rename csit/suites/bgpcep/bgpclustering/{090_pcep_ha_karaf_stop.robot => 060_pcep_ha_karaf_stop.robot} (100%) diff --git a/csit/suites/bgpcep/bgpclustering/bgp_ha_karaf_isolation.robot b/csit/suites/bgpcep/bgpclustering/040_bgp_ha_karaf_isolation.robot similarity index 87% rename from csit/suites/bgpcep/bgpclustering/bgp_ha_karaf_isolation.robot rename to csit/suites/bgpcep/bgpclustering/040_bgp_ha_karaf_isolation.robot index ef237deb38..3420a49f75 100644 --- a/csit/suites/bgpcep/bgpclustering/bgp_ha_karaf_isolation.robot +++ b/csit/suites/bgpcep/bgpclustering/040_bgp_ha_karaf_isolation.robot @@ -10,8 +10,9 @@ Documentation BGP functional HA testing with one exabgp peer. ... This suite uses exabgp. It is configured to have 3 peers (all 3 nodes of odl). ... Bgp implemented with singleton accepts only one incomming conection. Exabgp ... logs will show that one peer will be connected and two will fail. -... After killing karaf which owned connection new owner should be elected and +... After isolating karaf which owned connection, new owner should be elected and ... this new owner should accept incomming bgp connection. +... TODO: Add similar keywords from all bgpclustering-ha tests into same libraries Suite Setup Setup_Everything Suite Teardown Teardown_Everything Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing @@ -37,12 +38,12 @@ ${RIB_INSTANCE} example-bgp-rib *** Test Cases *** Get_Example_Bgp_Rib_Owner [Documentation] Find an odl node which is able to accept incomming connection. - ${rib_owner} ${rib_candidates}= BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ClusterManagement.Get_Owner_And_Successors_For_Device example-bgp-rib - ... org.opendaylight.mdsal.ServiceEntityType 1 + ${rib_owner} ${rib_candidates}= BuiltIn.Wait_Until_Keyword_Succeeds 5x 5s ClusterManagement.Get_Owner_And_Successors_For_Device example-bgp-rib + ... Bgpcep 1 BuiltIn.Set Suite variable ${rib_owner} BuiltIn.Log ${ODL_SYSTEM_${rib_owner}_IP} BuiltIn.Set Suite variable ${rib_candidates} - ${session}= Resolve_Http_Session_For_Member member_index=${rib_owner} + ${session}= ClusterManagement.Resolve_Http_Session_For_Member member_index=${rib_owner} BuiltIn.Set_Suite_Variable ${living_session} ${session} BuiltIn.Set_Suite_Variable ${living_node} ${rib_owner} @@ -56,11 +57,11 @@ Reconfigure_ODL_To_Accept_Connection Start_ExaBgp_Peer [Documentation] Starts exabgp SSHKeywords.Virtual_Env_Activate_On_Current_Session log_output=${True} - BGPcliKeywords.Start_Console_Tool ${EXA_CMD} ${DEFAULT_EXA_CFG} + BGPcliKeywords.Start_Console_Tool ${EXA_CMD} ${DEFAULT_EXA_CFG} > exa_ha_isolation.log 2>&1 Verify_ExaBgp_Connected [Documentation] Verifies exabgp's presence in operational ds. - BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ExaBgpLib.Verify_ExaBgps_Connection ${living_session} + BuiltIn.Wait_Until_Keyword_Succeeds 5x 5s ExaBgpLib.Verify_ExaBgps_Connection ${living_session} Isolate_Current_Owner_Member [Documentation] Isolating cluster node which is connected with exabgp. @@ -74,11 +75,11 @@ Isolate_Current_Owner_Member Verify_New_Rib_Owner [Documentation] Verifies if new owner of example-bgp-rib is elected. - BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s Verify_New_Rib_Owner_Elected ${old_rib_owner} ${living_node} + BuiltIn.Wait_Until_Keyword_Succeeds 5x 5s Verify_New_Rib_Owner_Elected ${old_rib_owner} ${living_node} Verify_ExaBgp_Reconnected [Documentation] Verifies exabgp's presence in operational ds. - BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ExaBgpLib.Verify_ExaBgps_Connection ${living_session} + BuiltIn.Wait_Until_Keyword_Succeeds 5x 5s ExaBgpLib.Verify_ExaBgps_Connection ${living_session} Rejoin_Isolated_Member [Documentation] Rejoin isolated node @@ -90,11 +91,12 @@ Verify_New_Candidate Verify_ExaBgp_Still_Connected [Documentation] Verifies exabgp's presence in operational ds - BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ExaBgpLib.Verify_ExaBgps_Connection ${living_session} + BuiltIn.Wait_Until_Keyword_Succeeds 5x 5s ExaBgpLib.Verify_ExaBgps_Connection ${living_session} Stop_ExaBgp_Peer - [Documentation] Stops exabgp + [Documentation] Stops exabgp tool by sending ctrl+c BGPcliKeywords.Stop_Console_Tool_And_Wait_Until_Prompt + BGPcliKeywords.Store_File_To_Workspace exa_ha_isolation.log exa_ha_isolation.log SSHKeywords.Virtual_Env_Deactivate_On_Current_Session log_output=${True} Delete_Bgp_Peer_Configuration @@ -123,11 +125,11 @@ Teardown_Everything Verify_New_Rib_Owner_Elected [Arguments] ${old_owner} ${node_to_ask} [Documentation] Verifies new owner was elected - ${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device example-bgp-rib org.opendaylight.mdsal.ServiceEntityType ${node_to_ask} + ${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device example-bgp-rib Bgpcep ${node_to_ask} BuiltIn.Should_Not_Be_Equal ${old_owner} ${owner} Verify_New_Rib_Candidate_Present [Arguments] ${candidate} ${node_to_ask} [Documentation] Verifies candidate's presence. - ${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device example-bgp-rib org.opendaylight.mdsal.ServiceEntityType ${node_to_ask} + ${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device example-bgp-rib Bgpcep ${node_to_ask} BuiltIn.Should_Contain ${candidates} ${candidate} diff --git a/csit/suites/bgpcep/bgpclustering/040_bgp_ha_karaf_restart.robot b/csit/suites/bgpcep/bgpclustering/040_bgp_ha_karaf_restart.robot index 02179cdb36..a4b71322be 100644 --- a/csit/suites/bgpcep/bgpclustering/040_bgp_ha_karaf_restart.robot +++ b/csit/suites/bgpcep/bgpclustering/040_bgp_ha_karaf_restart.robot @@ -38,8 +38,8 @@ ${RIB_INSTANCE} example-bgp-rib *** Test Cases *** Get_Example_Bgp_Rib_Owner [Documentation] Find an odl node which is able to accept incomming connection. - ${rib_owner} ${rib_candidates}= BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ClusterManagement.Get_Owner_And_Successors_For_Device example-bgp-rib - ... org.opendaylight.mdsal.ServiceEntityType 1 + ${rib_owner} ${rib_candidates}= BuiltIn.Wait_Until_Keyword_Succeeds 5x 5s ClusterManagement.Get_Owner_And_Successors_For_Device example-bgp-rib + ... Bgpcep 1 BuiltIn.Set Suite variable ${rib_owner} BuiltIn.Log ${ODL_SYSTEM_${rib_owner}_IP} BuiltIn.Set Suite variable ${rib_candidates} @@ -57,15 +57,15 @@ Reconfigure_ODL_To_Accept_Connection Start_ExaBgp_Peer [Documentation] Starts exabgp SSHKeywords.Virtual_Env_Activate_On_Current_Session log_output=${True} - BGPcliKeywords.Start_Console_Tool ${EXA_CMD} ${DEFAULT_EXA_CFG} + BGPcliKeywords.Start_Console_Tool ${EXA_CMD} ${DEFAULT_EXA_CFG} > exa_ha_restart.log 2>&1 Verify ExaBgp Connected [Documentation] Verifies exabgp's presence in operational ds. - BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ExaBgpLib.Verify_ExaBgps_Connection ${living_session} + BuiltIn.Wait_Until_Keyword_Succeeds 5x 5s ExaBgpLib.Verify_ExaBgps_Connection ${living_session} Kill_Current_Owner_Member [Documentation] Killing karaf which is connected with exabgp. - Kill_Single_Member ${rib_owner} + ClusterManagement.Kill_Single_Member ${rib_owner} BuiltIn.Set Suite variable ${old_rib_owner} ${rib_owner} BuiltIn.Set Suite variable ${old_rib_candidates} ${rib_candidates} ${idx}= Collections.Get From List ${old_rib_candidates} 0 @@ -75,15 +75,15 @@ Kill_Current_Owner_Member Verify_New_Rib_Owner [Documentation] Verifies if new owner of example-bgp-rib is elected. - BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s Verify_New_Rib_Owner_Elected ${old_rib_owner} ${living_node} + BuiltIn.Wait_Until_Keyword_Succeeds 5x 5s Verify_New_Rib_Owner_Elected ${old_rib_owner} ${living_node} Verify_ExaBgp_Reconnected [Documentation] Verifies exabgp's presence in operational ds. - BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ExaBgpLib.Verify_ExaBgps_Connection ${living_session} + BuiltIn.Wait_Until_Keyword_Succeeds 5x 5s ExaBgpLib.Verify_ExaBgps_Connection ${living_session} Start_Stopped_Member [Documentation] Starting stopped node - Start_Single_Member ${old_rib_owner} + ClusterManagement.Start_Single_Member ${old_rib_owner} Verify_New_Candidate [Documentation] Verifies started node become candidate for example-bgp-rib @@ -91,11 +91,12 @@ Verify_New_Candidate Verify_ExaBgp_Still_Connected [Documentation] Verifies exabgp's presence in operational ds - BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ExaBgpLib.Verify_ExaBgps_Connection ${living_session} + BuiltIn.Wait_Until_Keyword_Succeeds 5x 5s ExaBgpLib.Verify_ExaBgps_Connection ${living_session} Stop_ExaBgp_Peer [Documentation] Stops exabgp tool by sending ctrl+c BGPcliKeywords.Stop_Console_Tool_And_Wait_Until_Prompt + BGPcliKeywords.Store_File_To_Workspace exa_ha_restart.log exa_ha_restart.log SSHKeywords.Virtual_Env_Deactivate_On_Current_Session log_output=${True} Delete_Bgp_Peer_Configuration @@ -124,11 +125,11 @@ Teardown_Everything Verify_New_Rib_Owner_Elected [Arguments] ${old_owner} ${node_to_ask} [Documentation] Verifies new owner was elected - ${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device example-bgp-rib org.opendaylight.mdsal.ServiceEntityType ${node_to_ask} + ${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device example-bgp-rib Bgpcep ${node_to_ask} BuiltIn.Should_Not_Be_Equal ${old_owner} ${owner} Verify_New_Rib_Candidate_Present [Arguments] ${candidate} ${node_to_ask} [Documentation] Verifies candidate's presence. - ${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device example-bgp-rib org.opendaylight.mdsal.ServiceEntityType ${node_to_ask} + ${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device example-bgp-rib Bgpcep ${node_to_ask} BuiltIn.Should_Contain ${candidates} ${candidate} diff --git a/csit/suites/bgpcep/bgpclustering/050_bgp_ha_karaf_stop.robot b/csit/suites/bgpcep/bgpclustering/040_bgp_ha_karaf_stop.robot similarity index 90% rename from csit/suites/bgpcep/bgpclustering/050_bgp_ha_karaf_stop.robot rename to csit/suites/bgpcep/bgpclustering/040_bgp_ha_karaf_stop.robot index baed02faf4..1e12ad3538 100644 --- a/csit/suites/bgpcep/bgpclustering/050_bgp_ha_karaf_stop.robot +++ b/csit/suites/bgpcep/bgpclustering/040_bgp_ha_karaf_stop.robot @@ -38,8 +38,8 @@ ${RIB_INSTANCE} example-bgp-rib *** Test Cases *** Get_Example_Bgp_Rib_Owner [Documentation] Find an odl node which is able to accept incomming connection. - ${rib_owner} ${rib_candidates}= BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ClusterManagement.Get_Owner_And_Successors_For_Device example-bgp-rib - ... org.opendaylight.mdsal.ServiceEntityType 1 + ${rib_owner} ${rib_candidates}= BuiltIn.Wait_Until_Keyword_Succeeds 5x 5s ClusterManagement.Get_Owner_And_Successors_For_Device example-bgp-rib + ... Bgpcep 1 BuiltIn.Set Suite variable ${rib_owner} BuiltIn.Log ${ODL_SYSTEM_${rib_owner}_IP} BuiltIn.Set Suite variable ${rib_candidates} @@ -57,15 +57,15 @@ Reconfigure_ODL_To_Accept_Connection Start_ExaBgp_Peer [Documentation] Starts exabgp SSHKeywords.Virtual_Env_Activate_On_Current_Session log_output=${True} - BGPcliKeywords.Start_Console_Tool ${EXA_CMD} ${DEFAULT_EXA_CFG} + BGPcliKeywords.Start_Console_Tool ${EXA_CMD} ${DEFAULT_EXA_CFG} > exa_ha_stop.log 2>&1 Verify_ExaBgp_Connected [Documentation] Verifies exabgp's presence in operational ds. - BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ExaBgpLib.Verify_ExaBgps_Connection ${living_session} + BuiltIn.Wait_Until_Keyword_Succeeds 5x 5s ExaBgpLib.Verify_ExaBgps_Connection ${living_session} Stop_Current_Owner_Member [Documentation] Stopping karaf which is connected with exabgp. - Kill_Single_Member ${rib_owner} + ClusterManagement.Kill_Single_Member ${rib_owner} BuiltIn.Set Suite variable ${old_rib_owner} ${rib_owner} BuiltIn.Set Suite variable ${old_rib_candidates} ${rib_candidates} ${idx}= Collections.Get From List ${old_rib_candidates} 0 @@ -75,15 +75,15 @@ Stop_Current_Owner_Member Verify_New_Rib_Owner [Documentation] Verifies if new owner of example-bgp-rib is elected. - BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s Verify_New_Rib_Owner_Elected ${old_rib_owner} ${living_node} + BuiltIn.Wait_Until_Keyword_Succeeds 5x 5s Verify_New_Rib_Owner_Elected ${old_rib_owner} ${living_node} Verify_ExaBgp_Reconnected [Documentation] Verifies exabgp's presence in operational ds. - BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ExaBgpLib.Verify_ExaBgps_Connection ${living_session} + BuiltIn.Wait_Until_Keyword_Succeeds 5x 5s ExaBgpLib.Verify_ExaBgps_Connection ${living_session} Start_Stopped_Member [Documentation] Starting stopped node - Start_Single_Member ${old_rib_owner} + ClusterManagement.Start_Single_Member ${old_rib_owner} Verify_New_Candidate [Documentation] Verifies started node become candidate for example-bgp-rib @@ -91,11 +91,12 @@ Verify_New_Candidate Verify_ExaBgp_Still_Connected [Documentation] Verifies exabgp's presence in operational ds - BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ExaBgpLib.Verify_ExaBgps_Connection ${living_session} + BuiltIn.Wait_Until_Keyword_Succeeds 5x 5s ExaBgpLib.Verify_ExaBgps_Connection ${living_session} Stop_ExaBgp_Peer [Documentation] Stops exabgp tool by sending ctrl+c BGPcliKeywords.Stop_Console_Tool_And_Wait_Until_Prompt + BGPcliKeywords.Store_File_To_Workspace exa_ha_stop.log exa_ha_stop.log SSHKeywords.Virtual_Env_Deactivate_On_Current_Session log_output=${True} Delete_Bgp_Peer_Configuration @@ -124,11 +125,11 @@ Teardown_Everything Verify_New_Rib_Owner_Elected [Arguments] ${old_owner} ${node_to_ask} [Documentation] Verifies new owner was elected - ${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device example-bgp-rib org.opendaylight.mdsal.ServiceEntityType ${node_to_ask} + ${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device example-bgp-rib Bgpcep ${node_to_ask} BuiltIn.Should_Not_Be_Equal ${old_owner} ${owner} Verify_New_Rib_Candidate_Present [Arguments] ${candidate} ${node_to_ask} [Documentation] Verifies candidate's presence. - ${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device example-bgp-rib org.opendaylight.mdsal.ServiceEntityType ${node_to_ask} + ${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device example-bgp-rib Bgpcep ${node_to_ask} BuiltIn.Should_Contain ${candidates} ${candidate} diff --git a/csit/suites/bgpcep/bgpclustering/060_bmp_ha_karaf_restart.robot b/csit/suites/bgpcep/bgpclustering/050_bmp_ha_karaf_restart.robot similarity index 100% rename from csit/suites/bgpcep/bgpclustering/060_bmp_ha_karaf_restart.robot rename to csit/suites/bgpcep/bgpclustering/050_bmp_ha_karaf_restart.robot diff --git a/csit/suites/bgpcep/bgpclustering/070_bmp_ha_karaf_stop.robot b/csit/suites/bgpcep/bgpclustering/050_bmp_ha_karaf_stop.robot similarity index 100% rename from csit/suites/bgpcep/bgpclustering/070_bmp_ha_karaf_stop.robot rename to csit/suites/bgpcep/bgpclustering/050_bmp_ha_karaf_stop.robot diff --git a/csit/suites/bgpcep/bgpclustering/080_pcep_ha_karaf_restart.robot b/csit/suites/bgpcep/bgpclustering/060_pcep_ha_karaf_restart.robot similarity index 100% rename from csit/suites/bgpcep/bgpclustering/080_pcep_ha_karaf_restart.robot rename to csit/suites/bgpcep/bgpclustering/060_pcep_ha_karaf_restart.robot diff --git a/csit/suites/bgpcep/bgpclustering/090_pcep_ha_karaf_stop.robot b/csit/suites/bgpcep/bgpclustering/060_pcep_ha_karaf_stop.robot similarity index 100% rename from csit/suites/bgpcep/bgpclustering/090_pcep_ha_karaf_stop.robot rename to csit/suites/bgpcep/bgpclustering/060_pcep_ha_karaf_stop.robot diff --git a/csit/testplans/bgpcep-bgpclustering-ha.txt b/csit/testplans/bgpcep-bgpclustering-ha.txt index 520a099559..f95e1c6c54 100644 --- a/csit/testplans/bgpcep-bgpclustering-ha.txt +++ b/csit/testplans/bgpcep-bgpclustering-ha.txt @@ -5,9 +5,10 @@ # and is available at http://www.eclipse.org/legal/epl-v10.html # Place the suites in run order: -integration/test/csit/suites/bgpcep/bgpclustering/060_bmp_ha_karaf_restart.robot -integration/test/csit/suites/bgpcep/bgpclustering/070_bmp_ha_karaf_stop.robot -integration/test/csit/suites/bgpcep/bgpclustering/080_pcep_ha_karaf_restart.robot -integration/test/csit/suites/bgpcep/bgpclustering/090_pcep_ha_karaf_stop.robot +integration/test/csit/suites/bgpcep/bgpclustering/050_bmp_ha_karaf_restart.robot +integration/test/csit/suites/bgpcep/bgpclustering/050_bmp_ha_karaf_stop.robot +integration/test/csit/suites/bgpcep/bgpclustering/060_pcep_ha_karaf_restart.robot +integration/test/csit/suites/bgpcep/bgpclustering/060_pcep_ha_karaf_stop.robot integration/test/csit/suites/bgpcep/bgpclustering/040_bgp_ha_karaf_restart.robot -integration/test/csit/suites/bgpcep/bgpclustering/050_bgp_ha_karaf_stop.robot +integration/test/csit/suites/bgpcep/bgpclustering/040_bgp_ha_karaf_stop.robot +integration/test/csit/suites/bgpcep/bgpclustering/040_bgp_ha_karaf_isolation.robot -- 2.36.6