Merge remote-tracking branch 'remotes/famz/tags/docker-pull-request' into staging
[qemu/ar7.git] / tests / virtio-9p-test.c
blob1e39335a7945b6ad415f5589fd846f65fb2d9e3e
1 /*
2 * QTest testcase for VirtIO 9P
4 * Copyright (c) 2014 SUSE LINUX Products GmbH
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 */
10 #include "qemu/osdep.h"
11 #include "libqtest.h"
12 #include "qemu-common.h"
14 /* Tests only initialization so far. TODO: Replace with functional tests */
15 static void pci_nop(void)
19 static char test_share[] = "/tmp/qtest.XXXXXX";
21 int main(int argc, char **argv)
23 char *args;
24 int ret;
26 g_test_init(&argc, &argv, NULL);
27 qtest_add_func("/virtio/9p/pci/nop", pci_nop);
29 g_assert(mkdtemp(test_share));
31 args = g_strdup_printf("-fsdev local,id=fsdev0,security_model=none,path=%s "
32 "-device virtio-9p-pci,fsdev=fsdev0,mount_tag=qtest",
33 test_share);
34 qtest_start(args);
35 g_free(args);
37 ret = g_test_run();
39 qtest_end();
40 rmdir(test_share);
42 return ret;