@@ -238,34 +238,6 @@ def printStats(self, pkt_send_count, recv_count, time_delta, tx_pps, rx_pps):
238
238
self .log ('RX PPS = %d' % rx_pps )
239
239
240
240
241
- class NoPolicyTest (ControlPlaneBaseTest ):
242
- def __init__ (self ):
243
- ControlPlaneBaseTest .__init__ (self )
244
- self .needPreSend = False
245
-
246
- def check_constraints (self , send_count , recv_count , time_delta_ms , rx_pps ):
247
- pkt_rx_limit = send_count * 0.90
248
-
249
- self .log ("" )
250
- self .log ("Checking constraints (NoPolicy):" )
251
- self .log (
252
- "rx_pps (%d) > NO_POLICER_LIMIT (%d): %s" %
253
- (int (rx_pps ), int (self .NO_POLICER_LIMIT ),
254
- str (rx_pps > self .NO_POLICER_LIMIT ))
255
- )
256
- self .log (
257
- "recv_count (%d) > pkt_rx_limit (%d): %s" %
258
- (int (recv_count ), int (pkt_rx_limit ), str (recv_count > pkt_rx_limit ))
259
- )
260
-
261
- if self .has_trap :
262
- assert (rx_pps > self .NO_POLICER_LIMIT )
263
- assert (recv_count > pkt_rx_limit )
264
- else :
265
- assert (rx_pps < self .NO_POLICER_LIMIT )
266
- assert (recv_count < pkt_rx_limit )
267
-
268
-
269
241
class PolicyTest (ControlPlaneBaseTest ):
270
242
def __init__ (self ):
271
243
ControlPlaneBaseTest .__init__ (self )
@@ -350,10 +322,10 @@ def contruct_packet(self, port_number):
350
322
return packet
351
323
352
324
353
- # SONIC configuration has no policer limiting for DHCP
354
- class DHCPTest (NoPolicyTest ):
325
+ # SONIC config contains policer CIR=300 for DHCP
326
+ class DHCPTest (PolicyTest ):
355
327
def __init__ (self ):
356
- NoPolicyTest .__init__ (self )
328
+ PolicyTest .__init__ (self )
357
329
358
330
def runTest (self ):
359
331
self .log ("DHCPTest" )
@@ -384,10 +356,10 @@ def contruct_packet(self, port_number):
384
356
return packet
385
357
386
358
387
- # SONIC configuration has no policer limiting for DHCPv6
388
- class DHCP6Test (NoPolicyTest ):
359
+ # SONIC config contains policer CIR=300 for DHCPv6
360
+ class DHCP6Test (PolicyTest ):
389
361
def __init__ (self ):
390
- NoPolicyTest .__init__ (self )
362
+ PolicyTest .__init__ (self )
391
363
392
364
def runTest (self ):
393
365
self .log ("DHCP6Test" )
@@ -436,12 +408,11 @@ def contruct_packet(self, port_number):
436
408
437
409
return packet
438
410
439
- # SONIC configuration has no policer limiting for LLDP
440
411
441
-
442
- class LLDPTest (NoPolicyTest ):
412
+ # SONIC config contains policer CIR=300 for LLDP
413
+ class LLDPTest (PolicyTest ):
443
414
def __init__ (self ):
444
- NoPolicyTest .__init__ (self )
415
+ PolicyTest .__init__ (self )
445
416
446
417
def runTest (self ):
447
418
self .log ("LLDPTest" )
@@ -459,10 +430,10 @@ def contruct_packet(self, port_number):
459
430
return packet
460
431
461
432
462
- # SONIC configuration has no policer limiting for UDLD
463
- class UDLDTest (NoPolicyTest ):
433
+ # SONIC config contains policer CIR=300 for UDLD
434
+ class UDLDTest (PolicyTest ):
464
435
def __init__ (self ):
465
- NoPolicyTest .__init__ (self )
436
+ PolicyTest .__init__ (self )
466
437
467
438
def runTest (self ):
468
439
self .log ("UDLDTest" )
@@ -485,10 +456,10 @@ def contruct_packet(self, port_number):
485
456
return packet
486
457
487
458
488
- # SONIC configuration has no policer limiting for BGP
489
- class BGPTest (NoPolicyTest ):
459
+ # SONIC config contains policer CIR=6000 for BGP
460
+ class BGPTest (PolicyTest ):
490
461
def __init__ (self ):
491
- NoPolicyTest .__init__ (self )
462
+ PolicyTest .__init__ (self )
492
463
493
464
def runTest (self ):
494
465
self .log ("BGPTest" )
@@ -508,10 +479,10 @@ def contruct_packet(self, port_number):
508
479
return packet
509
480
510
481
511
- # SONIC configuration has no policer limiting for LACP
512
- class LACPTest (NoPolicyTest ):
482
+ # SONIC config contains policer CIR=6000 for LACP
483
+ class LACPTest (PolicyTest ):
513
484
def __init__ (self ):
514
- NoPolicyTest .__init__ (self )
485
+ PolicyTest .__init__ (self )
515
486
516
487
def runTest (self ):
517
488
self .log ("LACPTest" )
0 commit comments