def test_deploy_no_callback(self, power_mock, get_ip_mock):
self.config(group='ansible', use_ramdisk_callback=False)
with mock.patch.multiple(self.driver,
_ansible_deploy=mock.DEFAULT,
reboot_to_instance=mock.DEFAULT) as moks:
with task_manager.acquire(
self.context, self.node['uuid'], shared=False) as task:
driver_return = self.driver.deploy(task)
self.assertEqual(driver_return, states.DEPLOYDONE)
power_mock.assert_called_once_with(task, states.REBOOT)
get_ip_mock.assert_called_once_with(task)
moks['_ansible_deploy'].assert_called_once_with(task,
'127.0.0.1')
moks['reboot_to_instance'].assert_called_once_with(task)
评论列表
文章目录