From 283cf08a02e817ab29f4e7248dd0da0f8bed9289 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Tue, 14 Apr 2020 12:50:37 -0500 Subject: [PATCH] Prevent creation of ssh_known_hosts file in UT run 4013fed06972871681a2109194a28457ea1ff344 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 --- cinder/tests/unit/volume/drivers/test_fujitsu_dx.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cinder/tests/unit/volume/drivers/test_fujitsu_dx.py b/cinder/tests/unit/volume/drivers/test_fujitsu_dx.py index 2ec8fc7310e..83df626f3f6 100644 --- a/cinder/tests/unit/volume/drivers/test_fujitsu_dx.py +++ b/cinder/tests/unit/volume/drivers/test_fujitsu_dx.py @@ -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.