Skip to content

Commit

Permalink
tests: add unit tests for facts.efibootmgr.EFIBootMgr
Browse files Browse the repository at this point in the history
  • Loading branch information
bauen1 committed Oct 31, 2024
1 parent b3d637b commit c31f325
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/facts/efibootmgr.EFIBootMgr/boot_entries.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"command": "efibootmgr",
"requires_command": "efibootmgr",
"output": [
"BootCurrent: 0002",
"BootOrder: 0002",
"Boot0002* debian"
],
"fact": {
"BootNext": null,
"BootCurrent": 2,
"Timeout": null,
"BootOrder": [2],
"Entries": {
"2": [true, "debian"]
}
}
}
20 changes: 20 additions & 0 deletions tests/facts/efibootmgr.EFIBootMgr/boot_entries2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"command": "efibootmgr",
"requires_command": "efibootmgr",
"output": [
"BootCurrent: 0000",
"BootOrder: 0000,0003",
"Boot0000* debian",
"Boot0003* EFI Fixed Disk Boot Device 1"
],
"fact": {
"BootNext": null,
"BootCurrent": 0,
"Timeout": null,
"BootOrder": [0,3],
"Entries": {
"0": [true, "debian"],
"3": [true, "EFI Fixed Disk Boot Device 1"]
}
}
}
30 changes: 30 additions & 0 deletions tests/facts/efibootmgr.EFIBootMgr/boot_entries_complex.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"command": "efibootmgr",
"requires_command": "efibootmgr",
"output": [
"BootNext: 0006",
"BootCurrent: 0006",
"Timeout: 2 seconds",
"BootOrder: 0006,0001,0002,0003,0007,0000",
"Boot0000* Diagnostic Program",
"Boot0001* Windows Boot Manager",
"Boot0002* UEFI: PXE IP4 Realtek PCIe GBE Family Controller",
"Boot0003* UEFI: PXE IP6 Realtek PCIe GBE Family Controller",
"Boot0006* debian",
"Boot0007* debian"
],
"fact": {
"BootNext": 6,
"BootCurrent": 6,
"Timeout": 2,
"BootOrder": [6,1,2,3,7,0],
"Entries": {
"0": [true, "Diagnostic Program"],
"1": [true, "Windows Boot Manager"],
"2": [true, "UEFI: PXE IP4 Realtek PCIe GBE Family Controller"],
"3": [true, "UEFI: PXE IP6 Realtek PCIe GBE Family Controller"],
"6": [true, "debian"],
"7": [true, "debian"]
}
}
}
8 changes: 8 additions & 0 deletions tests/facts/efibootmgr.EFIBootMgr/not_uefi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"command": "efibootmgr",
"requires_command": "efibootmgr",
"output": [
"EFI variables are not supported on this system."
],
"fact": null
}

0 comments on commit c31f325

Please sign in to comment.