]>
Commit | Line | Data |
---|---|---|
a21baf79 AF |
1 | /* |
2 | * QTest testcase for e1000 NIC | |
3 | * | |
4 | * Copyright (c) 2013-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 | ||
681c28a3 | 10 | #include "qemu/osdep.h" |
a21baf79 | 11 | #include <glib.h> |
a21baf79 | 12 | #include "libqtest.h" |
a21baf79 AF |
13 | |
14 | /* Tests only initialization so far. TODO: Replace with functional tests */ | |
b167383f | 15 | static void test_device(gconstpointer data) |
a21baf79 | 16 | { |
b167383f GS |
17 | const char *model = data; |
18 | QTestState *s; | |
19 | char *args; | |
20 | ||
21 | args = g_strdup_printf("-device %s", model); | |
22 | s = qtest_start(args); | |
23 | ||
24 | if (s) { | |
25 | qtest_quit(s); | |
26 | } | |
27 | g_free(args); | |
a21baf79 AF |
28 | } |
29 | ||
b167383f GS |
30 | static const char *models[] = { |
31 | "e1000", | |
32 | "e1000-82540em", | |
33 | "e1000-82544gc", | |
34 | "e1000-82545em", | |
b167383f GS |
35 | }; |
36 | ||
a21baf79 AF |
37 | int main(int argc, char **argv) |
38 | { | |
b167383f | 39 | int i; |
a21baf79 AF |
40 | |
41 | g_test_init(&argc, &argv, NULL); | |
a21baf79 | 42 | |
b167383f GS |
43 | for (i = 0; i < ARRAY_SIZE(models); i++) { |
44 | char *path; | |
a21baf79 | 45 | |
53f77e45 AF |
46 | path = g_strdup_printf("e1000/%s", models[i]); |
47 | qtest_add_data_func(path, models[i], test_device); | |
b167383f | 48 | } |
a21baf79 | 49 | |
b167383f | 50 | return g_test_run(); |
a21baf79 | 51 | } |