Prevent creation of ssh_known_hosts file in UT run

4013fed069 added code that initializes an
SSHPool during init of the Fujitsu CLI class, causing an ssh_known_hosts
file to be created in the root of the repo during unit test runs.

This mocks out the class since ssh connections are not needed when
running unit tests.

Change-Id: I8d54cd7fbf0cd4de1c9ca60cb2b4a0bbfd1f1b1a
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2020-04-14 12:50:37 -05:00
parent ad73a1e0f6
commit 283cf08a02
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
1 changed files with 3 additions and 0 deletions

View File

@ -21,6 +21,7 @@ from oslo_utils import units
import six
from cinder import exception
from cinder import ssh_utils
from cinder import test
from cinder.volume import configuration as conf
@ -890,6 +891,7 @@ class FJFCDriverTestCase(test.TestCase):
self.mock_object(dx_common.FJDXCommon, '_create_eternus_instance_name',
instancename.fake_create_eternus_instance_name)
self.mock_object(ssh_utils, 'SSHPool', mock.Mock())
self.mock_object(eternus_dx_cli.FJDXCLI, '_exec_cli_with_eternus',
self.fake_exec_cli_with_eternus)
# Set iscsi driver to self.driver.
@ -1058,6 +1060,7 @@ class FJISCSIDriverTestCase(test.TestCase):
self.mock_object(dx_common.FJDXCommon, '_get_mapdata_iscsi',
self.fake_get_mapdata)
self.mock_object(ssh_utils, 'SSHPool', mock.Mock())
self.mock_object(eternus_dx_cli.FJDXCLI, '_exec_cli_with_eternus',
self.fake_exec_cli_with_eternus)
# Set iscsi driver to self.driver.