Andrey Smirnov 53873b8444
refactor: move ukify into Talos code
This is intemediate step to move parts of the `ukify` down to the main
Talos source tree, and call it from `talosctl` binary.

The next step will be to integrate it into the imager and move `.uki`
build out of the Dockerfile.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2023-07-13 19:14:32 +04:00

26 lines
775 B
Go

// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package uki_test
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/siderolabs/talos/internal/pkg/secureboot/uki"
)
func TestGetSBAT(t *testing.T) {
t.Parallel()
data, err := uki.GetSBAT("../pesign/testdata/systemd-bootx64.efi")
require.NoError(t, err)
require.Equal(t,
"sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md\nsystemd,1,The systemd Developers,systemd,254,https://systemd.io/\nsystemd.talos,1,Talos Linux,systemd,254,https://github.com/siderolabs/tools/issues\n\x00", //nolint:lll
string(data),
)
}