Exemple #1
0
 def test_set_onetime_boot_persistent(
         self, mock_iloclient, mock_get_ov_client):
     ilo_client = mock_iloclient()
     driver_internal_info = self.node.driver_internal_info
     next_boot_device = {'device': 'disk', 'persistent': False}
     driver_internal_info['next_boot_device'] = next_boot_device
     with task_manager.acquire(self.context, self.node.uuid) as task:
         management.set_onetime_boot(task)
         self.assertFalse(ilo_client.called)
         self.assertFalse(ilo_client.patch.called)
Exemple #2
0
 def test_set_onetime_boot_not_persistent(self, mock_iloclient,
                                          mock_get_ov_client):
     ilo_client = mock_iloclient()
     boot_device = management.BOOT_DEVICE_MAP_ILO.get(boot_devices.DISK)
     body = {
         "Boot": {
             "BootSourceOverrideTarget": boot_device,
             "BootSourceOverrideEnabled": "Once"
         }
     }
     with task_manager.acquire(self.context, self.node.uuid) as task:
         driver_internal_info = task.node.driver_internal_info
         next_boot_device = {'boot_device': 'disk', 'persistent': False}
         driver_internal_info['next_boot_device'] = next_boot_device
         task.node.driver_internal_info = driver_internal_info
         management.set_onetime_boot(task)
         self.assertTrue(mock_iloclient.called)
         ilo_client.patch.assert_called_once_with(
             path=management.ILO_SYSTEM_PATH,
             body=body,
             headers=management.ILO_REQUEST_HEADERS)