mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 12:14:48 +00:00
qemu: Add QMP socket unit tests
We test that the QMP socket parameter is properly built. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
7b2f7eb5d8
commit
5ba8ef79df
31
qemu_test.go
31
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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user