2 Documentation BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
4 ... Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
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
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 Variables ${CURDIR}/../../../variables/Variables.py
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
37 ${EXAMPLE_IPV4_TOPOLOGY_PREF} example-ipv4-topology-
40 Get Default Operational Shard Leader
41 ${dos_leader} ${dos_followers}= ClusterManagement.Get_Leader_And_Followers_For_Shard
42 BuiltIn.Set_Suite_Variable ${dos_leader} ${dos_leader}
43 BuiltIn.Set_Suite_Variable ${default_oper_shard_leader_node_ip} ${ODL_SYSTEM_${dos_leader}_IP}
44 RequestsLibrary.Create_Session ${CONFIG_SESSION} http://${ODL_SYSTEM_${dos_leader}_IP}:${RESTCONFPORT} auth=${AUTH}
46 Check_For_Empty_Ipv4_Topology_Before_Talking_1
47 [Documentation] Wait for ${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
49 [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
50 BuiltIn.Wait_Until_Keyword_Succeeds ${INITIAL_RESTCONF_TIMEOUT} 1s PrefixCounting.Check_Ipv4_Topology_Is_Empty session=${CONFIGURATION_1} topology=${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader}
52 Check_For_Empty_Ipv4_Topology_Before_Talking_2
53 [Documentation] Wait for ${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
55 [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
56 BuiltIn.Wait_Until_Keyword_Succeeds ${INITIAL_RESTCONF_TIMEOUT} 1s PrefixCounting.Check_Ipv4_Topology_Is_Empty session=${CONFIGURATION_2} topology=${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader}
58 Check_For_Empty_Ipv4_Topology_Before_Talking_3
59 [Documentation] Wait for ${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
61 [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
62 BuiltIn.Wait_Until_Keyword_Succeeds ${INITIAL_RESTCONF_TIMEOUT} 1s PrefixCounting.Check_Ipv4_Topology_Is_Empty session=${CONFIGURATION_3} topology=${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader}
64 Configure_Netconf_Device
65 [Documentation] Configures and verifies netconf device configuration. If configuration is not successful, it de-configures the device before the next attempt.
66 &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} DEVICE_PORT=1830 DEVICE_IP=${default_oper_shard_leader_node_ip} DEVICE_USER=admin DEVICE_PASSWORD=admin
67 # After the netconf device is configured, odl starts downloading schemas. If the downloading will not finish within akka timeout, more tries are needed, 3 is based on a user experience.
68 : FOR ${index} IN RANGE 0 3
69 \ ${status} ${value}= Run Keyword And Ignore Error PrefixcountKeywords.Configure_Netconf_Device_And_Check_Mounted ${mapping}
70 \ Exit For Loop If '${status}' == 'PASS'
71 \ Run Keyword Unless '${status}' == 'PASS' TemplatedRequests.Delete_Templated ${NETCONF_DEV_FOLDER} mapping=${mapping} session=${CONFIG_SESSION}
72 Run Keyword Unless '${status}' == 'PASS' Fail
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}
79 TemplatedRequests.Put_As_Json_Templated ${BGP_VARIABLES_FOLDER} mapping=${mapping} session=${CONFIG_SESSION}
80 [Teardown] SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
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} peerip=${default_oper_shard_leader_node_ip}
86 Wait_For_Stable_Talking_Ipv4_Topology_1
87 [Documentation] Wait until ${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader} 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=${CONFIGURATION_1} topology=${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader}
90 Wait_For_Stable_Talking_Ipv4_Topology_2
91 [Documentation] Wait until ${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader} becomes stable. This is done by checking stability of prefix count as seen from node 2.
92 PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable timeout=${bgp_filling_timeout} period=${CHECK_PERIOD} repetitions=${REPETITIONS} excluded_count=0 session=${CONFIGURATION_2} topology=${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader}
94 Wait_For_Stable_Talking_Ipv4_Topology_3
95 [Documentation] Wait until ${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader} becomes stable. This is done by checking stability of prefix count as seen from node 3.
96 PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable timeout=${bgp_filling_timeout} period=${CHECK_PERIOD} repetitions=${REPETITIONS} excluded_count=0 session=${CONFIGURATION_3} topology=${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader}
98 Check_Talking_Ipv4_Topology_Count_1
99 [Documentation] Count the routes in ${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader} and fail if the count is not correct as seen from node 1.
101 [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
102 PrefixCounting.Check_Ipv4_Topology_Count ${COUNT} session=${CONFIGURATION_1} topology=${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader}
104 Check_Talking_Ipv4_Topology_Count_2
105 [Documentation] Count the routes in ${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader} and fail if the count is not correct as seen from node 2.
107 [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
108 PrefixCounting.Check_Ipv4_Topology_Count ${COUNT} session=${CONFIGURATION_2} topology=${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader}
110 Check_Talking_Ipv4_Topology_Count_3
111 [Documentation] Count the routes in ${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader} and fail if the count is not correct as seen from node 3.
113 [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
114 PrefixCounting.Check_Ipv4_Topology_Count ${COUNT} session=${CONFIGURATION_3} topology=${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader}
116 Kill_Talking_BGP_Speaker
117 [Documentation] Abort the Python speaker. Also, attempt to stop failing fast.
119 [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
120 BGPSpeaker.Kill_BGP_Speaker
121 FailFast.Do_Not_Fail_Fast_From_Now_On
123 Wait_For_Stable_Ipv4_Topology_After_Listening_1
124 [Documentation] Wait until ${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader} becomes stable again as seen from node 1.
126 PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable timeout=${bgp_filling_timeout} period=${CHECK_PERIOD} repetitions=${REPETITIONS} excluded_count=${COUNT} session=${CONFIGURATION_1} topology=${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader}
128 Wait_For_Stable_Ipv4_Topology_After_Listening_2
129 [Documentation] Wait until ${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader} becomes stable again as seen from node 2.
131 PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable timeout=${bgp_filling_timeout} period=${CHECK_PERIOD} repetitions=${REPETITIONS} excluded_count=${COUNT} session=${CONFIGURATION_2} topology=${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader}
133 Wait_For_Stable_Ipv4_Topology_After_Listening_3
134 [Documentation] Wait until ${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader} becomes stable again as seen from node 3.
136 PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable timeout=${bgp_filling_timeout} period=${CHECK_PERIOD} repetitions=${REPETITIONS} excluded_count=${COUNT} session=${CONFIGURATION_3} topology=${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader}
138 Check_For_Empty_Ipv4_Topology_After_Listening_1
139 [Documentation] Example-ipv4-topology should be empty now as seen from node 1.
141 [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
142 PrefixCounting.Check_Ipv4_Topology_Is_Empty session=${CONFIGURATION_1} topology=${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader}
144 Check_For_Empty_Ipv4_Topology_After_Listening_2
145 [Documentation] Example-ipv4-topology should be empty now as seen from node 2.
147 [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
148 PrefixCounting.Check_Ipv4_Topology_Is_Empty session=${CONFIGURATION_2} topology=${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader}
150 Check_For_Empty_Ipv4_Topology_After_Listening_3
151 [Documentation] Example-ipv4-topology should be empty now as seen from node 3.
153 [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
154 PrefixCounting.Check_Ipv4_Topology_Is_Empty session=${CONFIGURATION_3} topology=${EXAMPLE_IPV4_TOPOLOGY_PREF}${dos_leader}
156 Delete_Bgp_Peer_Configuration
157 [Documentation] Revert the BGP configuration to the original state: without any configured peers.
158 [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
159 &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${BGP_PEER_NAME} IP=${TOOLS_SYSTEM_IP} HOLDTIME=${HOLDTIME} PEER_PORT=${BGP_TOOL_PORT}
160 ... INITIATE=false BGP_RIB=${RIB_INSTANCE}
161 TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER} mapping=${mapping} session=${CONFIG_SESSION}
163 Delete_Netconf_Device_Configuration
164 [Documentation] Revert the netconf configuration to the original stat
165 [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
166 &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} DEVICE_PORT=1830 DEVICE_IP=${default_oper_shard_leader_node_ip} DEVICE_USER=admin DEVICE_PASSWORD=admin
167 TemplatedRequests.Delete_Templated ${NETCONF_DEV_FOLDER} mapping=${mapping} session=${CONFIG_SESSION}