2014-02-21 17:49:12 +01:00
|
|
|
/*
|
|
|
|
* QTest testcase for VirtIO Console
|
|
|
|
*
|
|
|
|
* Copyright (c) 2014 SUSE LINUX Products GmbH
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
2016-02-08 19:08:51 +01:00
|
|
|
#include "qemu/osdep.h"
|
2014-02-21 17:49:12 +01:00
|
|
|
#include "libqtest.h"
|
2017-10-18 16:20:28 +02:00
|
|
|
#include "libqos/virtio.h"
|
2014-02-21 17:49:12 +01:00
|
|
|
|
|
|
|
/* Tests only initialization so far. TODO: Replace with functional tests */
|
2017-10-18 16:20:28 +02:00
|
|
|
static void console_nop(void)
|
2014-02-21 17:49:12 +01:00
|
|
|
{
|
2018-08-06 08:53:43 +02:00
|
|
|
global_qtest = qtest_initf("-device virtio-serial-%s,id=vser0 "
|
|
|
|
"-device virtconsole,bus=vser0.0",
|
|
|
|
qvirtio_get_dev_type());
|
2014-03-13 16:47:24 +01:00
|
|
|
qtest_end();
|
|
|
|
}
|
|
|
|
|
2017-10-18 16:20:28 +02:00
|
|
|
static void serialport_nop(void)
|
2014-03-13 16:47:24 +01:00
|
|
|
{
|
2018-08-06 08:53:43 +02:00
|
|
|
global_qtest = qtest_initf("-device virtio-serial-%s,id=vser0 "
|
|
|
|
"-device virtserialport,bus=vser0.0",
|
|
|
|
qvirtio_get_dev_type());
|
2014-03-13 16:47:24 +01:00
|
|
|
qtest_end();
|
2014-02-21 17:49:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
g_test_init(&argc, &argv, NULL);
|
2017-10-18 16:20:28 +02:00
|
|
|
qtest_add_func("/virtio/console/nop", console_nop);
|
|
|
|
qtest_add_func("/virtio/serialport/nop", serialport_nop);
|
2014-02-21 17:49:12 +01:00
|
|
|
|
2016-06-13 23:57:58 +02:00
|
|
|
return g_test_run();
|
2014-02-21 17:49:12 +01:00
|
|
|
}
|