19a3d8a01a8b5234312fd84701f728f57aec2cee
[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 Suite Setup       PrefixcountKeywords.Setup_Everything
18 Suite Teardown    PrefixcountKeywords.Teardown_Everything
19 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
20 Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
21 Library           SSHLibrary    timeout=10s
22 Library           RequestsLibrary
23 Resource          ${CURDIR}/../../../variables/Variables.robot
24 Resource          ${CURDIR}/../../../libraries/BGPSpeaker.robot
25 Resource          ${CURDIR}/../../../libraries/BGPcliKeywords.robot
26 Resource          ${CURDIR}/../../../libraries/FailFast.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}/PrefixcountKeywords.robot
34
35 *** Variables ***
36 ${COUNT}          1000000
37
38 *** Test Cases ***
39 Get Example Bgp Rib Owner
40     [Documentation]    Find an odl node which is able to accept incomming connection.
41     ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    1
42     BuiltIn.Set_Suite_Variable    ${rib_owner}    ${rib_owner}
43     BuiltIn.Set_Suite_Variable    ${rib_owner_node_id}    ${ODL_SYSTEM_${rib_owner}_IP}
44     ${session} =    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
45     BuiltIn.Set_Suite_Variable    ${config_session}    ${session}
46
47 Check_For_Empty_Ipv4_Topology_Before_Talking_1
48     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
49     [Tags]    critical
50     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
51     BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
52
53 Check_For_Empty_Ipv4_Topology_Before_Talking_2
54     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
55     [Tags]    critical
56     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
57     BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
58
59 Check_For_Empty_Ipv4_Topology_Before_Talking_3
60     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
61     [Tags]    critical
62     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
63     BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
64
65 Reconfigure_ODL_To_Accept_Connection
66     [Documentation]    Configure BGP peer module with initiate-connection set to false.
67     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
68     &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
69     ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
70     TemplatedRequests.Put_As_Json_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
71     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
72
73 Start_Talking_BGP_Speaker
74     [Documentation]    Start Python speaker to connect to ODL.
75     PrefixcountKeywords.Start_Bgp_Peer_And_Verify_Connected    connection_retries=${3}
76
77 Wait_For_Stable_Talking_Ipv4_Topology_1
78     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 1.
79     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}
80
81 Wait_For_Stable_Talking_Ipv4_Topology_2
82     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 2.
83     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}
84
85 Wait_For_Stable_Talking_Ipv4_Topology_3
86     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 3.
87     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}
88
89 Check_Talking_Ipv4_Topology_Count_1
90     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 1.
91     [Tags]    critical
92     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
93     PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
94
95 Check_Talking_Ipv4_Topology_Count_2
96     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 2.
97     [Tags]    critical
98     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
99     PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
100
101 Check_Talking_Ipv4_Topology_Count_3
102     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 3.
103     [Tags]    critical
104     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
105     PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
106
107 Kill_Talking_BGP_Speaker
108     [Documentation]    Abort the Python speaker. Also, attempt to stop failing fast.
109     [Tags]    critical
110     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
111     BGPSpeaker.Kill_BGP_Speaker
112     FailFast.Do_Not_Fail_Fast_From_Now_On
113
114 Wait_For_Stable_Ipv4_Topology_After_Listening_1
115     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 1.
116     [Tags]    critical
117     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}
118
119 Wait_For_Stable_Ipv4_Topology_After_Listening_2
120     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 2.
121     [Tags]    critical
122     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}
123
124 Wait_For_Stable_Ipv4_Topology_After_Listening_3
125     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 3.
126     [Tags]    critical
127     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}
128
129 Check_For_Empty_Ipv4_Topology_After_Listening_1
130     [Documentation]    Example-ipv4-topology should be empty now as seen from node 1.
131     [Tags]    critical
132     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
133     PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
134
135 Check_For_Empty_Ipv4_Topology_After_Listening_2
136     [Documentation]    Example-ipv4-topology should be empty now as seen from node 2.
137     [Tags]    critical
138     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
139     PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
140
141 Check_For_Empty_Ipv4_Topology_After_Listening_3
142     [Documentation]    Example-ipv4-topology should be empty now as seen from node 3.
143     [Tags]    critical
144     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
145     PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
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    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
151     ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
152     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}