2 # SPDX-License-Identifier: ISC
5 # Copyright (c) 2019 by VMware, Inc. ("VMware")
6 # Used Copyright (c) 2018 by Network Device Education Foundation,
7 # Inc. ("NetDEF") in this file.
12 Following tests are covered to test large-community/community functionality:
13 1. Verify if large community attribute can be configured only in correct
15 2. Verify that the community attribute value, which we have advertised are
16 received in correct format and values, at the receiving end.
17 3. Verify BGP Large Community attribute"s transitive property attribute.
18 4. Verify that BGP Large Communities attribute are malformed, if the length of
19 the BGP Large Communities Attribute value, expressed in octets,
20 is not a non-zero multiple of 12.
21 5. Verify if overriding large community values works fine.
22 6. Verify that large community values" aggregation works fine.
23 7. Standard community also work fine in conjunction with large-community.
24 8. Matching prefixes based on attributes other than prefix list and make use
26 9. Matching prefixes based on attributes other than prefix list and make use
28 10. Verify community and large-community list operations in route-map with all
29 clause (exact, all, any, regex) works.
30 11. Verify that any value in BGP Large communities for boundary values.
31 12. Clear BGP neighbor-ship and check if large community and community
32 attributes are getting re-populated.
38 from os
import path
as os_path
41 # Required to instantiate the topology builder class.
42 from lib
.topogen
import Topogen
, get_topogen
44 from lib
.common_config
import (
48 reset_config_on_routers
,
50 create_bgp_community_lists
,
55 required_linux_kernel_version
,
57 from lib
.topolog
import logger
58 from lib
.bgp
import verify_bgp_convergence
, create_router_bgp
, clear_bgp_and_verify
59 from lib
.topojson
import build_config_from_json
61 pytestmark
= [pytest
.mark
.bgpd
]
64 # Save the Current Working Directory to find configuration files.
65 CWD
= os_path
.dirname(os_path
.realpath(__file__
))
66 sys
.path
.append(os_path
.join(CWD
, "../"))
67 sys
.path
.append(os_path
.join(CWD
, "../lib/"))
71 bgp_convergence
= False
73 "ipv4": ["200.50.2.0", "200.50.2.1", "200.50.2.0"],
74 "ipv6": ["1::1", "1::2", "1::0"],
76 MASK
= {"ipv4": "32", "ipv6": "128"}
77 NET_MASK
= {"ipv4": "24", "ipv6": "120"}
78 IPV4_NET
= ["200.50.2.0"]
80 CONFIG_ROUTER_R1
= False
81 CONFIG_ROUTER_R2
= False
82 CONFIG_ROUTER_ADDITIVE
= False
85 "r1": "1:1:1 1:2:1 1:3:1 1:4:1 1:5:1",
86 "r2": "2:1:1 2:2:1 2:3:1 2:4:1 2:5:1",
87 "mal_1": "1:1 1:2 1:3 1:4 1:5",
88 "pf_list_1": "0:0:1 0:0:10 0:0:100",
89 "pf_list_2": "0:0:2 0:0:20 0:0:200",
90 "agg_1": "0:0:1 0:0:2 0:0:10 0:0:20 0:0:100 0:0:200 2:1:1 "
91 "2:2:1 2:3:1 2:4:1 2:5:1",
92 "agg_2": "0:0:2 0:0:20 0:0:200 2:1:1 " "2:2:1 2:3:1 2:4:1 2:5:1",
95 "r1": "1:1 1:2 1:3 1:4 1:5",
96 "r2": "2:1 2:2 2:3 2:4 2:5",
98 "pf_list_1": "0:1 0:10 0:100",
99 "pf_list_2": "0:2 0:20 0:200",
100 "agg_1": "0:1 0:2 0:10 0:20 0:100 0:200 2:1 2:2 2:3 2:4 2:5",
101 "agg_2": "0:2 0:20 0:200 2:1 2:2 2:3 2:4 2:5",
105 def setup_module(mod
):
107 Sets up the pytest environment
111 # Required linux kernel version for this suite to run.
112 result
= required_linux_kernel_version("4.15")
113 if result
is not True:
114 pytest
.skip("Kernel requirements are not met")
117 testsuite_run_time
= time
.asctime(time
.localtime(time
.time()))
118 logger
.info("Testsuite start time: {}".format(testsuite_run_time
))
119 logger
.info("=" * 40)
121 logger
.info("Running setup_module to create topology")
123 # This function initiates the topology build with Topogen...
124 json_file
= "{}/bgp_large_community_topo_1.json".format(CWD
)
125 tgen
= Topogen(json_file
, mod
.__name
__)
127 topo
= tgen
.json_topo
128 # ... and here it calls Mininet initialization functions.
130 # Starting topology, create tmp files which are loaded to routers
131 # to start daemons and then start routers
134 # Creating configuration from JSON
135 build_config_from_json(tgen
, topo
)
137 # Checking BGP convergence
138 global bgp_convergence
140 # Don"t run this test if we have any failure.
141 if tgen
.routers_have_failure():
142 pytest
.skip(tgen
.errors
)
145 # Api call verify whether BGP is converged
146 bgp_convergence
= verify_bgp_convergence(tgen
, topo
)
147 assert bgp_convergence
is True, "setup_module :Failed \n Error:" " {}".format(
151 ADDR_TYPES
= check_address_types()
152 logger
.info("Running setup_module() done")
155 def teardown_module():
157 Teardown the pytest environment
162 logger
.info("Running teardown_module to delete topology")
166 # Stop toplogy and Remove tmp files
170 "Testsuite end time: {}".format(time
.asctime(time
.localtime(time
.time())))
172 logger
.info("=" * 40)
175 def config_router_r1(tgen
, topo
, tc_name
):
176 global CONFIG_ROUTER_R1
186 "large_community": {"num": LARGE_COMM
["r1"]},
187 "community": {"num": STANDARD_COMM
["r1"]},
195 step("Configuring LC1 on r1")
196 result
= create_route_maps(tgen
, input_dict_1
)
197 assert result
is True, "Test case {} : Failed \n Error: {}".format(tc_name
, result
)
199 # Configure neighbor for route map
206 "advertise_networks": [
209 % (NETWORK
["ipv4"][0], MASK
["ipv4"]),
218 {"name": "LC1", "direction": "out"}
227 {"name": "LC1", "direction": "out"}
237 "advertise_networks": [
240 % (NETWORK
["ipv6"][0], MASK
["ipv6"]),
249 {"name": "LC1", "direction": "out"}
258 {"name": "LC1", "direction": "out"}
271 step("Applying LC1 on r1 neighbors and advertising networks")
272 result
= create_router_bgp(tgen
, topo
, input_dict_2
)
273 assert result
is True, "Test case {} : Failed \n Error: {}".format(tc_name
, result
)
275 CONFIG_ROUTER_R1
= True
278 def config_router_r2(tgen
, topo
, tc_name
):
279 global CONFIG_ROUTER_R2
289 "large_community": {"num": LARGE_COMM
["r2"]},
290 "community": {"num": STANDARD_COMM
["r2"]},
298 step("Configuring route-maps LC2 on r2")
299 result
= create_route_maps(tgen
, input_dict
)
300 assert result
is True, "Test case {} : Failed \n Error: {}".format(tc_name
, result
)
313 {"name": "LC2", "direction": "out"}
328 {"name": "LC2", "direction": "out"}
341 step("Applying LC2 on r2 neighbors in out direction")
342 result
= create_router_bgp(tgen
, topo
, input_dict_1
)
343 assert result
is True, "Test case {} : Failed \n Error: {}".format(tc_name
, result
)
345 CONFIG_ROUTER_R2
= True
348 def config_router_additive(tgen
, topo
, tc_name
):
349 global CONFIG_ROUTER_ADDITIVE
360 "num": LARGE_COMM
["r2"],
361 "action": "additive",
364 "num": STANDARD_COMM
["r2"],
365 "action": "additive",
374 step("Configuring LC2 with community attributes as additive")
375 result
= create_route_maps(tgen
, input_dict
)
376 assert result
is True, "Test case {} : Failed \n Error: {}".format(tc_name
, result
)
379 CONFIG_ROUTER_ADDITIVE
= True
382 def config_for_as_path(tgen
, topo
, tc_name
):
383 config_router_r1(tgen
, topo
, tc_name
)
385 config_router_r2(tgen
, topo
, tc_name
)
387 # Create ipv6 prefix list
395 "network": "%s/%s" % (NETWORK
["ipv4"][0], MASK
["ipv4"]),
402 "network": "%s/%s" % (NETWORK
["ipv4"][1], MASK
["ipv4"]),
411 "network": "%s/%s" % (NETWORK
["ipv6"][0], MASK
["ipv6"]),
418 "network": "%s/%s" % (NETWORK
["ipv6"][1], MASK
["ipv6"]),
427 step("Configuring prefix-lists on r1 to filter networks")
428 result
= create_prefix_lists(tgen
, input_dict_1
)
429 assert result
is True, "Test case {} : Failed \n Error: {}".format(tc_name
, result
)
438 "match": {"ipv4": {"prefix_lists": "pf_list_1"}},
440 "large_community": {"num": LARGE_COMM
["pf_list_1"]},
441 "community": {"num": STANDARD_COMM
["pf_list_1"]},
447 "match": {"ipv6": {"prefix_lists": "pf_list_3"}},
449 "large_community": {"num": LARGE_COMM
["pf_list_1"]},
450 "community": {"num": STANDARD_COMM
["pf_list_1"]},
456 "match": {"ipv4": {"prefix_lists": "pf_list_2"}},
458 "large_community": {"num": LARGE_COMM
["pf_list_2"]},
459 "community": {"num": STANDARD_COMM
["pf_list_2"]},
465 "match": {"ipv6": {"prefix_lists": "pf_list_4"}},
467 "large_community": {"num": LARGE_COMM
["pf_list_2"]},
468 "community": {"num": STANDARD_COMM
["pf_list_2"]},
477 "Applying prefix-lists match in route-map LC1 on r1. Setting"
478 " community attritbute for filtered networks"
480 result
= create_route_maps(tgen
, input_dict_2
)
481 assert result
is True, "Test case {} : Failed \n Error: {}".format(tc_name
, result
)
483 config_router_additive(tgen
, topo
, tc_name
)
487 "bgp_community_lists": [
489 "community_type": "standard",
492 "value": LARGE_COMM
["pf_list_1"],
496 "community_type": "standard",
499 "value": STANDARD_COMM
["pf_list_1"],
505 step("Configuring bgp community lists on r4")
506 result
= create_bgp_community_lists(tgen
, input_dict_3
)
507 assert result
is True, "Test case {} : Failed \n Error: {}".format(tc_name
, result
)
517 "large_community_list": {"id": "ANY"},
518 "community_list": {"id": "ANY"},
520 "set": {"path": {"as_num": "4000000", "as_action": "prepend"}},
527 step("Applying community list on route-map on r4")
528 result
= create_route_maps(tgen
, input_dict_4
)
529 assert result
is True, "Test case {} : Failed \n Error: {}".format(tc_name
, result
)
542 {"name": "LC4", "direction": "out"}
557 {"name": "LC4", "direction": "out"}
570 step("Applying route-map LC4 out from r4 to r5 ")
571 result
= create_router_bgp(tgen
, topo
, input_dict_5
)
572 assert result
is True, "Test case {} : Failed \n Error: {}".format(tc_name
, result
)
575 #####################################################
579 #####################################################
580 def test_large_community_set(request
):
582 Verify if large community attribute can be configured only in correct
585 tc_name
= request
.node
.name
586 write_test_header(tc_name
)
589 # Don"t run this test if we have any failure.
590 if tgen
.routers_have_failure():
591 pytest
.skip(tgen
.errors
)
593 # API call to modify router id
594 # input_dict dictionary to be provided to configure route_map
603 "large_community": {"num": LARGE_COMM
["r1"]},
604 "community": {"num": STANDARD_COMM
["r1"]},
612 step("Trying to set bgp communities")
613 result
= create_route_maps(tgen
, input_dict
)
614 assert result
is True, "Test case {} : Failed \n Error: {}".format(tc_name
, result
)
616 write_test_footer(tc_name
)
619 def test_large_community_advertise(request
):
621 Verify that the community attribute value, which we have advertised are
622 received in correct format and values, at the receiving end.
624 tc_name
= request
.node
.name
625 write_test_header(tc_name
)
628 # Don"t run this test if we have any failure.
629 if tgen
.routers_have_failure():
630 pytest
.skip(tgen
.errors
)
632 reset_config_on_routers(tgen
)
633 config_router_r1(tgen
, topo
, tc_name
)
636 "largeCommunity": LARGE_COMM
["r1"],
637 "community": STANDARD_COMM
["r1"],
640 for adt
in ADDR_TYPES
:
641 result
= verify_bgp_community(tgen
, adt
, "r2", [NETWORK
[adt
][0]], input_dict
)
642 assert result
is True, "Test case {} : Failed \n Error: {}".format(
646 result
= verify_bgp_community(tgen
, adt
, "r3", [NETWORK
[adt
][0]], input_dict
)
647 assert result
is True, "Test case {} : Failed \n Error: {}".format(
651 write_test_footer(tc_name
)
654 def test_large_community_transitive(request
):
656 Verify BGP Large Community attribute"s transitive property attribute.
658 tc_name
= request
.node
.name
659 write_test_header(tc_name
)
662 # Don"t run this test if we have any failure.
663 if tgen
.routers_have_failure():
664 pytest
.skip(tgen
.errors
)
666 reset_config_on_routers(tgen
)
668 config_router_r1(tgen
, topo
, tc_name
)
671 "largeCommunity": LARGE_COMM
["r1"],
672 "community": STANDARD_COMM
["r1"],
675 for adt
in ADDR_TYPES
:
676 result
= verify_bgp_community(tgen
, adt
, "r4", [NETWORK
[adt
][0]], input_dict_1
)
677 assert result
is True, "Test case {} : Failed \n Error: {}".format(
681 write_test_footer(tc_name
)
684 def test_large_community_override(request
):
686 Verify if overriding large community values works fine.
688 tc_name
= request
.node
.name
689 write_test_header(tc_name
)
692 # Don"t run this test if we have any failure.
693 if tgen
.routers_have_failure():
694 pytest
.skip(tgen
.errors
)
696 reset_config_on_routers(tgen
)
697 config_router_r1(tgen
, topo
, tc_name
)
699 config_router_r2(tgen
, topo
, tc_name
)
702 "largeCommunity": LARGE_COMM
["r2"],
703 "community": STANDARD_COMM
["r2"],
706 for adt
in ADDR_TYPES
:
707 result
= verify_bgp_community(tgen
, adt
, "r4", [NETWORK
[adt
][1]], input_dict_3
)
708 assert result
is True, "Test case {} : Failed \n Error: {}".format(
712 write_test_footer(tc_name
)
715 def test_large_community_additive(request
):
717 Verify that large community values" aggregation works fine.
719 tc_name
= request
.node
.name
720 write_test_header(tc_name
)
723 # Don"t run this test if we have any failure.
724 if tgen
.routers_have_failure():
725 pytest
.skip(tgen
.errors
)
727 reset_config_on_routers(tgen
)
728 config_router_r1(tgen
, topo
, tc_name
)
730 config_router_r2(tgen
, topo
, tc_name
)
732 config_router_additive(tgen
, topo
, tc_name
)
735 "largeCommunity": "%s %s" % (LARGE_COMM
["r1"], LARGE_COMM
["r2"]),
736 "community": "%s %s" % (STANDARD_COMM
["r1"], STANDARD_COMM
["r2"]),
739 for adt
in ADDR_TYPES
:
740 result
= verify_bgp_community(tgen
, adt
, "r4", [NETWORK
[adt
][0]], input_dict_1
)
741 assert result
is True, "Test case {} : Failed \n Error: {}".format(
745 write_test_footer(tc_name
)
748 def test_large_community_match_as_path(request
):
750 Matching prefixes based on attributes other than prefix list and make use
754 tc_name
= request
.node
.name
755 write_test_header(tc_name
)
758 # Don"t run this test if we have any failure.
759 if tgen
.routers_have_failure():
760 pytest
.skip(tgen
.errors
)
762 reset_config_on_routers(tgen
)
763 config_for_as_path(tgen
, topo
, tc_name
)
766 "largeCommunity": "%s %s" % (LARGE_COMM
["pf_list_1"], LARGE_COMM
["r2"]),
767 "community": "%s %s" % (STANDARD_COMM
["pf_list_1"], STANDARD_COMM
["r2"]),
771 "largeCommunity": "%s %s" % (LARGE_COMM
["pf_list_2"], LARGE_COMM
["r2"]),
772 "community": "%s %s" % (STANDARD_COMM
["pf_list_2"], STANDARD_COMM
["r2"]),
775 for adt
in ADDR_TYPES
:
776 result
= verify_bgp_community(tgen
, adt
, "r5", [NETWORK
[adt
][0]], input_dict
)
777 assert result
is True, "Test case {} : Failed \n Error: {}".format(
781 result
= verify_bgp_community(
782 tgen
, adt
, "r5", [NETWORK
[adt
][1]], input_dict_1
, expected
=False
785 assert result
is not True, "Test case {} : Should fail \n Error: {}".format(
789 write_test_footer(tc_name
)
792 def test_large_community_match_all(request
):
794 Verify community and large-community list operations in route-map with all
795 clause (exact, all, any, regex) works.
797 tc_name
= request
.node
.name
798 write_test_header(tc_name
)
801 # Don"t run this test if we have any failure.
802 if tgen
.routers_have_failure():
803 pytest
.skip(tgen
.errors
)
805 reset_config_on_routers(tgen
)
806 config_router_r1(tgen
, topo
, tc_name
)
808 config_router_r2(tgen
, topo
, tc_name
)
810 config_router_additive(tgen
, topo
, tc_name
)
814 "bgp_community_lists": [
816 "community_type": "standard",
823 "community_type": "standard",
826 "value": "1:1:1 1:2:1 1:3:1 1:4:1 1:5:1 2:1:1 2:2:1",
830 "community_type": "expanded",
833 "value": "1:1:1 1:2:1 1:3:1 1:4:1 1:5:1 2:[1-5]:1",
840 step("Create bgp community lists for ANY, EXACT and EXP_ALL match")
842 result
= create_bgp_community_lists(tgen
, input_dict_1
)
843 assert result
is True, "Test case {} : Failed \n Error: {}".format(tc_name
, result
)
852 "match": {"large-community-list": {"id": "ANY"}},
857 "match": {"large-community-list": {"id": "EXACT"}},
862 "match": {"large-community-list": {"id": "EXP_ALL"}},
869 step("Applying bgp community lits on LC4 route-map")
870 result
= create_route_maps(tgen
, input_dict_2
)
871 assert result
is True, "Test case {} : Failed \n Error: {}".format(tc_name
, result
)
884 {"name": "LC4", "direction": "in"}
899 {"name": "LC4", "direction": "in"}
912 step("Apply route-mpa LC4 on r4 for r2 neighbor, direction 'in'")
914 result
= create_router_bgp(tgen
, topo
, input_dict_3
)
915 assert result
is True, "Test case {} : Failed \n Error: {}".format(tc_name
, result
)
918 "largeCommunity": "1:1:1 1:2:1 1:3:1 1:4:1 1:5:1 2:1:1 2:2:1 2:3:1 "
922 for adt
in ADDR_TYPES
:
923 result
= verify_bgp_community(tgen
, adt
, "r4", [NETWORK
[adt
][0]], input_dict_4
)
924 assert result
is True, "Test case {} : Should fail \n Error: {}".format(
928 write_test_footer(tc_name
)
931 # @pytest.mark.skip(reason="as-set not working for ipv6")
932 def test_large_community_aggregate_network(request
):
934 Restart router and check if large community and community
935 attributes are getting re-populated.
938 tc_name
= request
.node
.name
939 write_test_header(tc_name
)
943 # Don"t run this test if we have any failure.
944 if tgen
.routers_have_failure():
945 pytest
.skip(tgen
.errors
)
947 reset_config_on_routers(tgen
)
949 config_for_as_path(tgen
, topo
, tc_name
)
952 "community": STANDARD_COMM
["agg_1"],
953 "largeCommunity": LARGE_COMM
["agg_1"],
962 "aggregate_address": [
965 % (NETWORK
["ipv4"][2], NET_MASK
["ipv4"]),
973 "aggregate_address": [
976 % (NETWORK
["ipv6"][2], NET_MASK
["ipv6"]),
987 step("Configuring aggregate address as-set on r2")
988 result
= create_router_bgp(tgen
, topo
, input_dict_1
)
989 assert result
is True, "Test case {} : Failed \n Error: {}".format(tc_name
, result
)
991 for adt
in ADDR_TYPES
:
992 result
= verify_bgp_community(
993 tgen
, adt
, "r4", ["%s/%s" % (NETWORK
[adt
][2], NET_MASK
[adt
])], input_dict
995 assert result
is True, "Test case {} : Failed \n Error: {}".format(
1005 "advertise_networks": [
1008 % (NETWORK
["ipv4"][0], MASK
["ipv4"]),
1017 "advertise_networks": [
1020 % (NETWORK
["ipv6"][0], MASK
["ipv6"]),
1032 step("Stop advertising one of the networks")
1033 result
= create_router_bgp(tgen
, topo
, input_dict_2
)
1034 assert result
is True, "Test case {} : Failed \n Error: {}".format(tc_name
, result
)
1037 "community": STANDARD_COMM
["agg_2"],
1038 "largeCommunity": LARGE_COMM
["agg_2"],
1041 for adt
in ADDR_TYPES
:
1042 step("Verifying bgp community values on r5 is also modified")
1043 result
= verify_bgp_community(
1044 tgen
, adt
, "r4", ["%s/%s" % (NETWORK
[adt
][2], NET_MASK
[adt
])], input_dict_3
1046 assert result
is True, "Test case {} : Failed \n Error: {}".format(
1050 write_test_footer(tc_name
)
1053 def test_large_community_boundary_values(request
):
1055 Verify that any value in BGP Large communities for boundary values.
1057 tc_name
= request
.node
.name
1058 write_test_header(tc_name
)
1059 tgen
= get_topogen()
1061 # Don"t run this test if we have any failure.
1062 if tgen
.routers_have_failure():
1063 pytest
.skip(tgen
.errors
)
1067 "bgp_community_lists": [
1069 "community_type": "standard",
1078 step("Checking boundary value for community 0:-1")
1079 result
= create_bgp_community_lists(tgen
, input_dict
)
1080 assert result
is not True, "Test case {} : Failed \n Error: {}".format(
1084 step("Checking community attribute 0:65536")
1087 "bgp_community_lists": [
1089 "community_type": "standard",
1098 step("Checking boundary value for community 0:65536")
1099 result
= create_bgp_community_lists(tgen
, input_dict_2
)
1100 assert result
is not True, "Test case {} : Failed \n Error: {}".format(
1104 step("Checking boundary value for community 0:4294967296")
1107 "bgp_community_lists": [
1109 "community_type": "standard",
1112 "value": "0:4294967296",
1119 result
= create_bgp_community_lists(tgen
, input_dict_3
)
1120 assert result
is not True, "Test case {} : Failed \n Error: {}".format(
1123 step("Checking boundary value for community 0:-1:1")
1127 "bgp_community_lists": [
1129 "community_type": "standard",
1139 result
= create_bgp_community_lists(tgen
, input_dict_4
)
1140 assert result
is not True, "Test case {} : Failed \n Error: {}".format(
1145 def test_large_community_invalid_chars(request
):
1147 BGP canonical lcommunities must only be digits
1149 tc_name
= request
.node
.name
1150 write_test_header(tc_name
)
1151 tgen
= get_topogen()
1153 # Don"t run this test if we have any failure.
1154 if tgen
.routers_have_failure():
1155 pytest
.skip(tgen
.errors
)
1159 "bgp_community_lists": [
1161 "community_type": "standard",
1171 step("Checking boundary value for community 1:a:2")
1172 result
= create_bgp_community_lists(tgen
, input_dict
)
1173 assert result
is not True, "Test case {} : Failed \n Error: {}".format(
1178 def test_large_community_after_clear_bgp(request
):
1180 Clear BGP neighbor-ship and check if large community and community
1181 attributes are getting re-populated.
1183 tc_name
= request
.node
.name
1184 write_test_header(tc_name
)
1185 tgen
= get_topogen()
1187 # Don"t run this test if we have any failure.
1188 if tgen
.routers_have_failure():
1189 pytest
.skip(tgen
.errors
)
1191 reset_config_on_routers(tgen
)
1192 config_router_r1(tgen
, topo
, tc_name
)
1194 input_dict
= {"largeCommunity": LARGE_COMM
["r1"], "community": STANDARD_COMM
["r1"]}
1196 for adt
in ADDR_TYPES
:
1197 result
= verify_bgp_community(tgen
, adt
, "r2", [NETWORK
[adt
][0]], input_dict
)
1198 assert result
is True, "Test case {} : Failed \n Error: {}".format(
1202 step("Clearing BGP on r1")
1203 clear_bgp_and_verify(tgen
, topo
, "r1")
1205 for adt
in ADDR_TYPES
:
1206 result
= verify_bgp_community(tgen
, adt
, "r2", [NETWORK
[adt
][0]], input_dict
)
1207 assert result
is True, "Test case {} : Failed \n Error: {}".format(
1211 write_test_footer(tc_name
)
1214 if __name__
== "__main__":
1215 args
= ["-s"] + sys
.argv
[1:]
1216 sys
.exit(pytest
.main(args
))