Пример #1
0
 def test_sync_base(self):
     sync = apic_sync.ApicBaseSynchronizer(self.driver)
     sync.core_plugin = mock.Mock()
     sync.core_plugin.get_networks.return_value = [{'id': 'net'}]
     sync.core_plugin.get_subnets.return_value = [{'id': 'sub'}]
     sync.core_plugin.get_ports.return_value = [{'id': 'port',
                                                 'network_id': 'net'}]
     sync.sync_base()
     self.assertEqual(1, self.driver.create_network_postcommit.call_count)
     self.assertEqual(1, self.driver.create_subnet_postcommit.call_count)
     self.assertEqual(1, self.get_locked_port_and_binding.call_count)
     self.assertEqual(1, self.driver.create_port_postcommit.call_count)
Пример #2
0
 def get_base_synchronizer(inst):
     apic_config = cfg.CONF.ml2_cisco_apic
     return apic_sync.ApicBaseSynchronizer(inst,
                                           apic_config.apic_sync_interval)