Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
virtcontainers: Reduce qemu test noise
Browse files Browse the repository at this point in the history
We only need to set the context before calling into qemu's API.

Fixes: #1211

Signed-off-by: Samuel Ortiz <[email protected]>
  • Loading branch information
Samuel Ortiz committed Feb 5, 2019
1 parent 560902c commit 799ac6e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion virtcontainers/qemu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ func TestQemuMemoryTopology(t *testing.T) {

func testQemuAddDevice(t *testing.T, devInfo interface{}, devType deviceType, expected []govmmQemu.Device) {
q := &qemu{
ctx: context.Background(),
arch: &qemuArchBase{},
}

Expand Down Expand Up @@ -286,7 +287,9 @@ func TestQemuAddDeviceKataVSOCK(t *testing.T) {
}

func TestQemuGetSandboxConsole(t *testing.T) {
q := &qemu{}
q := &qemu{
ctx: context.Background(),
}
sandboxID := "testSandboxID"
expected := filepath.Join(RunVMStoragePath, sandboxID, consoleSocket)

Expand All @@ -302,6 +305,7 @@ func TestQemuGetSandboxConsole(t *testing.T) {

func TestQemuCapabilities(t *testing.T) {
q := &qemu{
ctx: context.Background(),
arch: &qemuArchBase{},
}

Expand Down Expand Up @@ -365,6 +369,7 @@ func TestHotplugUnsupportedDeviceType(t *testing.T) {
qemuConfig := newQemuConfig()
fs := &filesystem{}
q := &qemu{
ctx: context.Background(),
config: qemuConfig,
storage: fs,
}
Expand Down Expand Up @@ -394,6 +399,7 @@ func TestQemuCleanup(t *testing.T) {
assert := assert.New(t)

q := &qemu{
ctx: context.Background(),
config: newQemuConfig(),
}

Expand Down

0 comments on commit 799ac6e

Please sign in to comment.