@@ -1211,6 +1211,52 @@ def test_large_community_after_clear_bgp(request):
12111211 write_test_footer (tc_name )
12121212
12131213
1214+ def test_large_community_buffer_limit (request ):
1215+ """
1216+ Verify that setting 150 large communities with maximum sized values
1217+ (approximately 4770 bytes) works properly. This tests the buffer limit
1218+ increase from 4096 to 8192 bytes.
1219+ """
1220+ tc_name = request .node .name
1221+ write_test_header (tc_name )
1222+ tgen = get_topogen ()
1223+
1224+ if tgen .routers_have_failure ():
1225+ pytest .skip (tgen .errors )
1226+
1227+ # Generate 150 large communities with maximum sized values (4294967295:4294967295:4294967XXX)
1228+ # Each community is approximately 31 bytes, total ~4770 bytes
1229+ large_comm_values = []
1230+ for i in range (1 , 151 ):
1231+ large_comm_values .append ("4294967295:4294967295:{}" .format (4294967000 + i ))
1232+
1233+ large_comm_str = " " .join (large_comm_values )
1234+
1235+ step ("Configuring route-map with 150 large communities (~4770 bytes)" )
1236+ router = tgen .gears ["r1" ]
1237+ cmd = "configure terminal\n "
1238+ cmd += "route-map LARGE_COMM_150 permit 10\n "
1239+ cmd += "set large-community {}\n " .format (large_comm_str )
1240+ cmd += "exit\n "
1241+
1242+ try :
1243+ output = router .vtysh_cmd (cmd )
1244+ step ("Successfully applied configuration" )
1245+ except Exception as e :
1246+ step ("Configuration failed (may indicate buffer limit issue): {}" .format (str (e )))
1247+ pytest .fail ("Failed to configure 150 large communities - buffer limit may be too small" )
1248+
1249+ step ("Verifying route-map configuration with 150 large communities" )
1250+ output = router .vtysh_cmd ("show running-config" )
1251+ assert "route-map LARGE_COMM_150 permit 10" in output , \
1252+ "Test case {} : Failed - route-map not found in configuration" .format (tc_name )
1253+ assert "4294967295:4294967295" in output , \
1254+ "Test case {} : Failed - large communities not found in configuration" .format (tc_name )
1255+
1256+ step ("Test passed: Successfully configured 150 large communities (~4770 bytes)" )
1257+ write_test_footer (tc_name )
1258+
1259+
12141260if __name__ == "__main__" :
12151261 args = ["-s" ] + sys .argv [1 :]
12161262 sys .exit (pytest .main (args ))
0 commit comments