blob: a7c6f167c3bc461deb5e3e4fe03dea9a23572c62 [file] [log] [blame]
Andreas Färber6e8114a2014-02-21 17:49:12 +01001/*
2 * QTest testcase for VirtIO Console
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
Andreas Färber6e8114a2014-02-21 17:49:12 +010010#include "qemu/osdep.h"
Peter Maydell681c28a2016-02-08 18:08:51 +000011#include "libqtest.h"
Thomas Huthd0a5cc52017-10-18 16:20:28 +020012#include "libqos/virtio.h"
Andreas Färber6e8114a2014-02-21 17:49:12 +010013
14/* Tests only initialization so far. TODO: Replace with functional tests */
Thomas Huthd0a5cc52017-10-18 16:20:28 +020015static void console_nop(void)
Andreas Färber6e8114a2014-02-21 17:49:12 +010016{
Markus Armbruster88b988c2018-08-06 08:53:43 +020017 global_qtest = qtest_initf("-device virtio-serial-%s,id=vser0 "
18 "-device virtconsole,bus=vser0.0",
19 qvirtio_get_dev_type());
Andreas Färberf33f9912014-03-13 16:47:24 +010020 qtest_end();
21}
22
Thomas Huthd0a5cc52017-10-18 16:20:28 +020023static void serialport_nop(void)
Andreas Färberf33f9912014-03-13 16:47:24 +010024{
Markus Armbruster88b988c2018-08-06 08:53:43 +020025 global_qtest = qtest_initf("-device virtio-serial-%s,id=vser0 "
26 "-device virtserialport,bus=vser0.0",
27 qvirtio_get_dev_type());
Andreas Färberf33f9912014-03-13 16:47:24 +010028 qtest_end();
Andreas Färber6e8114a2014-02-21 17:49:12 +010029}
30
31int main(int argc, char **argv)
32{
Andreas Färber6e8114a2014-02-21 17:49:12 +010033 g_test_init(&argc, &argv, NULL);
Thomas Huthd0a5cc52017-10-18 16:20:28 +020034 qtest_add_func("/virtio/console/nop", console_nop);
35 qtest_add_func("/virtio/serialport/nop", serialport_nop);
Andreas Färber6e8114a2014-02-21 17:49:12 +010036
Eduardo Habkost9be38592016-06-13 18:57:58 -030037 return g_test_run();
Andreas Färber6e8114a2014-02-21 17:49:12 +010038}