@@ -4260,6 +4260,7 @@ def verify_local_igmp_groups(tgen, dut, interface, group_addresses):
4260
4260
logger .debug ("Exiting lib API: {}" .format (sys ._getframe ().f_code .co_name ))
4261
4261
return True
4262
4262
4263
+
4263
4264
@retry (retry_timeout = 62 )
4264
4265
def verify_static_groups (tgen , dut , interface , group_addresses ):
4265
4266
"""
@@ -4293,7 +4294,9 @@ def verify_static_groups(tgen, dut, interface, group_addresses):
4293
4294
rnode = tgen .routers ()[dut ]
4294
4295
4295
4296
logger .info ("[DUT: %s]: Verifying static groups received:" , dut )
4296
- show_static_group_json = run_frr_cmd (rnode , "show ip igmp static-group json" , isjson = True )
4297
+ show_static_group_json = run_frr_cmd (
4298
+ rnode , "show ip igmp static-group json" , isjson = True
4299
+ )
4297
4300
4298
4301
if type (group_addresses ) is not list :
4299
4302
group_addresses = [group_addresses ]
@@ -4330,6 +4333,71 @@ def verify_static_groups(tgen, dut, interface, group_addresses):
4330
4333
logger .debug ("Exiting lib API: {}" .format (sys ._getframe ().f_code .co_name ))
4331
4334
return True
4332
4335
4336
+
4337
+ @retry (retry_timeout = 62 )
4338
+ def verify_local_igmp_proxy_groups (
4339
+ tgen , dut , group_addresses_present , group_addresses_not_present
4340
+ ):
4341
+ """
4342
+ Verify igmp proxy groups are as expected by running
4343
+ "show ip igmp static-group json" command
4344
+
4345
+ Parameters
4346
+ ----------
4347
+ * `tgen`: topogen object
4348
+ * `dut`: device under test
4349
+ * `group_addresses_present`: IGMP group addresses which should
4350
+ currently be proxied
4351
+ * `group_addresses_not_present`: IGMP group addresses which should
4352
+ not currently be proxied
4353
+
4354
+ Usage
4355
+ -----
4356
+ dut = "r1"
4357
+ group_addresses_present = "225.1.1.1"
4358
+ group_addresses_not_present = "225.2.2.2"
4359
+ result = verify_igmp_proxy_groups(tgen, dut, group_p, group_np)
4360
+
4361
+ Returns
4362
+ -------
4363
+ errormsg(str) or True
4364
+ """
4365
+
4366
+ if dut not in tgen .routers ():
4367
+ errormsg = "[DUT %s]: Device not found!"
4368
+ return errormsg
4369
+
4370
+ rnode = tgen .routers ()[dut ]
4371
+
4372
+ logger .info ("[DUT: %s]: Verifying local IGMP proxy groups:" , dut )
4373
+
4374
+ out = rnode .vtysh_cmd ("show ip igmp proxy json" , isjson = True )
4375
+ groups = [g ["group" ] if "group" in g else None for g in out ["r1-eth1" ]["groups" ]]
4376
+
4377
+ if type (group_addresses_present ) is not list :
4378
+ group_addresses_present = [group_addresses_present ]
4379
+ if type (group_addresses_not_present ) is not list :
4380
+ group_addresses_not_present = [group_addresses_not_present ]
4381
+
4382
+ for test_addr in group_addresses_present :
4383
+ if not test_addr in groups :
4384
+ errormsg = (
4385
+ "[DUT %s]: Verifying local IGMP proxy joins FAILED!! "
4386
+ " Expected but not found: %s " % (dut , test_addr )
4387
+ )
4388
+ return errormsg
4389
+
4390
+ for test_addr in group_addresses_not_present :
4391
+ if test_addr in groups :
4392
+ errormsg = (
4393
+ "[DUT %s]: Verifying local IGMP proxy join removed FAILED!! "
4394
+ " Unexpected but found: %s " % (dut , test_addr )
4395
+ )
4396
+ return errormsg
4397
+
4398
+ return True
4399
+
4400
+
4333
4401
def verify_pim_interface_traffic (tgen , input_dict , return_stats = True , addr_type = "ipv4" ):
4334
4402
"""
4335
4403
Verify ip pim interface traffic by running
0 commit comments