blob: 1c3de072f4e82d62bb68134881d67fe40db5f65d [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"
Andreas Färber6e8114a2014-02-21 17:49:12 +010012
13/* Tests only initialization so far. TODO: Replace with functional tests */
Andreas Färberf33f9912014-03-13 16:47:24 +010014static void console_pci_nop(void)
Andreas Färber6e8114a2014-02-21 17:49:12 +010015{
Andreas Färberf33f9912014-03-13 16:47:24 +010016 qtest_start("-device virtio-serial-pci,id=vser0 "
17 "-device virtconsole,bus=vser0.0");
18 qtest_end();
19}
20
21static void serialport_pci_nop(void)
22{
23 qtest_start("-device virtio-serial-pci,id=vser0 "
24 "-device virtserialport,bus=vser0.0");
25 qtest_end();
Andreas Färber6e8114a2014-02-21 17:49:12 +010026}
27
28int main(int argc, char **argv)
29{
Andreas Färber6e8114a2014-02-21 17:49:12 +010030 g_test_init(&argc, &argv, NULL);
Andreas Färberf33f9912014-03-13 16:47:24 +010031 qtest_add_func("/virtio/console/pci/nop", console_pci_nop);
32 qtest_add_func("/virtio/serialport/pci/nop", serialport_pci_nop);
Andreas Färber6e8114a2014-02-21 17:49:12 +010033
Eduardo Habkost9be38592016-06-13 18:57:58 -030034 return g_test_run();
Andreas Färber6e8114a2014-02-21 17:49:12 +010035}