Skip to content

Commit

Permalink
Merge pull request #398 from grafuls/development
Browse files Browse the repository at this point in the history
fix: support for uefi boot mode
  • Loading branch information
sadsfae authored Jun 24, 2024
2 parents 01389fc + 5b4dbb8 commit 2263524
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
pip install -r tests/test-requirements.txt
PYTHONPATH=src pytest --cov=./ --cov-report=xml --cov-config=.coveragerc -p no:warnings
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
env_vars: PYTHON
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
fail_ci_if_error: false
verbose: true
3 changes: 3 additions & 0 deletions config/idrac_interfaces.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,6 @@ uefi_e28_r750_interfaces: NIC.Slot.3-1-1,HardDisk.List.1-1,NIC.Embedded.1-1-1
# h35 (should resemble other r640 hosts)
#director_f04_h35_r640_interfaces: NIC.Slot.1-2-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
#foreman_f04_h35_r640_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.Slot.1-2-1

director_r660_interfaces: NIC.PxeDevice.2-1,RAID.SL.3-2,NIC.PxeDevice.1-1
foreman_r660_interfaces: NIC.PxeDevice.1-1,RAID.SL.3-2,NIC.PxeDevice.2-1
2 changes: 1 addition & 1 deletion rpm/python3-badfish.spec.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Summary: %{sum}

License: GPLv3
URL: https://github.com/%{org}/%{project}
Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz

BuildArch: noarch
BuildRequires: %{py3_dist setuptools}
Expand Down
7 changes: 4 additions & 3 deletions src/badfish/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ async def boot_to_type(self, host_type, _interfaces_path):

device = await self.get_host_type_boot_device(host_type, _interfaces_path)

await self.boot_to(device)
await self.boot_to(device, True)

async def boot_to_mac(self, mac_address):
interfaces_endpoints = await self.get_interfaces_endpoints()
Expand All @@ -1116,10 +1116,11 @@ async def boot_to_mac(self, mac_address):
raise BadfishException("MAC Address does not match any of the existing")

async def send_one_time_boot(self, device):
boot_seq = await self.get_boot_seq()
_payload = {
"Attributes": {
"OneTimeBootMode": "OneTimeBootSeq",
"OneTimeBootSeqDev": device,
"OneTimeBootMode": f"OneTime{boot_seq}",
f"OneTime{boot_seq}Dev": device,
}
}
await self.patch_bios(_payload)
Expand Down
4 changes: 4 additions & 0 deletions tests/test_boot_to.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def test_boot_to(self, mock_get, mock_patch, mock_post, mock_delete):
BOOT_MODE_RESP,
boot_seq_resp_fmt.replace("'", '"'),
BLANK_RESP,
BOOT_MODE_RESP,
]
responses = INIT_RESP + get_resp
self.set_mock_response(mock_get, 200, responses)
Expand All @@ -54,6 +55,7 @@ def test_boot_to_service_unavailable(
BOOT_MODE_RESP,
boot_seq_resp_fmt.replace("'", '"'),
BLANK_RESP,
BOOT_MODE_RESP,
]
responses = INIT_RESP + get_resp
post_responses = ["OK"] + [JOB_OK_RESP]
Expand All @@ -75,6 +77,7 @@ def test_boot_to_bad_request(self, mock_get, mock_patch, mock_post, mock_delete)
BOOT_MODE_RESP,
boot_seq_resp_fmt.replace("'", '"'),
BLANK_RESP,
BOOT_MODE_RESP,
BLANK_RESP,
RESET_TYPE_RESP,
STATE_ON_RESP,
Expand All @@ -101,6 +104,7 @@ def test_boot_to_service_err_handler(
BOOT_MODE_RESP,
boot_seq_resp_fmt.replace("'", '"'),
BLANK_RESP,
BOOT_MODE_RESP,
]
responses = INIT_RESP + get_resp
post_responses = ["OK"] + [JOB_OK_RESP]
Expand Down
1 change: 1 addition & 0 deletions tests/test_virtual_media.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ def test_good_dell(self, mock_get, mock_post, mock_delete, mock_patch):
BOOT_MODE_RESP,
boot_seq_resp_fmt.replace("'", '"'),
BOOT_MODE_RESP,
BOOT_MODE_RESP,
boot_seq_resp_fmt.replace("'", '"'),
BLANK_RESP,
]
Expand Down

0 comments on commit 2263524

Please sign in to comment.