Use 125s timout for shard leader deatails
[integration/test.git] / csit / suites / bgpcep / bgpclustering / singlepeer_pc_shm_300kroutes_longevity.robot
1 *** Settings ***
2 Documentation     BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
3 ...
4 ...               Copyright (c) 2015-2017 Cisco Systems, Inc. and others. All rights reserved.
5 ...
6 ...               This program and the accompanying materials are made available under the
7 ...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
8 ...               and is available at http://www.eclipse.org/legal/epl-v10.html
9 ...
10 ...               This suite uses play.py as single iBGP peer which talks to
11 ...               single controller in three node cluster configuration.
12 ...               Test suite checks changes of the the example-ipv4-topology on all nodes.
13 ...               RIB is not examined.
14 ...
15 ...               singlepeer_pc_shm_300kroutes_longevity.robot:
16 ...               pc - prefix counting
17 ...               shm - shard monitoring (during the process of prefix advertizing)
18 Suite Setup       PrefixcountKeywords.Setup_Everything
19 Suite Teardown    PrefixcountKeywords.Teardown_Everything
20 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
21 Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
22 Default Tags      critical
23 Library           SSHLibrary    timeout=10s
24 Resource          ${CURDIR}/../../../variables/Variables.robot
25 Resource          ${CURDIR}/../../../libraries/BGPSpeaker.robot
26 Resource          ${CURDIR}/../../../libraries/BGPcliKeywords.robot
27 Resource          ${CURDIR}/../../../libraries/KillPythonTool.robot
28 Resource          ${CURDIR}/../../../libraries/PrefixCounting.robot
29 Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
30 Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
31 Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
32 Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
33 Resource          ${CURDIR}/../../../libraries/WaitForFailure.robot
34 Resource          ${CURDIR}/PrefixcountKeywords.robot
35
36 *** Variables ***
37 ${COUNT}          300000
38 ${DURATION_24_HOURS_IN_SECONDS}    86400
39
40 *** Test Cases ***
41 Configure_Prefixes_Longevity
42     [Documentation]    Configure bgp peer, repeat the test scenario for 24h and deconfigure it.
43     ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    org.opendaylight.mdsal.ServiceEntityType    1
44     PrefixcountKeywords.Set_Shard_Leaders_Location_And_Verify    ${rib_owner}
45     BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    Check_For_Empty_Ipv4_Topology_On_All_Nodes
46     &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
47     ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
48     Check_For_Empty_Ipv4_Topology_On_All_Nodes
49     ${session} =    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${rib_owner}
50     BuiltIn.Set_Suite_Variable    ${CONFIG_SESSION}    ${session}
51     # TODO: Either define BGP_VARIABLES_FOLDER in this file, or create a Resource with the definition and wrapping keywords
52     TemplatedRequests.Put_As_Json_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${session}
53     WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout    ${DURATION_24_HOURS_IN_SECONDS}    1s    Test_Scenario    ${rib_owner}
54     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${session}
55
56 *** Keywords ***
57 Test_Scenario
58     [Arguments]    ${rib_owner_id}
59     [Documentation]    Connect bgp peer, advertize prefixes and disconnect. Check correct count of prefixes on odl.
60     PrefixcountKeywords.Start_Bgp_Peer_And_Verify_Connected    connection_retries=${3}    peerip=${ODL_SYSTEM_${rib_owner_id}_IP}
61     Wait_For_Stable_Talking_Ipv4_Topology_On_All_Nodes    excluded_count=0
62     Check_Talking_Ipv4_Topology_Count_On_All_Nodes
63     BGPSpeaker.Kill_BGP_Speaker
64     Wait_For_Stable_Talking_Ipv4_Topology_On_All_Nodes    excluded_count=${COUNT}
65     Check_For_Empty_Ipv4_Topology_On_All_Nodes
66
67 Check_For_Empty_Ipv4_Topology_On_All_Nodes
68     [Documentation]    Check the topology is empty on all 3 nodes.
69     PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${CONFIGURATION_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
70     PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${CONFIGURATION_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
71     PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${CONFIGURATION_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
72
73 Wait_For_Stable_Talking_Ipv4_Topology_On_All_Nodes
74     [Arguments]    ${excluded_count}
75     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count.
76     # TODO: Make the keyword accept member_index_list (or at least session_list) to monitor at once, so that robot can fail faster.
77     PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${excluded_count}    session=${CONFIGURATION_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
78     ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
79     PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${excluded_count}    session=${CONFIGURATION_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
80     ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
81     PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${excluded_count}    session=${CONFIGURATION_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
82     ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
83
84 Check_Talking_Ipv4_Topology_Count_On_All_Nodes
85     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} on all nodes and fail if the count is not correct.
86     PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${CONFIGURATION_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
87     PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${CONFIGURATION_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
88     PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${CONFIGURATION_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}