mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-22 16:54:25 +01:00
runtime: Add contexts to calls in unit tests
Modify calls in unit tests to use context since many functions were updated to accept local context to fix trace span ordering. Fixes #1355 Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
This commit is contained in:
@@ -333,7 +333,7 @@ func TestQemuGetSandboxConsole(t *testing.T) {
|
||||
sandboxID := "testSandboxID"
|
||||
expected := filepath.Join(q.store.RunVMStoragePath(), sandboxID, consoleSocket)
|
||||
|
||||
proto, result, err := q.getSandboxConsole(sandboxID)
|
||||
proto, result, err := q.getSandboxConsole(q.ctx, sandboxID)
|
||||
assert.NoError(err)
|
||||
assert.Equal(result, expected)
|
||||
assert.Equal(proto, consoleProtoUnix)
|
||||
@@ -346,7 +346,7 @@ func TestQemuCapabilities(t *testing.T) {
|
||||
arch: &qemuArchBase{},
|
||||
}
|
||||
|
||||
caps := q.capabilities()
|
||||
caps := q.capabilities(q.ctx)
|
||||
assert.True(caps.IsBlockDeviceHotplugSupported())
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ func TestQemuCleanup(t *testing.T) {
|
||||
config: newQemuConfig(),
|
||||
}
|
||||
|
||||
err := q.cleanup()
|
||||
err := q.cleanup(q.ctx)
|
||||
assert.Nil(err)
|
||||
}
|
||||
|
||||
@@ -444,7 +444,7 @@ func TestQemuGrpc(t *testing.T) {
|
||||
config: config,
|
||||
}
|
||||
|
||||
json, err := q.toGrpc()
|
||||
json, err := q.toGrpc(context.Background())
|
||||
assert.Nil(err)
|
||||
|
||||
var q2 qemu
|
||||
|
||||
Reference in New Issue
Block a user