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

Commit

Permalink
qemu: Add test for qemuConfig Knobs
Browse files Browse the repository at this point in the history
Add TestQemuKnobs unit test to validate parameters passed to QEMU.

Signed-off-by: Liam Merwick <[email protected]>
  • Loading branch information
merwick committed Jul 30, 2020
1 parent 0d5c05e commit b1cbf83
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions virtcontainers/qemu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,23 @@ func TestQemuMemoryTopology(t *testing.T) {
assert.Exactly(memory, expectedOut)
}

func TestQemuKnobs(t *testing.T) {
assert := assert.New(t)

sandbox, err := createQemuSandboxConfig()
assert.NoError(err)

q := &qemu{
store: sandbox.newStore,
}
err = q.createSandbox(context.Background(), sandbox.id, NetworkNamespace{}, &sandbox.config.HypervisorConfig, false)
assert.NoError(err)

assert.Equal(q.qemuConfig.Knobs.NoUserConfig, true)
assert.Equal(q.qemuConfig.Knobs.NoDefaults, true)
assert.Equal(q.qemuConfig.Knobs.NoGraphic, true)
}

func testQemuAddDevice(t *testing.T, devInfo interface{}, devType deviceType, expected []govmmQemu.Device) {
assert := assert.New(t)
q := &qemu{
Expand Down

0 comments on commit b1cbf83

Please sign in to comment.