Add default critical tag to bgpclustering
[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     BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    Check_For_Empty_Ipv4_Topology_On_All_Nodes
45     &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
46     ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
47     Check_For_Empty_Ipv4_Topology_On_All_Nodes
48     ${session} =    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${rib_owner}
49     BuiltIn.Set_Suite_Variable    ${CONFIG_SESSION}    ${session}
50     # TODO: Either define BGP_VARIABLES_FOLDER in this file, or create a Resource with the definition and wrapping keywords
51     TemplatedRequests.Put_As_Json_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${session}
52     WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout    ${DURATION_24_HOURS_IN_SECONDS}    1s    Test_Scenario    ${rib_owner}
53     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${session}
54
55 *** Keywords ***
56 Test_Scenario
57     [Arguments]    ${rib_owner_id}
58     [Documentation]    Connect bgp peer, advertize prefixes and disconnect. Check correct count of prefixes on odl.
59     PrefixcountKeywords.Start_Bgp_Peer_And_Verify_Connected    connection_retries=${3}    peerip=${ODL_SYSTEM_${rib_owner_id}_IP}
60     Wait_For_Stable_Talking_Ipv4_Topology_On_All_Nodes    excluded_count=0
61     Check_Talking_Ipv4_Topology_Count_On_All_Nodes
62     BGPSpeaker.Kill_BGP_Speaker
63     Wait_For_Stable_Talking_Ipv4_Topology_On_All_Nodes    excluded_count=${COUNT}
64     Check_For_Empty_Ipv4_Topology_On_All_Nodes
65
66 Check_For_Empty_Ipv4_Topology_On_All_Nodes
67     [Documentation]    Check the topology is empty on all 3 nodes.
68     PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${CONFIGURATION_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
69     PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${CONFIGURATION_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
70     PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${CONFIGURATION_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
71
72 Wait_For_Stable_Talking_Ipv4_Topology_On_All_Nodes
73     [Arguments]    ${excluded_count}
74     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count.
75     # TODO: Make the keyword accept member_index_list (or at least session_list) to monitor at once, so that robot can fail faster.
76     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}
77     ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
78     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}
79     ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
80     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}
81     ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
82
83 Check_Talking_Ipv4_Topology_Count_On_All_Nodes
84     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} on all nodes and fail if the count is not correct.
85     PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${CONFIGURATION_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
86     PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${CONFIGURATION_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
87     PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${CONFIGURATION_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}