global BGP_CONVERGENCE
if BGP_CONVERGENCE != True:
- pytest.skip('skipped because of BGP Convergence failure')
+ pytest.skip("skipped because of BGP Convergence failure")
# test case name
tc_name = request.node.name
# Api call to modify AS number
input_dict = {
- "r1": {
- "bgp":{
- "local_as": 0,
- }
- },
- "r2": {
- "bgp":{
- "local_as": 0,
- }
- },
- "r3": {
- "bgp":{
- "local_as": 0,
- }
- },
- "r4": {
- "bgp":{
- "local_as": 64000,
- }
- }
+ "r1": {"bgp": {"local_as": 0,}},
+ "r2": {"bgp": {"local_as": 0,}},
+ "r3": {"bgp": {"local_as": 0,}},
+ "r4": {"bgp": {"local_as": 64000,}},
}
result = modify_as_number(tgen, topo, input_dict)
try:
global BGP_CONVERGENCE
if BGP_CONVERGENCE != True:
- pytest.skip('skipped because of BGP Convergence failure')
+ pytest.skip("skipped because of BGP Convergence failure")
# test case name
tc_name = request.node.name
# Api call to modify AS number
input_dict = {
- "r1": {
- "bgp":{
- "local_as": 131079
- }
- },
- "r2": {
- "bgp":{
- "local_as": 131079
- }
- },
- "r3": {
- "bgp":{
- "local_as": 131079
- }
- },
- "r4": {
- "bgp":{
- "local_as": 111
- }
- }
+ "r1": {"bgp": {"local_as": 131079}},
+ "r2": {"bgp": {"local_as": 131079}},
+ "r3": {"bgp": {"local_as": 131079}},
+ "r4": {"bgp": {"local_as": 111}},
}
result = modify_as_number(tgen, topo, input_dict)
if result != True:
- assert False, "Testcase " + tc_name + " :Failed \n Error: {}".\
- format(result)
+ assert False, "Testcase " + tc_name + " :Failed \n Error: {}".format(result)
result = verify_as_numbers(tgen, topo, input_dict)
if result != True:
- assert False, "Testcase " + tc_name + " :Failed \n Error: {}".\
- format(result)
+ assert False, "Testcase " + tc_name + " :Failed \n Error: {}".format(result)
# Api call verify whether BGP is converged
result = verify_bgp_convergence(tgen, topo)
if result != True:
- assert False, "Testcase " + tc_name + " :Failed \n Error: {}".\
- format(result)
+ assert False, "Testcase " + tc_name + " :Failed \n Error: {}".format(result)
write_test_footer(tc_name)
# Import topoJson from lib, to create topology and initial configuration
from lib.common_config import (
- start_topology, write_test_header,
- write_test_footer, reset_config_on_routers,
- verify_rib, create_static_routes,
- create_route_maps, check_address_types, step,
-)
-from lib.topolog import logger
-from lib.bgp import (
- verify_bgp_convergence, create_router_bgp,
- clear_bgp_and_verify, verify_bgp_rib
start_topology,
write_test_header,
write_test_footer,
#
#####################################################
+
def test_bgp_allowas_in_p0(request):
"""
Verify that routes coming from same AS are accepted only when
ipv6_data = set_data.setdefault("ipv6", {})
local_preference = set_data.setdefault("locPrf", None)
metric = set_data.setdefault("metric", None)
- as_path = set_data.setdefault("aspath", {})
+ as_path = set_data.setdefault("path", {})
weight = set_data.setdefault("weight", None)
community = set_data.setdefault("community", {})
large_community = set_data.setdefault("large_community", {})