-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
grub2bls grub2bls grub2bls sync text about secure boot on s390 to be correct (bsc#1219989) make rubocop happy rubocop rubocop fixed test cases fixed test cases grub2bls grub2bls grub2bls grub2bls grub2bls rubocop rubocop rubocop rubocop rubocop docu added yast-bootloader added yast-bootloader
- Loading branch information
Showing
14 changed files
with
746 additions
and
1,080 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#! /usr/bin/env rspec --format doc | ||
# frozen_string_literal: true | ||
|
||
require_relative "./test_helper" | ||
|
||
require "bootloader/bls_sections" | ||
require "cfa/memory_file" | ||
|
||
describe Bootloader::BlsSections do | ||
|
||
before do | ||
allow(Yast::Misc).to receive(:CustomSysconfigRead) | ||
.with("ID_LIKE", "openSUSE", "/etc/os-release") | ||
.and_return("openSUSE") | ||
end | ||
|
||
describe "#read" do | ||
before do | ||
allow(Yast::Execute).to receive(:on_target) | ||
.with("/usr/bin/bootctl", "--json=short", "list", stdout: :capture) | ||
.and_return("[{\"title\" : \"openSUSE Tumbleweed\", \"isDefault\" : true }," \ | ||
"{\"title\" : \"Snapper: *openSUSE Tumbleweed 20241107\", \"isDefault\" : false}]") | ||
allow(Yast::Misc).to receive(:CustomSysconfigRead) | ||
.with("default", "", "/boot/efi/EFI/openSUSE/grubenv") | ||
.and_return("openSUSE Tumbleweed") | ||
subject.read | ||
end | ||
|
||
it "returns list of all available sections" do | ||
expect(subject.all).to eq(["openSUSE Tumbleweed", "Snapper: *openSUSE Tumbleweed 20241107"]) | ||
end | ||
|
||
it "reads default menu entry" do | ||
expect(subject.default).to eq("openSUSE Tumbleweed") | ||
end | ||
end | ||
|
||
describe "#default=" do | ||
before do | ||
allow(Yast::Execute).to receive(:on_target) | ||
.with("/usr/bin/bootctl", "--json=short", "list", stdout: :capture) | ||
.and_return("[{\"title\" : \"openSUSE Tumbleweed\", \"isDefault\" : true }," \ | ||
"{\"title\" : \"Snapper: *openSUSE Tumbleweed 20241107\", \"isDefault\" : false}]") | ||
allow(Yast::Misc).to receive(:CustomSysconfigRead) | ||
.with("default", "", "/boot/efi/EFI/openSUSE/grubenv") | ||
.and_return("openSUSE Tumbleweed") | ||
subject.read | ||
end | ||
it "sets new value for default" do | ||
subject.default = "Snapper: *openSUSE Tumbleweed 20241107" | ||
expect(subject.default).to eq "Snapper: *openSUSE Tumbleweed 20241107" | ||
end | ||
|
||
it "sets default to empty if section do not exists" do | ||
subject.default = "non-exist" | ||
expect(subject.default).to eq "" | ||
end | ||
end | ||
|
||
describe "#write" do | ||
it "writes default value if set" do | ||
subject.default = "Snapper: *openSUSE Tumbleweed 20241107" | ||
expect(Yast::Execute).to receive(:on_target) | ||
.with("/usr/bin/sdbootutil", "set-default", subject.default, { :allowed_exitstatus=>[0, 1] }) | ||
subject.write | ||
end | ||
|
||
it "does not write default value if not set" do | ||
subject.default = "" | ||
expect(Yast::Execute).to_not receive(:on_target) | ||
.with("/usr/bin/sdbootutil", "set-default", subject.default, { :allowed_exitstatus=>[0, 1] }) | ||
subject.write | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.