]>
Commit | Line | Data |
---|---|---|
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" |
aa97405e | 11 | #include "libqtest.h" |
1657291a | 12 | #include "libqos/virtio-serial.h" |
aa97405e AF |
13 | |
14 | /* Tests only initialization so far. TODO: Replace with functional tests */ | |
1657291a | 15 | static void virtio_serial_nop(void *obj, void *data, QGuestAllocator *alloc) |
aa97405e | 16 | { |
1657291a | 17 | /* no operation */ |
aa97405e AF |
18 | } |
19 | ||
1657291a | 20 | static void serial_hotplug(void *obj, void *data, QGuestAllocator *alloc) |
823a9987 | 21 | { |
82cab70b | 22 | qtest_qmp_device_add("virtserialport", "hp-port", "{}"); |
acd80015 | 23 | qtest_qmp_device_del("hp-port"); |
823a9987 IM |
24 | } |
25 | ||
1657291a | 26 | static void register_virtio_serial_test(void) |
aa97405e | 27 | { |
1657291a | 28 | QOSGraphTestOptions opts = { }; |
aa97405e | 29 | |
1657291a EGE |
30 | opts.edge.before_cmd_line = "-device virtconsole,bus=vser0.0"; |
31 | qos_add_test("console-nop", "virtio-serial", virtio_serial_nop, &opts); | |
aa97405e | 32 | |
1657291a EGE |
33 | opts.edge.before_cmd_line = "-device virtserialport,bus=vser0.0"; |
34 | qos_add_test("serialport-nop", "virtio-serial", virtio_serial_nop, &opts); | |
aa97405e | 35 | |
1657291a | 36 | qos_add_test("hotplug", "virtio-serial", serial_hotplug, NULL); |
aa97405e | 37 | } |
1657291a | 38 | libqos_init(register_virtio_serial_test); |