Example #1
0
 def testBrokenMeter(self, meter_cls):
     config = {
         "redis_enabled": False,
         "qos": {
             "enable": True,
             "max_rate": 10000000,
             "ovs_meter": {"min_idx": 2, "max_idx": 100000},
         },
     }
     m = MeterManager(None, asyncio.new_event_loop(), config)
     self.assertTrue(meter_cls.dump_meter_features.called)
     MockSt = namedtuple("MockSt", "max_meter")
     m.handle_meter_feature_stats([MockSt(0)])
     try:
         m.add_qos(0, QosInfo(100000, 100000), cleanup_rule=None)
         self.fail("unexpectedly add_qos succeeded")
     except RuntimeError:
         pass
Example #2
0
 def testBrokenMeter(self, meter_cls):
     config = {
         'qos': {
             'enable': True,
             'max_rate': 10000000,
             'ovs_meter': {
                 'min_idx': 2,
                 'max_idx': 100000,
             },
         },
     }
     m = MeterManager(None, asyncio.new_event_loop(), config)
     self.assertTrue(meter_cls.dump_meter_features.called)
     MockSt = namedtuple("MockSt", "max_meter")
     m.handle_meter_feature_stats([MockSt(0)])
     try:
         m.add_qos(0, QosInfo(100000, 100000))
         self.fail("unexpectedly add_qos succeeded")
     except RuntimeError:
         pass