Merge "Mock check_dir in ansible interface tests"

This commit is contained in:
Zuul 2018-01-31 02:26:31 +00:00 committed by Gerrit Code Review
commit d1e7c18581
1 changed files with 11 additions and 0 deletions

View File

@ -55,6 +55,17 @@ class AnsibleDeployTestCaseBase(db_base.DbTestCase):
def setUp(self):
super(AnsibleDeployTestCaseBase, self).setUp()
# NOTE(pas-ha) we load ipmi hw type, and ipmitool interface checks
# for validity of the CONF.tempdir when a task object is created.
# We need to fake it in some tests and we don't care if and how it
# was called, so just mock it out.
# 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')