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] - 7371477064_0520bb51

Change-Id: I50d919047ddb9edf1a1ae1a994a8f71e420718d9
This commit is contained in:
Javier Pena 2018-01-26 16:58:12 +01:00
parent e95f3de5c9
commit 98570dc6ad

View File

@ -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)