Andreas Färber | 6e8114a | 2014-02-21 17:49:12 +0100 | [diff] [blame] | 1 | /* |
| 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 | |
| 10 | #include <glib.h> |
| 11 | #include <string.h> |
| 12 | #include "libqtest.h" |
| 13 | #include "qemu/osdep.h" |
| 14 | |
| 15 | /* Tests only initialization so far. TODO: Replace with functional tests */ |
Andreas Färber | f33f991 | 2014-03-13 16:47:24 +0100 | [diff] [blame] | 16 | static void console_pci_nop(void) |
Andreas Färber | 6e8114a | 2014-02-21 17:49:12 +0100 | [diff] [blame] | 17 | { |
Andreas Färber | f33f991 | 2014-03-13 16:47:24 +0100 | [diff] [blame] | 18 | qtest_start("-device virtio-serial-pci,id=vser0 " |
| 19 | "-device virtconsole,bus=vser0.0"); |
| 20 | qtest_end(); |
| 21 | } |
| 22 | |
| 23 | static void serialport_pci_nop(void) |
| 24 | { |
| 25 | qtest_start("-device virtio-serial-pci,id=vser0 " |
| 26 | "-device virtserialport,bus=vser0.0"); |
| 27 | qtest_end(); |
Andreas Färber | 6e8114a | 2014-02-21 17:49:12 +0100 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | int main(int argc, char **argv) |
| 31 | { |
| 32 | int ret; |
| 33 | |
| 34 | g_test_init(&argc, &argv, NULL); |
Andreas Färber | f33f991 | 2014-03-13 16:47:24 +0100 | [diff] [blame] | 35 | qtest_add_func("/virtio/console/pci/nop", console_pci_nop); |
| 36 | qtest_add_func("/virtio/serialport/pci/nop", serialport_pci_nop); |
Andreas Färber | 6e8114a | 2014-02-21 17:49:12 +0100 | [diff] [blame] | 37 | |
Andreas Färber | 6e8114a | 2014-02-21 17:49:12 +0100 | [diff] [blame] | 38 | ret = g_test_run(); |
| 39 | |
Andreas Färber | 6e8114a | 2014-02-21 17:49:12 +0100 | [diff] [blame] | 40 | return ret; |
| 41 | } |