mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 23:04:20 +01:00
runtime: suppport split firmware
firmware can be split into FIRMWARE_VARS.fd (UEFI variables as configuration) and FIRMWARE_CODE.fd (UEFI program image). UEFI variables can be customized per each user while UEFI code is kept same. fixes #3583 Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
@@ -1249,6 +1249,32 @@ func TestDefaultFirmware(t *testing.T) {
|
||||
defaultFirmwarePath = oldDefaultFirmwarePath
|
||||
}
|
||||
|
||||
func TestDefaultFirmwareVolume(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
// save default firmware path
|
||||
oldDefaultFirmwareVolumePath := defaultFirmwareVolumePath
|
||||
|
||||
f, err := os.CreateTemp(os.TempDir(), "vol")
|
||||
assert.NoError(err)
|
||||
assert.NoError(f.Close())
|
||||
defer os.RemoveAll(f.Name())
|
||||
|
||||
h := hypervisor{}
|
||||
defaultFirmwareVolumePath = ""
|
||||
p, err := h.firmwareVolume()
|
||||
assert.NoError(err)
|
||||
assert.Empty(p)
|
||||
|
||||
defaultFirmwareVolumePath = f.Name()
|
||||
p, err = h.firmwareVolume()
|
||||
assert.NoError(err)
|
||||
assert.NotEmpty(p)
|
||||
|
||||
// restore default firmware volume path
|
||||
defaultFirmwarePath = oldDefaultFirmwareVolumePath
|
||||
}
|
||||
|
||||
func TestDefaultMachineAccelerators(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
machineAccelerators := "abc,123,rgb"
|
||||
@@ -1355,12 +1381,13 @@ func TestUpdateRuntimeConfigurationVMConfig(t *testing.T) {
|
||||
tomlConf := tomlConfig{
|
||||
Hypervisor: map[string]hypervisor{
|
||||
qemuHypervisorTableType: {
|
||||
NumVCPUs: int32(vcpus),
|
||||
MemorySize: mem,
|
||||
Path: "/",
|
||||
Kernel: "/",
|
||||
Image: "/",
|
||||
Firmware: "/",
|
||||
NumVCPUs: int32(vcpus),
|
||||
MemorySize: mem,
|
||||
Path: "/",
|
||||
Kernel: "/",
|
||||
Image: "/",
|
||||
Firmware: "/",
|
||||
FirmwareVolume: "/",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user