summaryrefslogtreecommitdiff
path: root/ironic/tests
diff options
context:
space:
mode:
authorNaohiro Tamura <naohirot@jp.fujitsu.com>2017-01-26 17:04:06 +0900
committerNaohiro Tamura <naohirot@jp.fujitsu.com>2017-02-07 13:46:54 +0900
commit2ab96f68357c6c567ce8e1de7e6ed9952a8626d7 (patch)
tree8ea71ed03b88118d7dc3137c226018dbdbbe7354 /ironic/tests
parentcbd987f2ee4508350fbc26150307123a8d9fcb9e (diff)
downloadironic-2ab96f68357c6c567ce8e1de7e6ed9952a8626d7.tar.gz
Follow-up iRMC power driver for soft reboot/poff
This is a follow-up patch of "iRMC power driver for soft reboot and soft power off" [1] to fix a nit of exception handling code and to make soft reboot wait logic more robust. [1] I8c69904063ac0a9e042f54158a20347f0c2325e1 Change-Id: I25bd413eb0f3e6c6229bf4fa053ca6ed31a5691d Partial-Bug: #1526226
Diffstat (limited to 'ironic/tests')
-rw-r--r--ironic/tests/unit/drivers/modules/irmc/test_power.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ironic/tests/unit/drivers/modules/irmc/test_power.py b/ironic/tests/unit/drivers/modules/irmc/test_power.py
index 72ee1d8ed..e64f616cd 100644
--- a/ironic/tests/unit/drivers/modules/irmc/test_power.py
+++ b/ironic/tests/unit/drivers/modules/irmc/test_power.py
@@ -199,8 +199,9 @@ class IRMCPowerInternalMethodsTestCase(db_base.DbTestCase):
irmc_power._set_power_state(task, target_state)
attach_boot_iso_if_needed_mock.assert_called_once_with(task)
irmc_client.assert_called_once_with(irmc_power.scci.POWER_SOFT_CYCLE)
- _wait_power_state_mock.assert_called_once_with(task, target_state,
- timeout=None)
+ _wait_power_state_mock.assert_has_calls(
+ [mock.call(task, states.SOFT_POWER_OFF, timeout=None),
+ mock.call(task, states.SOFT_REBOOT, timeout=None)])
@mock.patch.object(irmc_power, '_wait_power_state', spec_set=True,
autospec=True)
@@ -279,7 +280,7 @@ class IRMCPowerInternalMethodsTestCase(db_base.DbTestCase):
attach_boot_iso_if_needed_mock.assert_called_once_with(
task)
_wait_power_state_mock.assert_called_once_with(
- task, target_state, timeout=None)
+ task, states.SOFT_POWER_OFF, timeout=None)
class IRMCPowerTestCase(db_base.DbTestCase):