mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 12:14:48 +00:00
check: fix typecheck failure in qemu_arm64_test.go
fix typecheck failure in qemu_arm64_test.go Fixes: #2789 Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
This commit is contained in:
parent
5b02d54e23
commit
8acfc154de
@ -158,19 +158,23 @@ const (
|
||||
|
||||
//Intel Trust Domain Extensions
|
||||
//https://software.intel.com/content/www/us/en/develop/articles/intel-trust-domain-extensions.html
|
||||
tdxProtection
|
||||
// Exclude from lint checking for it won't be used on arm64 code
|
||||
tdxProtection //nolint
|
||||
|
||||
// AMD Secure Encrypted Virtualization
|
||||
// https://developer.amd.com/sev/
|
||||
sevProtection
|
||||
// Exclude from lint checking for it won't be used on arm64 code
|
||||
sevProtection //nolint
|
||||
|
||||
// IBM POWER 9 Protected Execution Facility
|
||||
// https://www.kernel.org/doc/html/latest/powerpc/ultravisor.html
|
||||
pefProtection
|
||||
// Exclude from lint checking for it won't be used on arm64 code
|
||||
pefProtection //nolint
|
||||
|
||||
// IBM Secure Execution (IBM Z & LinuxONE)
|
||||
// https://www.kernel.org/doc/html/latest/virt/kvm/s390-pv.html
|
||||
seProtection
|
||||
// Exclude from lint checking for it won't be used on arm64 code
|
||||
seProtection //nolint
|
||||
)
|
||||
|
||||
type qemuArchBase struct {
|
||||
|
@ -105,14 +105,11 @@ func TestQemuArm64AppendImage(t *testing.T) {
|
||||
imageStat, err := f.Stat()
|
||||
assert.NoError(err)
|
||||
|
||||
// save default supportedQemuMachines options
|
||||
machinesCopy := make([]govmmQemu.Machine, len(supportedQemuMachines))
|
||||
assert.Equal(len(supportedQemuMachines), copy(machinesCopy, supportedQemuMachines))
|
||||
|
||||
cfg := qemuConfig(QemuVirt)
|
||||
cfg.ImagePath = f.Name()
|
||||
arm64 := newQemuArch(cfg)
|
||||
assert.Contains(m.machine().Options, qemuNvdimmOption)
|
||||
arm64, err := newQemuArch(cfg)
|
||||
assert.NoError(err)
|
||||
assert.Contains(arm64.machine().Options, qemuNvdimmOption)
|
||||
|
||||
expectedOut := []govmmQemu.Device{
|
||||
govmmQemu.Object{
|
||||
@ -128,9 +125,6 @@ func TestQemuArm64AppendImage(t *testing.T) {
|
||||
devices, err = arm64.appendImage(context.Background(), devices, f.Name())
|
||||
assert.NoError(err)
|
||||
assert.Equal(expectedOut, devices)
|
||||
|
||||
//restore default supportedQemuMachines options
|
||||
assert.Equal(len(supportedQemuMachines), copy(supportedQemuMachines, machinesCopy))
|
||||
}
|
||||
|
||||
func TestQemuArm64AppendNvdimmImage(t *testing.T) {
|
||||
@ -171,7 +165,8 @@ func TestQemuArm64WithInitrd(t *testing.T) {
|
||||
|
||||
cfg := qemuConfig(QemuVirt)
|
||||
cfg.InitrdPath = "dummy-initrd"
|
||||
arm64 := newQemuArch(cfg)
|
||||
arm64, err := newQemuArch(cfg)
|
||||
assert.NoError(err)
|
||||
|
||||
assert.NotContains(m.machine().Options, qemuNvdimmOption)
|
||||
assert.NotContains(arm64.machine().Options, qemuNvdimmOption)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user