6f1302b565bf955d3db2f6a5cc0dd65f2c7cf2b9
[integration/test.git] / csit / suites / bgpcep / bgpclustering / 030_singlepeer_prefixcount_1Mroutes.robot
1 *** Settings ***
2 Documentation       BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
3 ...
4 ...                 Copyright (c) 2015-2016 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-<dst_id> on all nodes.
13 ...                 RIB is not examined.
14 ...                 <dst-id> is recognized during the suite run, should be the Leader of default
15 ...                 operational Shard, otherwise the scenario would fail due to
16 ...                 https://bugs.opendaylight.org/show_bug.cgi?id=5536
17
18 Library             SSHLibrary    timeout=10s
19 Library             RequestsLibrary
20 Resource            ${CURDIR}/../../../variables/Variables.robot
21 Resource            ${CURDIR}/../../../libraries/BGPSpeaker.robot
22 Resource            ${CURDIR}/../../../libraries/BGPcliKeywords.robot
23 Resource            ${CURDIR}/../../../libraries/FailFast.robot
24 Resource            ${CURDIR}/../../../libraries/KillPythonTool.robot
25 Resource            ${CURDIR}/../../../libraries/PrefixCounting.robot
26 Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
27 Resource            ${CURDIR}/../../../libraries/ClusterManagement.robot
28 Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot
29 Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
30 Resource            ${CURDIR}/PrefixcountKeywords.robot
31
32 Suite Setup         PrefixcountKeywords.Setup_Everything
33 Suite Teardown      PrefixcountKeywords.Teardown_Everything
34 Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
35 Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
36
37
38 *** Variables ***
39 ${COUNT}    1000000
40
41
42 *** Test Cases ***
43 Get Example Bgp Rib Owner
44     [Documentation]    Find an odl node which is able to accept incomming connection.
45     ${rib_owner}    ${rib_candidates}    ClusterManagement.Get_Owner_And_Successors_For_device
46     ...    example-bgp-rib
47     ...    Bgpcep
48     ...    1
49     BuiltIn.Set_Suite_Variable    ${rib_owner}    ${rib_owner}
50     BuiltIn.Set_Suite_Variable    ${rib_owner_node_id}    ${ODL_SYSTEM_${rib_owner}_IP}
51     ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
52     BuiltIn.Set_Suite_Variable    ${config_session}    ${session}
53
54 Check_For_Empty_Ipv4_Topology_Before_Talking_1
55     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
56     [Tags]    critical
57     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
58     BuiltIn.Wait_Until_Keyword_Succeeds
59     ...    ${INITIAL_RESTCONF_TIMEOUT}
60     ...    1s
61     ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
62     ...    session=${operational_1}
63     ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
64
65 Check_For_Empty_Ipv4_Topology_Before_Talking_2
66     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
67     [Tags]    critical
68     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
69     BuiltIn.Wait_Until_Keyword_Succeeds
70     ...    ${INITIAL_RESTCONF_TIMEOUT}
71     ...    1s
72     ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
73     ...    session=${operational_2}
74     ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
75
76 Check_For_Empty_Ipv4_Topology_Before_Talking_3
77     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
78     [Tags]    critical
79     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
80     BuiltIn.Wait_Until_Keyword_Succeeds
81     ...    ${INITIAL_RESTCONF_TIMEOUT}
82     ...    1s
83     ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
84     ...    session=${operational_3}
85     ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
86
87 Reconfigure_ODL_To_Accept_Connection
88     [Documentation]    Configure BGP peer module with initiate-connection set to false.
89     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
90     &{mapping}    BuiltIn.Create_Dictionary
91     ...    DEVICE_NAME=${DEVICE_NAME}
92     ...    BGP_NAME=${BGP_PEER_NAME}
93     ...    IP=${TOOLS_SYSTEM_IP}
94     ...    HOLDTIME=${HOLDTIME}
95     ...    PEER_PORT=${BGP_TOOL_PORT}
96     ...    INITIATE=false
97     ...    BGP_RIB=${RIB_INSTANCE}
98     ...    PASSIVE_MODE=true
99     ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
100     TemplatedRequests.Put_As_Json_Templated
101     ...    ${BGP_VARIABLES_FOLDER}
102     ...    mapping=${mapping}
103     ...    session=${config_session}
104     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
105
106 Start_Talking_BGP_Speaker
107     [Documentation]    Start Python speaker to connect to ODL.
108     PrefixcountKeywords.Start_Bgp_Peer_And_Verify_Connected    connection_retries=${3}
109
110 Wait_For_Stable_Talking_Ipv4_Topology_1
111     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 1.
112     PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
113     ...    timeout=${bgp_filling_timeout}
114     ...    period=${CHECK_PERIOD}
115     ...    repetitions=${REPETITIONS}
116     ...    excluded_count=0
117     ...    session=${operational_1}
118     ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
119
120 Wait_For_Stable_Talking_Ipv4_Topology_2
121     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 2.
122     PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
123     ...    timeout=${bgp_filling_timeout}
124     ...    period=${CHECK_PERIOD}
125     ...    repetitions=${REPETITIONS}
126     ...    excluded_count=0
127     ...    session=${operational_2}
128     ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
129
130 Wait_For_Stable_Talking_Ipv4_Topology_3
131     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 3.
132     PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
133     ...    timeout=${bgp_filling_timeout}
134     ...    period=${CHECK_PERIOD}
135     ...    repetitions=${REPETITIONS}
136     ...    excluded_count=0
137     ...    session=${operational_3}
138     ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
139
140 Check_Talking_Ipv4_Topology_Count_1
141     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 1.
142     [Tags]    critical
143     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
144     PrefixCounting.Check_Ipv4_Topology_Count
145     ...    ${COUNT}
146     ...    session=${operational_1}
147     ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
148
149 Check_Talking_Ipv4_Topology_Count_2
150     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 2.
151     [Tags]    critical
152     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
153     PrefixCounting.Check_Ipv4_Topology_Count
154     ...    ${COUNT}
155     ...    session=${operational_2}
156     ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
157
158 Check_Talking_Ipv4_Topology_Count_3
159     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 3.
160     [Tags]    critical
161     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
162     PrefixCounting.Check_Ipv4_Topology_Count
163     ...    ${COUNT}
164     ...    session=${operational_3}
165     ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
166
167 Kill_Talking_BGP_Speaker
168     [Documentation]    Abort the Python speaker. Also, attempt to stop failing fast.
169     [Tags]    critical
170     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
171     BGPSpeaker.Kill_BGP_Speaker
172     FailFast.Do_Not_Fail_Fast_From_Now_On
173
174 Wait_For_Stable_Ipv4_Topology_After_Listening_1
175     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 1.
176     [Tags]    critical
177     PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
178     ...    timeout=${bgp_filling_timeout}
179     ...    period=${CHECK_PERIOD}
180     ...    repetitions=${REPETITIONS}
181     ...    excluded_count=${COUNT}
182     ...    session=${operational_1}
183     ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
184
185 Wait_For_Stable_Ipv4_Topology_After_Listening_2
186     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 2.
187     [Tags]    critical
188     PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
189     ...    timeout=${bgp_filling_timeout}
190     ...    period=${CHECK_PERIOD}
191     ...    repetitions=${REPETITIONS}
192     ...    excluded_count=${COUNT}
193     ...    session=${operational_2}
194     ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
195
196 Wait_For_Stable_Ipv4_Topology_After_Listening_3
197     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 3.
198     [Tags]    critical
199     PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
200     ...    timeout=${bgp_filling_timeout}
201     ...    period=${CHECK_PERIOD}
202     ...    repetitions=${REPETITIONS}
203     ...    excluded_count=${COUNT}
204     ...    session=${operational_3}
205     ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
206
207 Check_For_Empty_Ipv4_Topology_After_Listening_1
208     [Documentation]    Example-ipv4-topology should be empty now as seen from node 1.
209     [Tags]    critical
210     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
211     PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
212
213 Check_For_Empty_Ipv4_Topology_After_Listening_2
214     [Documentation]    Example-ipv4-topology should be empty now as seen from node 2.
215     [Tags]    critical
216     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
217     PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
218
219 Check_For_Empty_Ipv4_Topology_After_Listening_3
220     [Documentation]    Example-ipv4-topology should be empty now as seen from node 3.
221     [Tags]    critical
222     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
223     PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
224
225 Delete_Bgp_Peer_Configuration
226     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
227     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
228     &{mapping}    BuiltIn.Create_Dictionary
229     ...    DEVICE_NAME=${DEVICE_NAME}
230     ...    BGP_NAME=${BGP_PEER_NAME}
231     ...    IP=${TOOLS_SYSTEM_IP}
232     ...    HOLDTIME=${HOLDTIME}
233     ...    PEER_PORT=${BGP_TOOL_PORT}
234     ...    INITIATE=false
235     ...    BGP_RIB=${RIB_INSTANCE}
236     ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
237     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}