Skip to content

Commit

Permalink
Merge pull request #381 from grafuls/development
Browse files Browse the repository at this point in the history
fix: iDRAC8 / R630 boot_to
  • Loading branch information
sadsfae authored Sep 18, 2023
2 parents dd3de3d + 9e783a7 commit dfdcc28
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/badfish/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,11 +1071,13 @@ async def reset_bios(self):
self.logger.info("BIOS will now reset and be back online within a few minutes.")
return True

async def boot_to(self, device):
async def boot_to(self, device, skip_job=False):
device_check = await self.check_device(device)
if device_check:
await self.clear_job_queue()
await self.send_one_time_boot(device)
if not skip_job:
await self.create_bios_config_job(self.bios_uri)
else:
return False
return True
Expand Down Expand Up @@ -1453,7 +1455,7 @@ async def boot_to_virtual_media(self):
else:
vcd_check = await self.check_device("Optical.iDRACVirtual.1-1")
if vcd_check:
await self.boot_to("Optical.iDRACVirtual.1-1")
await self.boot_to("Optical.iDRACVirtual.1-1", True)
else:
self.logger.error(
"Command failed to set next onetime boot to virtual media. " "No virtual optical media boot device."
Expand Down
2 changes: 2 additions & 0 deletions tests/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ def render_device_dict(index, device):
"- INFO - iDRAC will now reset and be back online within a few minutes.\n"
"- INFO - Polling for host state: On\n"
"- INFO - Command passed to set BIOS attribute pending values.\n"
"- ERROR - POST command failed to create BIOS config job, status code is 400.\n"
"- ERROR - {'JobID': 'JID_498218641680'}\n"
)
RESPONSE_BOOT_TO_SERVICE_ERR_HANDLER = (
f"- WARNING - Job queue already cleared for iDRAC {MOCK_HOST}, DELETE command will not execute.\n"
Expand Down
6 changes: 4 additions & 2 deletions tests/test_custom_interfaces.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from unittest import IsolatedAsyncioTestCase
import pytest
from src.badfish.main import Badfish
from tests.config import INTERFACES_PATH
from tests.test_base import TestBase

E26_EXPECTED_INTERFACES = {
"director": "NIC.Slot.3-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1",
Expand All @@ -23,7 +24,8 @@
}


class TestGetInterfaceByType(IsolatedAsyncioTestCase):
class TestGetInterfaceByType(TestBase):
@pytest.mark.asyncio
async def test_get_interface_by_type(self):
for host, expected in [
("mgmt-e26-h01-r750", E26_EXPECTED_INTERFACES),
Expand Down

0 comments on commit dfdcc28

Please sign in to comment.