summaryrefslogtreecommitdiff
path: root/ironic/tests/unit/drivers/test_base.py
diff options
context:
space:
mode:
authorvmud213 <vinay50muddu@yahoo.com>2018-09-17 17:48:35 +0530
committervmud213 <vinay50muddu@yahoo.com>2018-09-18 16:41:39 +0530
commit85b0d3e141e226ca6de71b48e2d37e66f317f362 (patch)
tree415fdfb4ecd432f8f32eeb05874226a9fe01ae60 /ironic/tests/unit/drivers/test_base.py
parent36e87dc5b472d79470b783fbba9ce396e3cbb96e (diff)
downloadironic-85b0d3e141e226ca6de71b48e2d37e66f317f362.tar.gz
Honors return value from BIOS interface cleansteps
When a BIOS interface clean step is executed the return value is ignored. If it is asynchronous, the return value which is CLEANWAIT state is ignored and the cleanstep is marked as complete immediately. The current change honors the return value and moves the node to CLEANWAIT state accordingly. Change-Id: I3a3915116286326316ee9a55333c046f729c1a08 Story: #2003750 Task: #26438
Diffstat (limited to 'ironic/tests/unit/drivers/test_base.py')
-rw-r--r--ironic/tests/unit/drivers/test_base.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/ironic/tests/unit/drivers/test_base.py b/ironic/tests/unit/drivers/test_base.py
index d3f736765..123381025 100644
--- a/ironic/tests/unit/drivers/test_base.py
+++ b/ironic/tests/unit/drivers/test_base.py
@@ -550,10 +550,10 @@ class MyBIOSInterface(driver_base.BIOSInterface):
pass
def apply_configuration(self, task, settings):
- pass
+ return "return_value_apply_configuration"
def factory_reset(self, task):
- pass
+ return "return_value_factory_reset"
def cache_bios_settings(self, task):
pass
@@ -566,16 +566,18 @@ class TestBIOSInterface(base.TestCase):
bios = MyBIOSInterface()
task_mock = mock.MagicMock()
- bios.apply_configuration(task_mock, "")
+ actual = bios.apply_configuration(task_mock, "")
cache_bios_settings_mock.assert_called_once_with(bios, task_mock)
+ self.assertEqual(actual, "return_value_apply_configuration")
@mock.patch.object(MyBIOSInterface, 'cache_bios_settings', autospec=True)
def test_factory_reset_wrapper(self, cache_bios_settings_mock):
bios = MyBIOSInterface()
task_mock = mock.MagicMock()
- bios.factory_reset(task_mock)
+ actual = bios.factory_reset(task_mock)
cache_bios_settings_mock.assert_called_once_with(bios, task_mock)
+ self.assertEqual(actual, "return_value_factory_reset")
class TestBootInterface(base.TestCase):