From be316945542d7462aabfb464efc8344fb734e79a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Fri, 11 Jun 2021 23:46:07 +0200 Subject: [PATCH] virtcontainers: Fix TestQemuAmd64AppendProtectionDevice() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since SEV support has been added, an implementation mistake was also added to TestQemuAmd64AppendProtectionDevice. appendProtectionDevice() will, as it name says, append the protection device to whatever was there previously. So, when SEV was added, we broke the comparison done for TDX as we didn't append the expected output for TDX with what we already had for SEV. This should be enough to get the tests passing. Signed-off-by: Fabiano FidĂȘncio --- src/runtime/virtcontainers/qemu_amd64_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/virtcontainers/qemu_amd64_test.go b/src/runtime/virtcontainers/qemu_amd64_test.go index bfaaa05ef2..3024949594 100644 --- a/src/runtime/virtcontainers/qemu_amd64_test.go +++ b/src/runtime/virtcontainers/qemu_amd64_test.go @@ -327,7 +327,7 @@ func TestQemuAmd64AppendProtectionDevice(t *testing.T) { assert.NoError(err) assert.Empty(bios) - expectedOut = []govmmQemu.Device{ + expectedOut = append(expectedOut, govmmQemu.Object{ Driver: govmmQemu.Loader, Type: govmmQemu.TDXGuest, @@ -336,7 +336,7 @@ func TestQemuAmd64AppendProtectionDevice(t *testing.T) { Debug: false, File: firmware, }, - } + ) assert.Equal(expectedOut, devices) }