Exemplo n.º 1
0
    def test__wait_power_state_soft_reboot(self, snmpclient_mock):
        target_state = states.SOFT_REBOOT
        self.config(snmp_polling_interval=1, group='irmc')
        self.config(soft_power_off_timeout=3, group='conductor')
        snmpclient_mock.return_value = mock.Mock(
            **{'get.side_effect': [10, 6, 8]})

        with task_manager.acquire(self.context, self.node.uuid,
                                  shared=True) as task:
            irmc_power._wait_power_state(task, target_state)

            task.node.refresh()
            self.assertIsNone(task.node.last_error)
            self.assertEqual(states.POWER_ON, task.node.power_state)
            self.assertEqual(states.NOSTATE, task.node.target_power_state)
Exemplo n.º 2
0
    def test__wait_power_state_soft_reboot(self, snmpclient_mock):
        target_state = states.SOFT_REBOOT
        self.config(snmp_polling_interval=1, group='irmc')
        self.config(soft_power_off_timeout=3, group='conductor')
        snmpclient_mock.return_value = mock.Mock(
            **{'get.side_effect': [10, 6, 8]})

        with task_manager.acquire(self.context, self.node.uuid,
                                  shared=True) as task:
            irmc_power._wait_power_state(task, target_state)

            task.node.refresh()
            self.assertIsNone(task.node.last_error)
            self.assertEqual(states.POWER_ON, task.node.power_state)
            self.assertEqual(states.NOSTATE, task.node.target_power_state)