virtcontainers: Fix TestQemuAmd64AppendProtectionDevice()

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 <fidencio@redhat.com>
This commit is contained in:
Fabiano Fidêncio 2021-06-11 23:46:07 +02:00 committed by Jim Cadden
parent b26d5b1d08
commit be31694554

View File

@ -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)
}