b00784dde8d3b851a9e03a21ff8e47b72e985ef9
[integration/test.git] / csit / suites / bgpcep / bgpclustering / singlepeer_pc_shm_300kroutes.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:
16 ...                 pc - prefix counting
17 ...                 shm - shard monitoring (during the process of prefix advertizing)
18
19 Library             SSHLibrary    timeout=10s
20 Library             RequestsLibrary
21 Resource            ${CURDIR}/../../../variables/Variables.robot
22 Resource            ${CURDIR}/../../../libraries/BGPSpeaker.robot
23 Resource            ${CURDIR}/../../../libraries/BGPcliKeywords.robot
24 Resource            ${CURDIR}/../../../libraries/FailFast.robot
25 Resource            ${CURDIR}/../../../libraries/KillPythonTool.robot
26 Resource            ${CURDIR}/../../../libraries/PrefixCounting.robot
27 Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
28 Resource            ${CURDIR}/../../../libraries/ClusterManagement.robot
29 Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot
30 Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
31 Resource            ${CURDIR}/PrefixcountKeywords.robot
32
33 Suite Setup         PrefixcountKeywords.Setup_Everything
34 Suite Teardown      PrefixcountKeywords.Teardown_Everything
35 Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
36 Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
37
38
39 *** Variables ***
40 ${COUNT}    300000
41
42
43 *** Test Cases ***
44 Get Example Bgp Rib Owner
45     [Documentation]    Find an odl node which is able to accept incomming connection. It is a node, which is the owner of bgp rib, as it is a singleton service.
46     ...    This node should be used for bgp peer to connect to.
47     ${rib_owner}    ${rib_candidates}    ClusterManagement.Get_Owner_And_Successors_For_device
48     ...    example-bgp-rib
49     ...    Bgpcep
50     ...    1
51     BuiltIn.Set_Suite_Variable    ${rib_owner}    ${rib_owner}
52     BuiltIn.Set_Suite_Variable    ${rib_owner_node_id}    ${ODL_SYSTEM_${rib_owner}_IP}
53     ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
54     BuiltIn.Set_Suite_Variable    ${config_session}    ${session}
55
56 Check_For_Empty_Ipv4_Topology_Before_Talking
57     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
58     [Tags]    critical
59     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
60     FOR    ${member_index}    IN    @{pc_all_indices}
61         BuiltIn.Wait_Until_Keyword_Succeeds
62         ...    ${INITIAL_RESTCONF_TIMEOUT}
63         ...    1s
64         ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
65         ...    session=${operational_${member_index}}
66         ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
67     END
68
69 Reconfigure_ODL_To_Accept_Connection
70     [Documentation]    Configure BGP peer module with initiate-connection set to false.
71     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
72     &{mapping}    BuiltIn.Create_Dictionary
73     ...    DEVICE_NAME=${DEVICE_NAME}
74     ...    BGP_NAME=${BGP_PEER_NAME}
75     ...    IP=${TOOLS_SYSTEM_IP}
76     ...    HOLDTIME=${HOLDTIME}
77     ...    PEER_PORT=${BGP_TOOL_PORT}
78     ...    INITIATE=false
79     ...    BGP_RIB=${RIB_INSTANCE}
80     ...    PASSIVE_MODE=true
81     ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
82     TemplatedRequests.Put_As_Json_Templated
83     ...    ${BGP_VARIABLES_FOLDER}
84     ...    mapping=${mapping}
85     ...    session=${config_session}
86     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
87
88 Start_Talking_BGP_Speaker
89     [Documentation]    Start Python speaker to connect to ODL.
90     PrefixcountKeywords.Start_Bgp_Peer_And_Verify_Connected    connection_retries=${3}
91
92 Wait_For_Stable_Talking_Ipv4_Topology
93     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from all nodes.
94     FOR    ${member_index}    IN    @{pc_all_indices}
95         PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
96         ...    timeout=${bgp_filling_timeout}
97         ...    period=${CHECK_PERIOD}
98         ...    repetitions=${REPETITIONS}
99         ...    excluded_count=0
100         ...    session=${operational_${member_index}}
101         ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
102         ...    shards_list=${SHARD_MONITOR_LIST}
103         ...    shards_details=${init_shard_details}
104     END
105
106 Check_Talking_Ipv4_Topology_Count
107     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 1.
108     [Tags]    critical
109     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
110     FOR    ${member_index}    IN    @{pc_all_indices}
111         PrefixCounting.Check_Ipv4_Topology_Count
112         ...    ${COUNT}
113         ...    session=${operational_${member_index}}
114         ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
115     END
116
117 Kill_Talking_BGP_Speaker
118     [Documentation]    Abort the Python speaker. Also, attempt to stop failing fast.
119     [Tags]    critical
120     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
121     BGPSpeaker.Kill_BGP_Speaker
122     FailFast.Do_Not_Fail_Fast_From_Now_On
123
124 Wait_For_Stable_Ipv4_Topology_After_Listening
125     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 1.
126     [Tags]    critical
127     FOR    ${member_index}    IN    @{pc_all_indices}
128         PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
129         ...    timeout=${bgp_filling_timeout}
130         ...    period=${CHECK_PERIOD}
131         ...    repetitions=${REPETITIONS}
132         ...    excluded_count=${COUNT}
133         ...    session=${operational_${member_index}}
134         ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
135     END
136
137 Check_For_Empty_Ipv4_Topology_After_Listening
138     [Documentation]    Example-ipv4-topology should be empty now as seen from node 1.
139     [Tags]    critical
140     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
141     FOR    ${member_index}    IN    @{pc_all_indices}
142         PrefixCounting.Check_Ipv4_Topology_Is_Empty
143         ...    session=${operational_${member_index}}
144         ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
145     END
146
147 Delete_Bgp_Peer_Configuration
148     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
149     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
150     &{mapping}    BuiltIn.Create_Dictionary
151     ...    DEVICE_NAME=${DEVICE_NAME}
152     ...    BGP_NAME=${BGP_PEER_NAME}
153     ...    IP=${TOOLS_SYSTEM_IP}
154     ...    HOLDTIME=${HOLDTIME}
155     ...    PEER_PORT=${BGP_TOOL_PORT}
156     ...    INITIATE=false
157     ...    BGP_RIB=${RIB_INSTANCE}
158     ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
159     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}