[ansible] use manual-mgmt hw type in unit tests

less moking is always better.

Change-Id: Ibb9e755920333cb7a8778e6f72f7b1df36b7afb2
This commit is contained in:
Pavlo Shchelokovskyy 2018-02-20 16:38:26 +02:00
parent ccc251cadb
commit 80f08595f9
1 changed files with 5 additions and 14 deletions

View File

@ -56,22 +56,13 @@ class AnsibleDeployTestCaseBase(db_base.DbTestCase):
def setUp(self): def setUp(self):
super(AnsibleDeployTestCaseBase, self).setUp() super(AnsibleDeployTestCaseBase, self).setUp()
# NOTE(pas-ha) we load ipmi hw type, and ipmitool interface checks self.config(enabled_deploy_interfaces='ansible',
# for validity of the CONF.tempdir when a task object is created. enabled_power_interfaces='fake',
# We need to fake it in some tests and we don't care if and how it enabled_management_interfaces='fake')
# was called, so just mock it out. mgr_utils.mock_the_extension_manager(driver='manual-management',
# TODO(pas-ha) replace impi hw type with more appropriate fake hw type
# when such becomes available
patcher = mock.patch('ironic.common.utils.check_dir', autospec=True)
patcher.start()
self.addCleanup(patcher.stop)
self.config(enabled_deploy_interfaces='direct,iscsi,ansible')
mgr_utils.mock_the_extension_manager(driver='ipmi',
namespace='ironic.hardware.types') namespace='ironic.hardware.types')
node = { node = {
'driver': 'ipmi', 'driver': 'manual-management',
'deploy_interface': 'ansible',
'instance_info': INSTANCE_INFO, 'instance_info': INSTANCE_INFO,
'driver_info': DRIVER_INFO, 'driver_info': DRIVER_INFO,
'driver_internal_info': DRIVER_INTERNAL_INFO, 'driver_internal_info': DRIVER_INTERNAL_INFO,