def setUp(self): n_config.parse(['--config-file', VCNS_CONFIG_FILE]) # mock vcns self.fc2 = fake_vcns.FakeVcns(unique_router_name=False) self.mock_vcns = mock.patch(VCNS_NAME, autospec=True) self.vcns_loadbalancer_patch() self.nvp_service_plugin_callback = mock.Mock() self.driver = vcns_driver.VcnsDriver(self.nvp_service_plugin_callback) super(VcnsDriverTestCase, self).setUp() self.addCleanup(self.fc2.reset_all) self.addCleanup(self.mock_vcns.stop)
def setUp(self): super(VcnsDriverTestCase, self).setUp() n_config.parse(['--config-file', VCNS_CONFIG_FILE]) self.fc = fake_vcns.FakeVcns() self.mock_vcns = mock.patch(VCNS_NAME, autospec=True) self.vcns_patch() self.addCleanup(self.fc.reset_all) self.addCleanup(self.mock_vcns.stop) self.vcns_driver = vcns_driver.VcnsDriver(self) self.edge_id = None self.result = None
def setUp(self, ext_mgr=None, service_plugins=None): cfg.CONF.set_override('api_extensions_path', NVPEXT_PATH) cfg.CONF.set_override('task_status_check_interval', 100, group="vcns") # vcns does not support duplicated router name, ignore router name # validation for unit-test cases self.fc2 = fake_vcns.FakeVcns(unique_router_name=False) self.mock_vcns = mock.patch(VCNS_NAME, autospec=True) self.vcns_patch() mock_proxy = mock.patch( "%s.%s" % (SERVICE_PLUGIN_NAME, '_set_create_lswitch_proxy')) mock_proxy.start() ext_mgr = ext_mgr or ServiceRouterTestExtensionManager() super(ServiceRouterTest, self).setUp(plugin=SERVICE_PLUGIN_NAME, service_plugins=service_plugins, ext_mgr=ext_mgr) self.fc2.set_fake_nvpapi(self.fc) self.addCleanup(self.fc2.reset_all) self.addCleanup(mock.patch.stopall)