diff --git a/heat/tests/clients/test_clients.py b/heat/tests/clients/test_clients.py index a24c4b2641..88159e5cc4 100644 --- a/heat/tests/clients/test_clients.py +++ b/heat/tests/clients/test_clients.py @@ -258,7 +258,6 @@ class ClientPluginTest(common.HeatTestCase): # assert token is from plugin rather than context # even though both are set self.assertEqual('5678', plugin.auth_token) - con.auth_plugin.get_token.assert_called() def test_url_for(self): con = mock.Mock() @@ -275,7 +274,7 @@ class ClientPluginTest(common.HeatTestCase): self.assertEqual('http://192.0.2.1/foo', plugin.url_for(service_type='foo')) - con.auth_plugin.get_endpoint.assert_called() + self.assertTrue(con.auth_plugin.get_endpoint.called) @mock.patch.object(context, "RequestContext") @mock.patch.object(v3, "Token", name="v3_token") diff --git a/heat/tests/engine/test_service_engine.py b/heat/tests/engine/test_service_engine.py index 770ea1936a..b4fd07d1a8 100644 --- a/heat/tests/engine/test_service_engine.py +++ b/heat/tests/engine/test_service_engine.py @@ -378,4 +378,4 @@ class ServiceEngineTest(common.HeatTestCase): @mock.patch('oslo_log.log.setup') def test_engine_service_reset(self, setup_logging_mock): self.eng.reset() - setup_logging_mock.assertCalledOnceWith(cfg.CONF, 'heat') + setup_logging_mock.assert_called_once_with(cfg.CONF, 'heat') diff --git a/heat/tests/engine/test_software_config.py b/heat/tests/engine/test_software_config.py index c7cfc74a78..93f98a979b 100644 --- a/heat/tests/engine/test_software_config.py +++ b/heat/tests/engine/test_software_config.py @@ -755,5 +755,5 @@ class SoftwareConfigServiceTest(common.HeatTestCase): self.engine.show_software_deployment(self.ctx, deployment_id)) zaqar_client.queue.assert_called_once_with('6789') - queue.pop.assert_called_once() + queue.pop.assert_called_once_with() ssd.assert_called_once_with(self.ctx, deployment_id, 'ok', None) diff --git a/heat/tests/engine/test_stack_create.py b/heat/tests/engine/test_stack_create.py index 52bd3a5a55..b58ed0b038 100644 --- a/heat/tests/engine/test_stack_create.py +++ b/heat/tests/engine/test_stack_create.py @@ -67,7 +67,7 @@ class StackCreateTest(common.HeatTestCase): stack_user_project_id=None, convergence=False, parent_resource=None) - mock_validate.assert_called_once() + mock_validate.assert_called_once_with() def test_stack_create(self): stack_name = 'service_create_test_stack' diff --git a/heat/tests/manila/test_manila_share.py b/heat/tests/manila/test_manila_share.py index ab7d9e264f..e175e453e4 100644 --- a/heat/tests/manila/test_manila_share.py +++ b/heat/tests/manila/test_manila_share.py @@ -172,10 +172,9 @@ class ManilaShareTest(common.HeatTestCase): kwargs = { "display_name": "name", "display_description": "desc", - "is_public": True } - share.client().shares.update.assertCalledOnceWith(share.resource_id, - **kwargs) + share.client().shares.update.assert_called_once_with( + share.resource_id, **kwargs) def test_share_update_access_rules(self): share = self._create_share("stack_share_update_access_rules") diff --git a/heat/tests/mistral/test_mistral_workflow.py b/heat/tests/mistral/test_mistral_workflow.py index 01aa8aaa4b..4024342891 100644 --- a/heat/tests/mistral/test_mistral_workflow.py +++ b/heat/tests/mistral/test_mistral_workflow.py @@ -324,7 +324,7 @@ class TestMistralWorkflow(common.HeatTestCase): self.mistral.workflows.update.return_value = [ FakeWorkflow('test_stack-workflow-b5fiekfci3yc')] scheduler.TaskRunner(wf.update, new_wf)() - self.mistral.workflows.update.assert_called_once() + self.assertTrue(self.mistral.workflows.update.called) self.assertEqual((wf.UPDATE, wf.COMPLETE), wf.state) def test_update_failed(self): diff --git a/heat/tests/nova/test_server.py b/heat/tests/nova/test_server.py index 85fea958cc..ecef7007d3 100644 --- a/heat/tests/nova/test_server.py +++ b/heat/tests/nova/test_server.py @@ -898,7 +898,7 @@ class ServersTest(common.HeatTestCase): server._delete_queue() zc.queue.assert_called_once_with(queue_id) - zc.queue.delete.assert_called_once() + zc.queue(queue_id).delete.assert_called_once_with() self.m.VerifyAll() diff --git a/heat/tests/test_engine_service.py b/heat/tests/test_engine_service.py index 274b074bf3..acb559585e 100644 --- a/heat/tests/test_engine_service.py +++ b/heat/tests/test_engine_service.py @@ -2922,10 +2922,10 @@ class StackServiceTest(common.HeatTestCase): mock_get_all.assert_called_once_with(self.ctx, filters=filters, tenant_safe=False) - mock_stack_load.assert_call_once_with(self.ctx, - stack=db_stack, - use_stored_context=True) - mock_thread.start_with_acquired_lock.assert_call_once_with( - fake_stack, fake_stack.state_set, fake_stack.action, - parser.Stack.FAILED, 'Engine went down during stack CREATE' + mock_stack_load.assert_called_once_with(self.ctx, + stack=db_stack, + use_stored_context=True) + mock_thread.start_with_acquired_lock.assert_called_once_with( + fake_stack, fake_lock, fake_stack.state_set, fake_stack.action, + fake_stack.FAILED, 'Engine went down during stack CREATE' ) diff --git a/heat/tests/test_software_deployment.py b/heat/tests/test_software_deployment.py index 85167e2c80..b746092b3e 100644 --- a/heat/tests/test_software_deployment.py +++ b/heat/tests/test_software_deployment.py @@ -1105,7 +1105,7 @@ class SoftwareDeploymentTest(common.HeatTestCase): self.deployment.uuid = str(uuid.uuid4()) self.deployment._delete_queue() zc.queue.assert_called_once_with(queue_id) - zc.queue.delete.assert_called_once() + self.assertTrue(zc.queue(self.deployment.uuid).delete.called) self.assertEqual( [mock.call('signal_queue_id')], self.deployment.data_delete.mock_calls) diff --git a/heat/tests/test_stack_delete.py b/heat/tests/test_stack_delete.py index e839b7349b..c22af1092c 100644 --- a/heat/tests/test_stack_delete.py +++ b/heat/tests/test_stack_delete.py @@ -414,7 +414,7 @@ class StackTest(common.HeatTestCase): self.stack.delete() - mock_rd.assert_called_once() + mock_rd.assert_called_once_with() self.assertEqual((self.stack.DELETE, self.stack.FAILED), self.stack.state) self.assertEqual('Resource DELETE failed: Exception: ' diff --git a/heat_integrationtests/README.rst b/heat_integrationtests/README.rst index 3d77d09e1a..0477888747 100644 --- a/heat_integrationtests/README.rst +++ b/heat_integrationtests/README.rst @@ -9,7 +9,7 @@ To run the tests against DevStack, do the following: # source DevStack credentials - source /opt/stack/devstack/accrc/demo/demo + source /opt/stack/devstack/openrc # run the heat integration tests with those credentials diff --git a/heat_integrationtests/post_test_hook.sh b/heat_integrationtests/post_test_hook.sh index 7919d38cf6..34b6ae28c8 100755 --- a/heat_integrationtests/post_test_hook.sh +++ b/heat_integrationtests/post_test_hook.sh @@ -17,8 +17,8 @@ set -x export DEST=${DEST:-/opt/stack/new} -source $DEST/devstack/accrc/admin/admin +source $DEST/devstack/openrc admin admin sudo -E $DEST/heat/heat_integrationtests/prepare_test_env.sh sudo -E $DEST/heat/heat_integrationtests/prepare_test_network.sh -source $DEST/devstack/accrc/demo/demo +source $DEST/devstack/openrc sudo -E tox -eintegration diff --git a/heat_integrationtests/prepare_test_network.sh b/heat_integrationtests/prepare_test_network.sh index 657ce7575c..41f42bab56 100755 --- a/heat_integrationtests/prepare_test_network.sh +++ b/heat_integrationtests/prepare_test_network.sh @@ -16,12 +16,12 @@ set -x -source $DEST/devstack/accrc/admin/admin +source $DEST/devstack/openrc admin admin PUB_SUBNET_ID=`neutron subnet-list | grep ' public-subnet ' | awk '{split($0,a,"|"); print a[2]}'` ROUTER_GW_IP=`neutron port-list -c fixed_ips -c device_owner | grep router_gateway | awk -F '"' -v subnet_id="${PUB_SUBNET_ID//[[:space:]]/}" '$4 == subnet_id { print $8; }'` # create a heat specific private network (default 'private' network has ipv6 subnet) -source $DEST/devstack/accrc/demo/demo +source $DEST/devstack/openrc HEAT_PRIVATE_SUBNET_CIDR=10.0.5.0/24 neutron net-create heat-net neutron subnet-create --name heat-subnet heat-net $HEAT_PRIVATE_SUBNET_CIDR