Manypeers BGP rrc peers suite update 88/34488/4
authorRadovan Sajben <rsajben@cisco.com>
Thu, 11 Feb 2016 18:14:06 +0000 (19:14 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 12 Feb 2016 10:38:53 +0000 (10:38 +0000)
- suite parameters clean-up
- prefix count deadlock detection

Change-Id: Ib1cf3b01b5eb514f0a5b4ff2db14fb57edee9f3e
Signed-off-by: Radovan Sajben <rsajben@cisco.com>
csit/suites/bgpcep/bgpingest/manypeers_peercount.robot

index e6cc862f2d37872f3e84b2101bad692fe5a04558..444d4b262cfe79944ca65b903330f08fad039ecb 100644 (file)
@@ -19,7 +19,7 @@ Documentation     BGP performance of ingesting from many iBGP rrc peers, iBGPs r
 Suite Setup       Setup_Everything
 Suite Teardown    Teardown_Everything
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
 Suite Setup       Setup_Everything
 Suite Teardown    Teardown_Everything
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     FailFast.Start_Failing_Fast_If_This_Failed
+Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
 Library           DateTime
 Library           RequestsLibrary
 Library           SSHLibrary    timeout=10s
 Library           DateTime
 Library           RequestsLibrary
 Library           SSHLibrary    timeout=10s
@@ -36,36 +36,19 @@ Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
 ${BGP_TOOL_LOG_LEVEL}    info
 ${BGP_PEERS_LOG_FILE_NAME}    bgp_peer.log
 ${BGP_VARIABLES_FOLDER}    ${CURDIR}/../../../variables/bgpuser/
 ${BGP_TOOL_LOG_LEVEL}    info
 ${BGP_PEERS_LOG_FILE_NAME}    bgp_peer.log
 ${BGP_VARIABLES_FOLDER}    ${CURDIR}/../../../variables/bgpuser/
-${CHECK_PERIOD}    10
-${CHECK_PERIOD_PREFIX_COUNT}    ${CHECK_PERIOD}
-${CHECK_PERIOD_PREFIX_COUNT_MANY}    ${CHECK_PERIOD_PREFIX_COUNT}
-${CHECK_PERIOD_PREFIX_COUNT_MANY_RRC}    ${CHECK_PERIOD_PREFIX_COUNT_MANY}
+${CHECK_PERIOD_PREFIX_COUNT_MANY_RRC}    10
 ${COUNT}          1000000
 ${COUNT}          1000000
-${COUNT_PREFIX_COUNT}    ${COUNT}
-${COUNT_PREFIX_COUNT_MANY}    ${COUNT_PREFIX_COUNT}
-${COUNT_PREFIX_COUNT_MANY_RRC}    ${COUNT_PREFIX_COUNT_MANY}
+${COUNT_PREFIX_COUNT_MANY_RRC}    ${COUNT}
 ${FIRST_PEER_IP}    127.0.0.1
 ${HOLDTIME}       180
 ${FIRST_PEER_IP}    127.0.0.1
 ${HOLDTIME}       180
-${HOLDTIME_PREFIX_COUNT}    ${HOLDTIME}
-${HOLDTIME_PREFIX_COUNT_MANY}    ${HOLDTIME_PREFIX_COUNT}
-${HOLDTIME_PREFIX_COUNT_MANY_RRC}    ${HOLDTIME_PREFIX_COUNT_MANY}
+${HOLDTIME_PREFIX_COUNT_MANY_RRC}    ${HOLDTIME}
 ${KARAF_LOG_LEVEL}    INFO
 ${KARAF_BGPCEP_LOG_LEVEL}    ${KARAF_LOG_LEVEL}
 ${KARAF_PROTOCOL_LOG_LEVEL}    ${KARAF_BGPCEP_LOG_LEVEL}
 ${KARAF_LOG_LEVEL}    INFO
 ${KARAF_BGPCEP_LOG_LEVEL}    ${KARAF_LOG_LEVEL}
 ${KARAF_PROTOCOL_LOG_LEVEL}    ${KARAF_BGPCEP_LOG_LEVEL}
-${MULTIPLICITY}    10
-${MULTIPLICITY_PREFIX_COUNT}    ${MULTIPLICITY}
-${MULTIPLICITY_PREFIX_COUNT_MANY}    ${MULTIPLICITY_PREFIX_COUNT}
-${MULTIPLICITY_PREFIX_COUNT_MANY_RRC}    ${MULTIPLICITY_PREFIX_COUNT_MANY}
-${REPETITIONS}    1
-${REPETITIONS_PREFIX_COUNT}    ${REPETITIONS}
-${REPETITIONS_PREFIX_COUNT_MANY}    ${REPETITIONS_PREFIX_COUNT}
-${REPETITIONS_PREFIX_COUNT_MANY_RRC}    ${REPETITIONS_PREFIX_COUNT_MANY}
+${MULTIPLICITY_PREFIX_COUNT_MANY_RRC}    10
+${REPETITIONS_PREFIX_COUNT_MANY_RRC}    10
 ${TEST_DURATION_MULTIPLIER}    1
 ${TEST_DURATION_MULTIPLIER}    1
-${TEST_DURATION_MULTIPLIER_PREFIX_COUNT}    ${TEST_DURATION_MULTIPLIER}
-${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_MANY}    ${TEST_DURATION_MULTIPLIER_PREFIX_COUNT}
-${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_MANY_RRC}    ${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_MANY}
-# TODO: Option names can be better.
-# TODO: TODOs can be better.
+${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_MANY_RRC}    ${TEST_DURATION_MULTIPLIER}
 
 *** Test Cases ***
 Check_For_Empty_Ipv4_Topology_Before_Talking
 
 *** Test Cases ***
 Check_For_Empty_Ipv4_Topology_Before_Talking
@@ -91,9 +74,10 @@ Wait_For_Ipv4_Topology
     [Documentation]    Wait until example-ipv4-topology reaches the target prefix count.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     [Documentation]    Wait until example-ipv4-topology reaches the target prefix count.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Log    ${bgp_filling_timeout}s    console=yes
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${bgp_filling_timeout}    ${CHECK_PERIOD_PREFIX_COUNT_MANY_RRC}    Check_Ipv4_Topology    ${COUNT_PREFIX_COUNT_MANY_RRC}
-    [Teardown]    Report_Failure_Due_To_Bug    5185
+    BuiltIn.Log    max. ${bgp_filling_timeout}s    console=yes
+    Init_Check_Ipv4_Topology_Keyword    ${COUNT_PREFIX_COUNT_MANY_RRC}    ${REPETITIONS_PREFIX_COUNT_MANY_RRC}
+    ${message}=    BuiltIn.Wait_Until_Keyword_Succeeds    ${bgp_filling_timeout}    ${CHECK_PERIOD_PREFIX_COUNT_MANY_RRC}    Check_Ipv4_Topology
+    BuiltIn.Should_Be_Equal_As_Strings    ${message}    Target value reached.
 
 Check_Logs_For_Updates
     [Documentation]    Check BGP peer logs for received updates.
 
 Check_Logs_For_Updates
     [Documentation]    Check BGP peer logs for received updates.
@@ -122,14 +106,12 @@ Wait_For_Stable_Ipv4_Topology_After_Talking
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_emptying_timeout}    period=${CHECK_PERIOD_PREFIX_COUNT_MANY_RRC}    repetitions=${REPETITIONS_PREFIX_COUNT_MANY_RRC}    excluded_count=${COUNT_PREFIX_COUNT_MANY_RRC}
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_emptying_timeout}    period=${CHECK_PERIOD_PREFIX_COUNT_MANY_RRC}    repetitions=${REPETITIONS_PREFIX_COUNT_MANY_RRC}    excluded_count=${COUNT_PREFIX_COUNT_MANY_RRC}
-    [Teardown]    Report_Failure_Due_To_Bug    5097
 
 Check_For_Empty_Ipv4_Topology_After_Talking
     [Documentation]    Example-ipv4-topology should be empty now.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     PrefixCounting.Check_Ipv4_Topology_Is_Empty
 
 Check_For_Empty_Ipv4_Topology_After_Talking
     [Documentation]    Example-ipv4-topology should be empty now.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     PrefixCounting.Check_Ipv4_Topology_Is_Empty
-    [Teardown]    Report_Failure_Due_To_Bug    5097
 
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
 
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
@@ -172,13 +154,26 @@ Teardown_Everything
     RequestsLibrary.Delete_All_Sessions
     SSHLibrary.Close_All_Connections
 
     RequestsLibrary.Delete_All_Sessions
     SSHLibrary.Close_All_Connections
 
+Init_Check_Ipv4_Topology_Keyword
+    [Arguments]    ${expected_count}=0    ${deadlock_cycles}=-1
+    [Documentation]    Initialise test variables for Check_Ipv4_Topology keyword.
+    ${deadlock_cycles}=    Convert To Integer    ${deadlock_cycles}
+    BuiltIn.Set_Test_Variable    ${deadlock_cycles}
+    BuiltIn.Set_Test_Variable    ${ipv4_topology_deadlock_countdown}    ${deadlock_cycles}
+    BuiltIn.Set_Test_Variable    ${expected_count}
+    BuiltIn.Set_Test_Variable    ${ipv4_topology_last_count}    -1
+
 Check_Ipv4_Topology
 Check_Ipv4_Topology
-    [Arguments]    ${expected_count}=0
-    [Documentation]    Check and log the IPv4 topology count
-    ${current_time} =    DateTime.Get_Current_Date    exclude_millis=True
+    [Documentation]    Check and log the IPv4 topology count. PASS if ${expected_count} or ${actual_count} not changed for ${deadlock_cycles} keyword calls.
     ${actual_count} =    PrefixCounting.Get_Ipv4_Topology_Count
     ${actual_count} =    PrefixCounting.Get_Ipv4_Topology_Count
-    BuiltIn.Log    ${current_time}: actual (expected) prefix count is ${actual_count} (${expected_count})    console=yes
-    BuiltIn.Should_Be_Equal_As_Strings    ${actual_count}    ${expected_count}
+    ${ipv4_topology_deadlock_countdown}=    BuiltIn.Set_Variable_If    (${actual_count} == ${ipv4_topology_last_count}) and (${ipv4_topology_deadlock_countdown} >= 0)    ${ipv4_topology_deadlock_countdown - 1}    ${deadlock_cycles}
+    ${hour}    ${min}    ${sec} =    BuiltIn.Get_Time    hour min sec
+    BuiltIn.Set_Test_Variable    ${ipv4_topology_deadlock_countdown}
+    BuiltIn.Set_Test_Variable    ${ipv4_topology_last_count}    ${actual_count}
+    BuiltIn.Log    ${hour}:${min}:${sec} actual/expected prefix count is ${actual_count}/${expected_count} (countdown:${ipv4_topology_deadlock_countdown})    console=yes
+    BuiltIn.Return_From_Keyword_If    ${ipv4_topology_deadlock_countdown} == 0    Deadlock detected (ipv4-topology not changed for ${deadlock_cycles} cycles)
+    BuiltIn.Should_Be_Equal_As_Integers    ${actual_count}    ${expected_count}
+    [Return]    Target value reached.
 
 Check_File_For_Occurence
     [Arguments]    ${file_name}    ${keyword}    ${value}=''    ${threshold}=1
 
 Check_File_For_Occurence
     [Arguments]    ${file_name}    ${keyword}    ${value}=''    ${threshold}=1