diff --git a/qemu_test.go b/qemu_test.go index 7f01c4b612..d973a090d0 100644 --- a/qemu_test.go +++ b/qemu_test.go @@ -74,6 +74,13 @@ func testAppend(structure interface{}, expected string, t *testing.T) { } params = appendCPUs([]string{}, config) + + case QMPSocket: + config := Config{ + QMPSocket: s, + } + + params = appendQMPSocket([]string{}, config) } result := strings.Join(params, " ") @@ -205,3 +212,27 @@ func TestAppendCPUs(t *testing.T) { testAppend(smp, cpusString, t) } + +var qmpSocketServerString = "-qmp unix:cc-qmp,server,nowait" +var qmpSocketString = "-qmp unix:cc-qmp" + +func TestAppendQMPSocketServer(t *testing.T) { + qmp := QMPSocket{ + Type: "unix", + Name: "cc-qmp", + Server: true, + NoWait: true, + } + + testAppend(qmp, qmpSocketServerString, t) +} + +func TestAppendQMPSocket(t *testing.T) { + qmp := QMPSocket{ + Type: "unix", + Name: "cc-qmp", + Server: false, + } + + testAppend(qmp, qmpSocketString, t) +}