diff --git a/tricircle/db/core.py b/tricircle/db/core.py index fb754607..dbf9b283 100644 --- a/tricircle/db/core.py +++ b/tricircle/db/core.py @@ -151,7 +151,7 @@ def get_session(expire_on_commit=False): def initialize(): db_options.set_defaults( cfg.CONF, - connection='sqlite:///:memory:') + connection='sqlite://') def query_resource(context, model, filters, sorts): diff --git a/tricircle/tests/functional/api/controllers/test_job.py b/tricircle/tests/functional/api/controllers/test_job.py index 9d980962..0f3a967a 100755 --- a/tricircle/tests/functional/api/controllers/test_job.py +++ b/tricircle/tests/functional/api/controllers/test_job.py @@ -62,7 +62,7 @@ class API_FunctionalTest(base.TestCase): self.CONF = self.useFixture(fixture_config.Config()).conf self.CONF.set_override('auth_strategy', 'noauth') - self.CONF.set_override('tricircle_db_connection', 'sqlite:///:memory:') + self.CONF.set_override('tricircle_db_connection', 'sqlite://') core.initialize() core.ModelBase.metadata.create_all(core.get_engine()) diff --git a/tricircle/tests/functional/api/controllers/test_pod.py b/tricircle/tests/functional/api/controllers/test_pod.py index f7387dc9..7b12da01 100644 --- a/tricircle/tests/functional/api/controllers/test_pod.py +++ b/tricircle/tests/functional/api/controllers/test_pod.py @@ -55,7 +55,7 @@ class API_FunctionalTest(base.TestCase): self.CONF = self.useFixture(fixture_config.Config()).conf self.CONF.set_override('auth_strategy', 'noauth') - self.CONF.set_override('tricircle_db_connection', 'sqlite:///:memory:') + self.CONF.set_override('tricircle_db_connection', 'sqlite://') core.initialize() core.ModelBase.metadata.create_all(core.get_engine()) diff --git a/tricircle/tests/unit/network/test_central_plugin.py b/tricircle/tests/unit/network/test_central_plugin.py index 73349338..896299a8 100644 --- a/tricircle/tests/unit/network/test_central_plugin.py +++ b/tricircle/tests/unit/network/test_central_plugin.py @@ -3178,31 +3178,6 @@ class PluginTest(unittest.TestCase, self.assertEqual(top_res_nums[i] - top_pre_created_res_nums[i], len(top_res_set)) - @patch.object(context, 'get_context_from_neutron_context') - def test_create_security_group_rule(self, mock_context): - self._basic_pod_route_setup() - - fake_plugin = FakePlugin() - q_ctx = FakeNeutronContext() - t_ctx = context.get_db_context() - mock_context.return_value = t_ctx - - self._test_create_security_group_rule(fake_plugin, q_ctx, t_ctx, - 'pod_id_1', TOP_SGS, BOTTOM1_SGS) - - @patch.object(context, 'get_context_from_neutron_context') - def test_delete_security_group_rule(self, mock_context): - self._basic_pod_route_setup() - - fake_plugin = FakePlugin() - q_ctx = FakeNeutronContext() - t_ctx = context.get_db_context() - mock_context.return_value = t_ctx - - self._test_delete_security_group_rule(fake_plugin, q_ctx, t_ctx, - 'pod_id_1', TOP_SGS, - TOP_SG_RULES, BOTTOM1_SGS) - @patch.object(context, 'get_context_from_neutron_context') def test_handle_remote_group_invalid_input(self, mock_context): self._basic_pod_route_setup() @@ -3216,74 +3191,6 @@ class PluginTest(unittest.TestCase, 'pod_id_1', TOP_SGS, TOP_SG_RULES, BOTTOM1_SGS) - @patch.object(FakeClient, 'create_security_group_rules') - @patch.object(context, 'get_context_from_neutron_context') - def test_create_security_group_rule_exception(self, mock_context, - mock_create): - self._basic_pod_route_setup() - - fake_plugin = FakePlugin() - q_ctx = FakeNeutronContext() - t_ctx = context.get_db_context() - mock_context.return_value = t_ctx - mock_create.side_effect = q_exceptions.ConnectionFailed - - self._test_create_security_group_rule_exception( - fake_plugin, q_ctx, t_ctx, 'pod_id_1', TOP_SGS, BOTTOM1_SGS) - - @patch.object(FakeClient, 'delete_security_group_rules') - @patch.object(context, 'get_context_from_neutron_context') - def test_delete_security_group_rule_exception(self, mock_context, - mock_delete): - self._basic_pod_route_setup() - - fake_plugin = FakePlugin() - q_ctx = FakeNeutronContext() - t_ctx = context.get_db_context() - mock_context.return_value = t_ctx - mock_delete.side_effect = q_exceptions.ConnectionFailed - - self._test_delete_security_group_rule_exception( - fake_plugin, q_ctx, t_ctx, 'pod_id_1', TOP_SGS, TOP_SG_RULES, - BOTTOM1_SGS) - - @patch.object(context, 'get_context_from_neutron_context') - def test_update_default_sg(self, mock_context): - self._basic_pod_route_setup() - - fake_plugin = FakePlugin() - q_ctx = FakeNeutronContext() - t_ctx = context.get_db_context() - mock_context.return_value = t_ctx - - self._test_update_default_sg(fake_plugin, q_ctx, t_ctx, - 'pod_id_1', TOP_SGS, - TOP_SG_RULES, BOTTOM1_SGS) - - @patch.object(context, 'get_context_from_neutron_context') - def test_get_security_group(self, mock_context): - self._basic_pod_route_setup() - - fake_plugin = FakePlugin() - q_ctx = FakeNeutronContext() - t_ctx = context.get_db_context() - mock_context.return_value = t_ctx - - self._test_get_security_group(fake_plugin, q_ctx, t_ctx, - 'pod_id_1', TOP_SGS, BOTTOM1_SGS) - - @patch.object(context, 'get_context_from_neutron_context') - def test_delete_security_group(self, mock_context): - self._basic_pod_route_setup() - - fake_plugin = FakePlugin() - q_ctx = FakeNeutronContext() - t_ctx = context.get_db_context() - mock_context.return_value = t_ctx - - self._test_delete_security_group(fake_plugin, q_ctx, t_ctx, - 'pod_id_1', TOP_SGS, BOTTOM1_SGS) - @patch.object(context, 'get_context_from_neutron_context') def test_create_policy(self, mock_context): fake_plugin = FakePlugin()