Browse Source

Fix failures related to the mock 1.1.0 release

The functional gate is also failing due to a recent
change introduced in devstack -> I613f1bdc6673f0c4bfe29aaab7b514348a617a8c

This fixes both the gates, functional and unit tests.

Co-Authored-By: Thomas Herve <therve@redhat.com>
Closes-Bug: #1473398
Change-Id: Ia77a1fd884c6346edfb90777e91a51d279ccd92a
changes/35/200435/9
Sirushti Murugesan 7 years ago committed by Thomas Herve
parent
commit
3216f6126f
  1. 3
      heat/tests/clients/test_clients.py
  2. 2
      heat/tests/engine/test_service_engine.py
  3. 2
      heat/tests/engine/test_software_config.py
  4. 2
      heat/tests/engine/test_stack_create.py
  5. 5
      heat/tests/manila/test_manila_share.py
  6. 2
      heat/tests/mistral/test_mistral_workflow.py
  7. 2
      heat/tests/nova/test_server.py
  8. 12
      heat/tests/test_engine_service.py
  9. 2
      heat/tests/test_software_deployment.py
  10. 2
      heat/tests/test_stack_delete.py
  11. 2
      heat_integrationtests/README.rst
  12. 4
      heat_integrationtests/post_test_hook.sh
  13. 4
      heat_integrationtests/prepare_test_network.sh

3
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")

2
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')

2
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)

2
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'

5
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")

2
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):

2
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()

12
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'
)

2
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)

2
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: '

2
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

4
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

4
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

Loading…
Cancel
Save