c9961577e277ca2c149142640e6b215333e077dc
[integration/test.git] / csit / suites / bgpcep / bgpclustering / 010_singlepeer_prefixcount_1route_nonreplicated_rib.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 default operational
13 ...               shard leader only. Less stress for cluster is expected as if followers were
14 ...               triggered for that.
15 Suite Setup       PrefixcountKeywords.Setup_Everything
16 Suite Teardown    PrefixcountKeywords.Teardown_Everything
17 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
18 Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
19 Library           SSHLibrary    timeout=10s
20 Library           RequestsLibrary
21 Resource          ../../../libraries/BGPcliKeywords.robot
22 Resource          ../../../libraries/BGPSpeaker.robot
23 Resource          ../../../libraries/ClusterManagement.robot
24 Resource          ../../../libraries/FailFast.robot
25 Resource          ../../../libraries/KillPythonTool.robot
26 Resource          ../../../libraries/PrefixCounting.robot
27 Resource          ../../../libraries/SetupUtils.robot
28 Resource          ../../../libraries/SSHKeywords.robot
29 Resource          ../../../libraries/TemplatedRequests.robot
30 Resource          ../../../variables/Variables.robot
31 Resource          PrefixcountKeywords.robot
32
33 *** Variables ***
34 ${COUNT}          1
35
36 *** Test Cases ***
37 Get Example Bgp Rib Owner
38     [Documentation]    Find an odl node which is able to accept incomming connection.
39     ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    org.opendaylight.mdsal.ServiceEntityType    1
40     BuiltIn.Set_Suite_Variable    ${rib_owner}    ${rib_owner}
41     BuiltIn.Set_Suite_Variable    ${rib_owner_node_id}    ${ODL_SYSTEM_${rib_owner}_IP}
42     ${session} =    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
43     BuiltIn.Set_Suite_Variable    ${config_session}    ${session}
44
45 Get Topology Operational Leader
46     [Documentation]    Gets the operational topology shard leader
47     ${leader}    ${followers}=    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=topology    shard_type=operational
48     ${session} =    ClusterManagement.Resolve_Http_Session_For_Member    ${leader}
49     BuiltIn.Set_Suite_Variable    ${topo_lead_ses}    ${session}
50
51 Check_For_Empty_Ipv4_Topology_Before_Talking
52     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
53     [Tags]    critical
54     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
55     BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${topo_lead_ses}    topology=${EXAMPLE_IPV4_TOPOLOGY}
56
57 Reconfigure_ODL_To_Accept_Connection
58     [Documentation]    Configure BGP peer module in passive mode (not initiating connection)
59     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
60     &{mapping}    Create Dictionary    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    PASSIVE_MODE=true
61     TemplatedRequests.Put_As_Xml_Templated    ${BGP_PEER_FOLDER}    mapping=${mapping}    session=${config_session}
62     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
63
64 Start_Talking_BGP_Speaker
65     [Documentation]    Start Python speaker to connect to ODL.
66     PrefixcountKeywords.Start_Bgp_Peer_And_Verify_Connected    connection_retries=${3}
67
68 Wait_For_Stable_Talking_Ipv4_Topology
69     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 1.
70     PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${topo_lead_ses}    topology=${EXAMPLE_IPV4_TOPOLOGY}
71
72 Check_Talking_Ipv4_Topology_Count
73     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 1.
74     [Tags]    critical
75     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
76     PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${topo_lead_ses}    topology=${EXAMPLE_IPV4_TOPOLOGY}
77
78 Kill_Talking_BGP_Speaker
79     [Documentation]    Abort the Python speaker. Also, attempt to stop failing fast.
80     [Tags]    critical
81     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
82     BGPSpeaker.Kill_BGP_Speaker
83     FailFast.Do_Not_Fail_Fast_From_Now_On
84
85 Wait_For_Stable_Ipv4_Topology_After_Listening
86     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 1.
87     [Tags]    critical
88     PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${topo_lead_ses}    topology=${EXAMPLE_IPV4_TOPOLOGY}
89
90 Check_For_Empty_Ipv4_Topology_After_Listening
91     [Documentation]    Example-ipv4-topology should be empty now as seen from node 1.
92     [Tags]    critical
93     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
94     PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${topo_lead_ses}    topology=${EXAMPLE_IPV4_TOPOLOGY}
95
96 Delete_Bgp_Peer_Configuration
97     [Documentation]    Revert the BGP configuration to the original state: without any configured peers
98     &{mapping}    Create Dictionary    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    IP=${TOOLS_SYSTEM_IP}
99     TemplatedRequests.Delete_Templated    ${BGP_PEER_FOLDER}    mapping=${mapping}    session=${config_session}