def setUp(self): super(TestOVNQosDriver, self).setUp() self.plugin = mock.Mock() self.ovn_client = mock.Mock() self.driver = qos_driver.OVNQosDriver(self.ovn_client) self.driver._plugin_property = self.plugin self.port_id = uuidutils.generate_uuid() self.policy_id = uuidutils.generate_uuid() self.network_id = uuidutils.generate_uuid() self.network_policy_id = uuidutils.generate_uuid() self.policy = self._create_fake_policy() self.port = self._create_fake_port() self.rule = self._create_bw_limit_rule() self.expected = {'qos_max_rate': '1000', 'qos_burst': '100000'}
def initialize(self): """Perform driver initialization. Called after all drivers have been loaded and the database has been initialized. No abstract methods defined below will be called prior to this method being called. """ LOG.info(_LI("Starting OVNMechanismDriver")) self._nb_ovn = None self._sb_ovn = None self._plugin_property = None self.sg_enabled = ovn_acl.is_sg_enabled() if cfg.CONF.SECURITYGROUP.firewall_driver: LOG.warning(_LW('Firewall driver configuration is ignored')) self._setup_vif_port_bindings() self.subscribe() self.qos_driver = qos_driver.OVNQosDriver(self)