blob: f189ac8a08de2ffbaa275f0e43e0120e8d86632e [file] [log] [blame] [edit]
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package cosboot
import "testing"
func TestDiskBootPath(t *testing.T) {
tests := []struct {
name string
input string
want BootPath
}{
{
name: "GRUB",
input: "testdata/shimefi.img",
want: GRUBBoot,
},
{
name: "Kernel",
input: "testdata/kernelefi.img",
want: UKI,
},
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
got, err := DiskBootPath(test.input)
if err != nil {
t.Fatalf("DiskBootPath(%q) = %v; want nil", test.input, err)
}
if got != test.want {
t.Errorf("DiskBootPath(%q) = %v; want %v", test.input, got, test.want)
}
})
}
}