summaryrefslogtreecommitdiff
path: root/ironic/tests
diff options
context:
space:
mode:
authorkesper <paresh.h.sao@gmail.com>2017-09-01 08:03:27 +0000
committerDmitry Tantsur <divius.inside@gmail.com>2017-09-04 13:39:02 +0000
commit446eff88ed6b2a2820bc127836742713dacc76ff (patch)
tree81a4efde0be02f7f1cb598bd3e66c055ed2b53be /ironic/tests
parentd783dffadfcfd049e4694db130850dd4a22888d1 (diff)
downloadironic-446eff88ed6b2a2820bc127836742713dacc76ff.tar.gz
Boot from volume fails with 'iscsi' deploy interface
When boot from volume is requested for a node with 'iscsi' deploy interface it does not call the boot.prepare_instance and fails to create pxelinux.cfg file to boot with ipxe. This commit fixes the issue. Change-Id: Iff997e1786a933f50a25c9d89cb163a6aaec3f00 Closes-Bug: #1714436 (cherry picked from commit 49c4bba14eee0bd3d9dc93ce8748ef7b8e445f1c)
Diffstat (limited to 'ironic/tests')
-rw-r--r--ironic/tests/unit/drivers/modules/test_iscsi_deploy.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/ironic/tests/unit/drivers/modules/test_iscsi_deploy.py b/ironic/tests/unit/drivers/modules/test_iscsi_deploy.py
index b0a179b5a..2c3de9524 100644
--- a/ironic/tests/unit/drivers/modules/test_iscsi_deploy.py
+++ b/ironic/tests/unit/drivers/modules/test_iscsi_deploy.py
@@ -713,6 +713,9 @@ class ISCSIDeployTestCase(db_base.DbTestCase):
@mock.patch.object(flat_network.FlatNetwork,
'remove_provisioning_network',
spec_set=True, autospec=True)
+ @mock.patch.object(pxe.PXEBoot,
+ 'prepare_instance',
+ spec_set=True, autospec=True)
@mock.patch.object(manager_utils, 'node_power_action', autospec=True)
@mock.patch.object(iscsi_deploy, 'check_image_size', autospec=True)
@mock.patch.object(iscsi_deploy, 'cache_instance_image', autospec=True)
@@ -720,6 +723,7 @@ class ISCSIDeployTestCase(db_base.DbTestCase):
mock_cache_instance_image,
mock_check_image_size,
mock_node_power_action,
+ mock_prepare_instance,
mock_remove_network,
mock_tenant_network,
mock_write):
@@ -734,6 +738,7 @@ class ISCSIDeployTestCase(db_base.DbTestCase):
self.assertFalse(mock_check_image_size.called)
mock_remove_network.assert_called_once_with(mock.ANY, task)
mock_tenant_network.assert_called_once_with(mock.ANY, task)
+ mock_prepare_instance.assert_called_once_with(mock.ANY, task)
self.assertEqual(2, mock_node_power_action.call_count)
@mock.patch.object(noop_storage.NoopStorage, 'detach_volumes',