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