]> git.proxmox.com Git - mirror_qemu.git/blame - tests/virtio-serial-test.c
tests/numa: Add case for QMP build HMAT
[mirror_qemu.git] / tests / virtio-serial-test.c
CommitLineData
aa97405e
AF
1/*
2 * QTest testcase for VirtIO Serial
3 *
4 * Copyright (c) 2014 SUSE LINUX Products GmbH
5 *
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
8 */
9
681c28a3 10#include "qemu/osdep.h"
dd210749 11#include "libqtest-single.h"
0b8fa32f 12#include "qemu/module.h"
1657291a 13#include "libqos/virtio-serial.h"
aa97405e
AF
14
15/* Tests only initialization so far. TODO: Replace with functional tests */
1657291a 16static void virtio_serial_nop(void *obj, void *data, QGuestAllocator *alloc)
aa97405e 17{
1657291a 18 /* no operation */
aa97405e
AF
19}
20
1657291a 21static void serial_hotplug(void *obj, void *data, QGuestAllocator *alloc)
823a9987 22{
e5758de4
TH
23 qtest_qmp_device_add(global_qtest, "virtserialport", "hp-port", "{}");
24 qtest_qmp_device_del(global_qtest, "hp-port");
823a9987
IM
25}
26
1657291a 27static void register_virtio_serial_test(void)
aa97405e 28{
1657291a 29 QOSGraphTestOptions opts = { };
aa97405e 30
1657291a
EGE
31 opts.edge.before_cmd_line = "-device virtconsole,bus=vser0.0";
32 qos_add_test("console-nop", "virtio-serial", virtio_serial_nop, &opts);
aa97405e 33
1657291a
EGE
34 opts.edge.before_cmd_line = "-device virtserialport,bus=vser0.0";
35 qos_add_test("serialport-nop", "virtio-serial", virtio_serial_nop, &opts);
aa97405e 36
1657291a 37 qos_add_test("hotplug", "virtio-serial", serial_hotplug, NULL);
aa97405e 38}
1657291a 39libqos_init(register_virtio_serial_test);