From 98570dc6addb4dbdac8cf394fcf29e6c640f1fff Mon Sep 17 00:00:00 2001 From: Javier Pena Date: Fri, 26 Jan 2018 16:58:12 +0100 Subject: [PATCH] Fix unit tests for UEFI iSCSI boot for ILO https://review.openstack.org/468288 added some unit tests for the UEFI iSCSI boot for ILO, which fail when proliantutils is installed in the virtualenv (it was not in the gate). The reason for this is that they do not pass a value to the constructor of ilo_error.IloError and ilo_error.IloCommandNotSupportedInBiosError, which makes the unit tests fail, as seen when the package was built in RDO [1]. This patch adds the required value, as used by other unit tests. [1] - https://trunk.rdoproject.org/centos7/73/71/737147706405785b3879135872d6efb2953a9aea_0520bb51 Change-Id: I50d919047ddb9edf1a1ae1a994a8f71e420718d9 --- ironic/tests/unit/drivers/modules/ilo/test_management.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ironic/tests/unit/drivers/modules/ilo/test_management.py b/ironic/tests/unit/drivers/modules/ilo/test_management.py index 04fa6c7e1f..3b60a9e993 100644 --- a/ironic/tests/unit/drivers/modules/ilo/test_management.py +++ b/ironic/tests/unit/drivers/modules/ilo/test_management.py @@ -776,7 +776,7 @@ class IloManagementTestCase(db_base.DbTestCase): task.node.save() ilo_object_mock = get_ilo_object_mock.return_value ilo_object_mock.set_iscsi_info.side_effect = ( - ilo_error.IloError) + ilo_error.IloError('error')) self.assertRaises(exception.IloOperationError, task.driver.management.set_iscsi_boot_target, task) @@ -801,7 +801,7 @@ class IloManagementTestCase(db_base.DbTestCase): task.node.save() ilo_object_mock = get_ilo_object_mock.return_value ilo_object_mock.set_iscsi_info.side_effect = ( - ilo_error.IloCommandNotSupportedInBiosError) + ilo_error.IloCommandNotSupportedInBiosError('error')) self.assertRaises(exception.IloOperationNotSupported, task.driver.management.set_iscsi_boot_target, task) @@ -823,7 +823,7 @@ class IloManagementTestCase(db_base.DbTestCase): shared=False) as task: ilo_object_mock = get_ilo_object_mock.return_value ilo_object_mock.unset_iscsi_info.side_effect = ( - ilo_error.IloError) + ilo_error.IloError('error')) self.assertRaises(exception.IloOperationError, task.driver.management.clear_iscsi_boot_target, task) @@ -835,7 +835,7 @@ class IloManagementTestCase(db_base.DbTestCase): shared=False) as task: ilo_object_mock = get_ilo_object_mock.return_value ilo_object_mock.unset_iscsi_info.side_effect = ( - ilo_error.IloCommandNotSupportedInBiosError) + ilo_error.IloCommandNotSupportedInBiosError('error')) self.assertRaises(exception.IloOperationNotSupported, task.driver.management.clear_iscsi_boot_target, task)