Project

General

Profile

« Previous | Next » 

Revision b7fc06c4

Added by Lukas Zapletal almost 6 years ago

Fixes #23930 - PXELinux loader is now preferred

View differences:

app/models/concerns/pxe_loader_support.rb
:PXEGrub2 => /^(grub2|Grub2).*/
}.with_indifferent_access.freeze
# preference order is defined in Operatingsystem#template_kinds
PREFERRED_KINDS = {
:PXEGrub2 => "Grub2 UEFI",
:PXELinux => "PXELinux BIOS",
:PXEGrub2 => "Grub2 UEFI",
:PXEGrub => "Grub UEFI"
}.with_indifferent_access.freeze
app/models/operatingsystem.rb
# Compatible kinds for this OS sorted by preferrence
def template_kinds
["PXEGrub2", "PXELinux", "PXEGrub"]
["PXELinux", "PXEGrub2", "PXEGrub"]
end
def boot_filename(host = nil)
test/models/concerns/pxe_loader_support_test.rb
assert_nil @subject.preferred_loader
end
test "is PXEGrub2 for associated templates" do
test "is PXELinux for all associated template kinds" do
@subject.expects(:os_default_templates).returns([@template_pxelinux, @template_pxegrub, @template_pxegrub2])
assert_equal "Grub2 UEFI", @subject.preferred_loader
assert_equal "PXELinux BIOS", @subject.preferred_loader
end
test "is PXELinux for associated templates" do
test "is PXELinux for associated PXELinux and PXEGrub" do
@subject.expects(:os_default_templates).returns([@template_pxelinux, @template_pxegrub])
assert_equal "PXELinux BIOS", @subject.preferred_loader
end
test "is PXEGrub for associated templates" do
test "is PXEGrub2 for associated template PXEGrub2" do
@subject.expects(:os_default_templates).returns([@template_pxegrub2])
assert_equal "Grub2 UEFI", @subject.preferred_loader
end
test "is PXEGrub for associated template PXEGrub" do
@subject.expects(:os_default_templates).returns([@template_pxegrub])
assert_equal "Grub UEFI", @subject.preferred_loader
end

Also available in: Unified diff