Skip to content

Commit

Permalink
Add test for auto disabled boot entry in Grub
Browse files Browse the repository at this point in the history
Signed-off-by: David Cassany <dcassany@suse.com>
  • Loading branch information
davidcassany committed Jul 22, 2024
1 parent 615af35 commit 76caad5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkg/bootloader/grub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,15 @@ var _ = Describe("Booloader", Label("bootloader", "grub"), func() {
)
})

It("installs without errors", func() {
grub = bootloader.NewGrub(cfg, bootloader.WithGrubDisableBootEntry(true))
It("installs without errors and auto detects there is no writable efivars", func() {
runner.SideEffect = func(cmd string, args ...string) ([]byte, error) {
if cmd == "findmnt" && len(args) > 0 && args[0] == "-fno" {
return []byte("ro"), nil
}
return []byte{}, nil
}

grub = bootloader.NewGrub(cfg, bootloader.WithGrubAutoDisableBootEntry())
Expect(grub.Install(rootDir, efiDir)).To(Succeed())

// Check grub config in EFI directory
Expand Down

0 comments on commit 76caad5

Please sign in to comment.