xref: /qemu/tests/qtest/qos-test.c (revision 30ea13e9)
11e8a1faeSThomas Huth /*
21e8a1faeSThomas Huth  * libqos driver framework
31e8a1faeSThomas Huth  *
41e8a1faeSThomas Huth  * Copyright (c) 2018 Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
51e8a1faeSThomas Huth  *
61e8a1faeSThomas Huth  * This library is free software; you can redistribute it and/or
71e8a1faeSThomas Huth  * modify it under the terms of the GNU Lesser General Public
8dc0ad02dSThomas Huth  * License version 2.1 as published by the Free Software Foundation.
91e8a1faeSThomas Huth  *
101e8a1faeSThomas Huth  * This library is distributed in the hope that it will be useful,
111e8a1faeSThomas Huth  * but WITHOUT ANY WARRANTY; without even the implied warranty of
121e8a1faeSThomas Huth  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
131e8a1faeSThomas Huth  * Lesser General Public License for more details.
141e8a1faeSThomas Huth  *
151e8a1faeSThomas Huth  * You should have received a copy of the GNU Lesser General Public
161e8a1faeSThomas Huth  * License along with this library; if not, see <http://www.gnu.org/licenses/>
171e8a1faeSThomas Huth  */
181e8a1faeSThomas Huth 
191e8a1faeSThomas Huth #include "qemu/osdep.h"
201e8a1faeSThomas Huth #include <getopt.h>
211e8a1faeSThomas Huth #include "libqtest-single.h"
22a56f3cdbSMarkus Armbruster #include "qapi/error.h"
231e8a1faeSThomas Huth #include "qapi/qmp/qdict.h"
241e8a1faeSThomas Huth #include "qemu/module.h"
25a56f3cdbSMarkus Armbruster #include "qapi/qobject-input-visitor.h"
26a56f3cdbSMarkus Armbruster #include "qapi/qapi-visit-machine.h"
27a56f3cdbSMarkus Armbruster #include "qapi/qapi-visit-qom.h"
28b243c73cSXuzhou Cheng #include "libqos/libqos-malloc.h"
291e8a1faeSThomas Huth #include "libqos/qgraph.h"
301e8a1faeSThomas Huth #include "libqos/qgraph_internal.h"
31f62a0bffSAlexander Bulekov #include "libqos/qos_external.h"
321e8a1faeSThomas Huth 
331e8a1faeSThomas Huth static char *old_path;
341e8a1faeSThomas Huth 
351e8a1faeSThomas Huth 
361e8a1faeSThomas Huth 
371e8a1faeSThomas Huth /**
381e8a1faeSThomas Huth  * qos_set_machines_devices_available(): sets availability of qgraph
391e8a1faeSThomas Huth  * machines and devices.
401e8a1faeSThomas Huth  *
411e8a1faeSThomas Huth  * This function firstly starts QEMU with "-machine none" option,
421e8a1faeSThomas Huth  * and then executes the QMP protocol asking for the list of devices
431e8a1faeSThomas Huth  * and machines available.
441e8a1faeSThomas Huth  *
451e8a1faeSThomas Huth  * for each of these items, it looks up the corresponding qgraph node,
461e8a1faeSThomas Huth  * setting it as available. The list currently returns all devices that
471e8a1faeSThomas Huth  * are either machines or QEDGE_CONSUMED_BY other nodes.
481e8a1faeSThomas Huth  * Therefore, in order to mark all other nodes, it recursively sets
491e8a1faeSThomas Huth  * all its QEDGE_CONTAINS and QEDGE_PRODUCES child as available too.
501e8a1faeSThomas Huth  */
qos_set_machines_devices_available(void)511e8a1faeSThomas Huth static void qos_set_machines_devices_available(void)
521e8a1faeSThomas Huth {
531e8a1faeSThomas Huth     QDict *response;
541e8a1faeSThomas Huth     QDict *args = qdict_new();
55a56f3cdbSMarkus Armbruster     QObject *ret;
56a56f3cdbSMarkus Armbruster     Visitor *v;
57a56f3cdbSMarkus Armbruster     MachineInfoList *mach_info;
58a56f3cdbSMarkus Armbruster     ObjectTypeInfoList *type_info;
591e8a1faeSThomas Huth 
601e8a1faeSThomas Huth     qtest_start("-machine none");
611e8a1faeSThomas Huth     response = qmp("{ 'execute': 'query-machines' }");
62a56f3cdbSMarkus Armbruster     ret = qdict_get(response, "return");
631e8a1faeSThomas Huth 
64a56f3cdbSMarkus Armbruster     v = qobject_input_visitor_new(ret);
65a56f3cdbSMarkus Armbruster     visit_type_MachineInfoList(v, NULL, &mach_info, &error_abort);
66a56f3cdbSMarkus Armbruster     visit_free(v);
67a56f3cdbSMarkus Armbruster     machines_apply_to_node(mach_info);
68a56f3cdbSMarkus Armbruster     qapi_free_MachineInfoList(mach_info);
691e8a1faeSThomas Huth 
701e8a1faeSThomas Huth     qobject_unref(response);
711e8a1faeSThomas Huth 
721e8a1faeSThomas Huth     qdict_put_bool(args, "abstract", true);
731e8a1faeSThomas Huth     qdict_put_str(args, "implements", "device");
741e8a1faeSThomas Huth 
751e8a1faeSThomas Huth     response = qmp("{'execute': 'qom-list-types',"
761e8a1faeSThomas Huth                    " 'arguments': %p }", args);
77a56f3cdbSMarkus Armbruster     ret = qdict_get(response, "return");
781e8a1faeSThomas Huth 
79a56f3cdbSMarkus Armbruster     v = qobject_input_visitor_new(ret);
80a56f3cdbSMarkus Armbruster     visit_type_ObjectTypeInfoList(v, NULL, &type_info, &error_abort);
81a56f3cdbSMarkus Armbruster     visit_free(v);
82a56f3cdbSMarkus Armbruster     types_apply_to_node(type_info);
83a56f3cdbSMarkus Armbruster     qapi_free_ObjectTypeInfoList(type_info);
841e8a1faeSThomas Huth 
851e8a1faeSThomas Huth     qtest_end();
861e8a1faeSThomas Huth     qobject_unref(response);
871e8a1faeSThomas Huth }
881e8a1faeSThomas Huth 
891e8a1faeSThomas Huth 
restart_qemu_or_continue(char * path)901e8a1faeSThomas Huth static void restart_qemu_or_continue(char *path)
911e8a1faeSThomas Huth {
92b0019c99SChristian Schoenebeck     if (g_test_verbose()) {
93b0019c99SChristian Schoenebeck         qos_printf("Run QEMU with: '%s'\n", path);
94b0019c99SChristian Schoenebeck     }
951e8a1faeSThomas Huth     /* compares the current command line with the
961e8a1faeSThomas Huth      * one previously executed: if they are the same,
971e8a1faeSThomas Huth      * don't restart QEMU, if they differ, stop previous
981e8a1faeSThomas Huth      * QEMU subprocess (if active) and start over with
991e8a1faeSThomas Huth      * the new command line
1001e8a1faeSThomas Huth      */
1011e8a1faeSThomas Huth     if (g_strcmp0(old_path, path)) {
1021e8a1faeSThomas Huth         qtest_end();
1031e8a1faeSThomas Huth         qos_invalidate_command_line();
1041e8a1faeSThomas Huth         old_path = g_strdup(path);
1051e8a1faeSThomas Huth         qtest_start(path);
1061e8a1faeSThomas Huth     } else { /* if cmd line is the same, reset the guest */
1071e8a1faeSThomas Huth         qobject_unref(qmp("{ 'execute': 'system_reset' }"));
1081e8a1faeSThomas Huth         qmp_eventwait("RESET");
1091e8a1faeSThomas Huth     }
1101e8a1faeSThomas Huth }
1111e8a1faeSThomas Huth 
qos_invalidate_command_line(void)1121e8a1faeSThomas Huth void qos_invalidate_command_line(void)
1131e8a1faeSThomas Huth {
1141e8a1faeSThomas Huth     g_free(old_path);
1151e8a1faeSThomas Huth     old_path = NULL;
1161e8a1faeSThomas Huth }
1171e8a1faeSThomas Huth 
1181e8a1faeSThomas Huth 
1191e8a1faeSThomas Huth /* The argument to run_one_test, which is the test function that is registered
1201e8a1faeSThomas Huth  * with GTest, is a vector of strings.  The first item is the initial command
1211e8a1faeSThomas Huth  * line (before it is modified by the test's "before" function), the remaining
1221e8a1faeSThomas Huth  * items are node names forming the path to the test node.
1231e8a1faeSThomas Huth  */
1241e8a1faeSThomas Huth static char **current_path;
1251e8a1faeSThomas Huth 
qos_get_current_command_line(void)1261e8a1faeSThomas Huth const char *qos_get_current_command_line(void)
1271e8a1faeSThomas Huth {
1281e8a1faeSThomas Huth     return current_path[0];
1291e8a1faeSThomas Huth }
1301e8a1faeSThomas Huth 
qos_allocate_objects(QTestState * qts,QGuestAllocator ** p_alloc)1311e8a1faeSThomas Huth void *qos_allocate_objects(QTestState *qts, QGuestAllocator **p_alloc)
1321e8a1faeSThomas Huth {
1331e8a1faeSThomas Huth     return allocate_objects(qts, current_path + 1, p_alloc);
1341e8a1faeSThomas Huth }
1351e8a1faeSThomas Huth 
1361e8a1faeSThomas Huth /**
1371e8a1faeSThomas Huth  * run_one_test(): given an array of nodes @arg,
1381e8a1faeSThomas Huth  * walks the path invoking all constructors and
1391e8a1faeSThomas Huth  * passing the corresponding parameter in order to
1401e8a1faeSThomas Huth  * continue the objects allocation.
1411e8a1faeSThomas Huth  * Once the test is reached, its function is executed.
1421e8a1faeSThomas Huth  *
1431e8a1faeSThomas Huth  * Since the machine and QEDGE_CONSUMED_BY nodes allocate
1441e8a1faeSThomas Huth  * memory in the constructor, g_test_queue_destroy is used so
1451e8a1faeSThomas Huth  * that after execution they can be safely free'd.  The test's
1461e8a1faeSThomas Huth  * ->before callback is also welcome to use g_test_queue_destroy.
1471e8a1faeSThomas Huth  *
1481e8a1faeSThomas Huth  * Note: as specified in walk_path() too, @arg is an array of
1491e8a1faeSThomas Huth  * char *, where arg[0] is a pointer to the command line
1501e8a1faeSThomas Huth  * string that will be used to properly start QEMU when executing
1511e8a1faeSThomas Huth  * the test, and the remaining elements represent the actual objects
1521e8a1faeSThomas Huth  * that will be allocated.
1531e8a1faeSThomas Huth  *
1541e8a1faeSThomas Huth  * The order of execution is the following:
1551e8a1faeSThomas Huth  * 1) @before test function as defined in the given QOSGraphTestOptions
1561e8a1faeSThomas Huth  * 2) start QEMU
1571e8a1faeSThomas Huth  * 3) call all nodes constructor and get_driver/get_device depending on edge,
1581e8a1faeSThomas Huth  *    start the hardware (*_device_enable functions)
1591e8a1faeSThomas Huth  * 4) start test
1601e8a1faeSThomas Huth  */
run_one_test(const void * arg)1611e8a1faeSThomas Huth static void run_one_test(const void *arg)
1621e8a1faeSThomas Huth {
1631e8a1faeSThomas Huth     QOSGraphNode *test_node;
1641e8a1faeSThomas Huth     QGuestAllocator *alloc = NULL;
1651e8a1faeSThomas Huth     void *obj;
1661e8a1faeSThomas Huth     char **path = (char **) arg;
1671e8a1faeSThomas Huth     GString *cmd_line = g_string_new(path[0]);
1681e8a1faeSThomas Huth     void *test_arg;
1691e8a1faeSThomas Huth 
1701e8a1faeSThomas Huth     /* Before test */
1711e8a1faeSThomas Huth     current_path = path;
1721e8a1faeSThomas Huth     test_node = qos_graph_get_node(path[(g_strv_length(path) - 1)]);
1731e8a1faeSThomas Huth     test_arg = test_node->u.test.arg;
1741e8a1faeSThomas Huth     if (test_node->u.test.before) {
1751e8a1faeSThomas Huth         test_arg = test_node->u.test.before(cmd_line, test_arg);
1761e8a1faeSThomas Huth     }
1771e8a1faeSThomas Huth 
1781e8a1faeSThomas Huth     restart_qemu_or_continue(cmd_line->str);
1791e8a1faeSThomas Huth     g_string_free(cmd_line, true);
1801e8a1faeSThomas Huth 
1811e8a1faeSThomas Huth     obj = qos_allocate_objects(global_qtest, &alloc);
1821e8a1faeSThomas Huth     test_node->u.test.function(obj, test_arg, alloc);
1831e8a1faeSThomas Huth }
1841e8a1faeSThomas Huth 
subprocess_run_one_test(const void * arg)1851e8a1faeSThomas Huth static void subprocess_run_one_test(const void *arg)
1861e8a1faeSThomas Huth {
1871e8a1faeSThomas Huth     const gchar *path = arg;
188ebaa0708SAlex Bennée     g_test_trap_subprocess(path, 180 * G_USEC_PER_SEC,
189bbd97115SAlex Bennée                            G_TEST_SUBPROCESS_INHERIT_STDOUT |
190bbd97115SAlex Bennée                            G_TEST_SUBPROCESS_INHERIT_STDERR);
1911e8a1faeSThomas Huth     g_test_trap_assert_passed();
1921e8a1faeSThomas Huth }
1931e8a1faeSThomas Huth 
1941e8a1faeSThomas Huth /*
1951e8a1faeSThomas Huth  * in this function, 2 path will be built:
1961e8a1faeSThomas Huth  * path_str, a one-string path (ex "pc/i440FX-pcihost/...")
1971e8a1faeSThomas Huth  * path_vec, a string-array path (ex [0] = "pc", [1] = "i440FX-pcihost").
1981e8a1faeSThomas Huth  *
1991e8a1faeSThomas Huth  * path_str will be only used to build the test name, and won't need the
2001e8a1faeSThomas Huth  * architecture name at beginning, since it will be added by qtest_add_func().
2011e8a1faeSThomas Huth  *
2021e8a1faeSThomas Huth  * path_vec is used to allocate all constructors of the path nodes.
2031e8a1faeSThomas Huth  * Each name in this array except position 0 must correspond to a valid
2041e8a1faeSThomas Huth  * QOSGraphNode name.
2051e8a1faeSThomas Huth  * Position 0 is special, initially contains just the <machine> name of
2061e8a1faeSThomas Huth  * the node, (ex for "x86_64/pc" it will be "pc"), used to build the test
2071e8a1faeSThomas Huth  * path (see below). After it will contain the command line used to start
2081e8a1faeSThomas Huth  * qemu with all required devices.
2091e8a1faeSThomas Huth  *
2101e8a1faeSThomas Huth  * Note that the machine node name must be with format <arch>/<machine>
2111e8a1faeSThomas Huth  * (ex "x86_64/pc"), because it will identify the node "x86_64/pc"
2121e8a1faeSThomas Huth  * and start QEMU with "-M pc". For this reason,
2131e8a1faeSThomas Huth  * when building path_str, path_vec
2141e8a1faeSThomas Huth  * initially contains the <machine> at position 0 ("pc"),
2151e8a1faeSThomas Huth  * and the node name at position 1 (<arch>/<machine>)
2161e8a1faeSThomas Huth  * ("x86_64/pc"), followed by the rest of the nodes.
2171e8a1faeSThomas Huth  */
walk_path(QOSGraphNode * orig_path,int len)2181e8a1faeSThomas Huth static void walk_path(QOSGraphNode *orig_path, int len)
2191e8a1faeSThomas Huth {
2201e8a1faeSThomas Huth     QOSGraphNode *path;
2211e8a1faeSThomas Huth     QOSGraphEdge *edge;
2221e8a1faeSThomas Huth 
2231e8a1faeSThomas Huth     /* etype set to QEDGE_CONSUMED_BY so that machine can add to the command line */
2241e8a1faeSThomas Huth     QOSEdgeType etype = QEDGE_CONSUMED_BY;
2251e8a1faeSThomas Huth 
2261e8a1faeSThomas Huth     /* twice QOS_PATH_MAX_ELEMENT_SIZE since each edge can have its arg */
2271e8a1faeSThomas Huth     char **path_vec = g_new0(char *, (QOS_PATH_MAX_ELEMENT_SIZE * 2));
2281e8a1faeSThomas Huth     int path_vec_size = 0;
2291e8a1faeSThomas Huth 
2301e8a1faeSThomas Huth     char *after_cmd, *before_cmd, *after_device;
2311e8a1faeSThomas Huth     GString *after_device_str = g_string_new("");
2321e8a1faeSThomas Huth     char *node_name = orig_path->name, *path_str;
2331e8a1faeSThomas Huth 
2341e8a1faeSThomas Huth     GString *cmd_line = g_string_new("");
2351e8a1faeSThomas Huth     GString *cmd_line2 = g_string_new("");
2361e8a1faeSThomas Huth 
2371e8a1faeSThomas Huth     path = qos_graph_get_node(node_name); /* root */
2381e8a1faeSThomas Huth     node_name = qos_graph_edge_get_dest(path->path_edge); /* machine name */
2391e8a1faeSThomas Huth 
2401e8a1faeSThomas Huth     path_vec[path_vec_size++] = node_name;
2411e8a1faeSThomas Huth     path_vec[path_vec_size++] = qos_get_machine_type(node_name);
2421e8a1faeSThomas Huth 
2431e8a1faeSThomas Huth     for (;;) {
2441e8a1faeSThomas Huth         path = qos_graph_get_node(node_name);
2451e8a1faeSThomas Huth         if (!path->path_edge) {
2461e8a1faeSThomas Huth             break;
2471e8a1faeSThomas Huth         }
2481e8a1faeSThomas Huth 
2491e8a1faeSThomas Huth         node_name = qos_graph_edge_get_dest(path->path_edge);
2501e8a1faeSThomas Huth 
2511e8a1faeSThomas Huth         /* append node command line + previous edge command line */
2521e8a1faeSThomas Huth         if (path->command_line && etype == QEDGE_CONSUMED_BY) {
2531e8a1faeSThomas Huth             g_string_append(cmd_line, path->command_line);
2541e8a1faeSThomas Huth             g_string_append(cmd_line, after_device_str->str);
2551e8a1faeSThomas Huth             g_string_truncate(after_device_str, 0);
2561e8a1faeSThomas Huth         }
2571e8a1faeSThomas Huth 
2581e8a1faeSThomas Huth         path_vec[path_vec_size++] = qos_graph_edge_get_name(path->path_edge);
2591e8a1faeSThomas Huth         /* detect if edge has command line args */
2601e8a1faeSThomas Huth         after_cmd = qos_graph_edge_get_after_cmd_line(path->path_edge);
2611e8a1faeSThomas Huth         after_device = qos_graph_edge_get_extra_device_opts(path->path_edge);
2621e8a1faeSThomas Huth         before_cmd = qos_graph_edge_get_before_cmd_line(path->path_edge);
2631e8a1faeSThomas Huth         edge = qos_graph_get_edge(path->name, node_name);
2641e8a1faeSThomas Huth         etype = qos_graph_edge_get_type(edge);
2651e8a1faeSThomas Huth 
2661e8a1faeSThomas Huth         if (before_cmd) {
2671e8a1faeSThomas Huth             g_string_append(cmd_line, before_cmd);
2681e8a1faeSThomas Huth         }
2691e8a1faeSThomas Huth         if (after_cmd) {
2701e8a1faeSThomas Huth             g_string_append(cmd_line2, after_cmd);
2711e8a1faeSThomas Huth         }
2721e8a1faeSThomas Huth         if (after_device) {
2731e8a1faeSThomas Huth             g_string_append(after_device_str, after_device);
2741e8a1faeSThomas Huth         }
2751e8a1faeSThomas Huth     }
2761e8a1faeSThomas Huth 
2771e8a1faeSThomas Huth     path_vec[path_vec_size++] = NULL;
2781e8a1faeSThomas Huth     g_string_append(cmd_line, after_device_str->str);
2791e8a1faeSThomas Huth     g_string_free(after_device_str, true);
2801e8a1faeSThomas Huth 
2811e8a1faeSThomas Huth     g_string_append(cmd_line, cmd_line2->str);
2821e8a1faeSThomas Huth     g_string_free(cmd_line2, true);
2831e8a1faeSThomas Huth 
2841e8a1faeSThomas Huth     /* here position 0 has <arch>/<machine>, position 1 has <machine>.
2851e8a1faeSThomas Huth      * The path must not have the <arch>, qtest_add_data_func adds it.
2861e8a1faeSThomas Huth      */
2871e8a1faeSThomas Huth     path_str = g_strjoinv("/", path_vec + 1);
2881e8a1faeSThomas Huth 
2891e8a1faeSThomas Huth     /* put arch/machine in position 1 so run_one_test can do its work
2901e8a1faeSThomas Huth      * and add the command line at position 0.
2911e8a1faeSThomas Huth      */
2921e8a1faeSThomas Huth     path_vec[1] = path_vec[0];
2931e8a1faeSThomas Huth     path_vec[0] = g_string_free(cmd_line, false);
2941e8a1faeSThomas Huth 
2951e8a1faeSThomas Huth     if (path->u.test.subprocess) {
2961e8a1faeSThomas Huth         gchar *subprocess_path = g_strdup_printf("/%s/%s/subprocess",
2971e8a1faeSThomas Huth                                                  qtest_get_arch(), path_str);
2981e8a1faeSThomas Huth         qtest_add_data_func(path_str, subprocess_path, subprocess_run_one_test);
2991e8a1faeSThomas Huth         g_test_add_data_func(subprocess_path, path_vec, run_one_test);
3001e8a1faeSThomas Huth     } else {
3011e8a1faeSThomas Huth         qtest_add_data_func(path_str, path_vec, run_one_test);
3021e8a1faeSThomas Huth     }
3031e8a1faeSThomas Huth 
3041e8a1faeSThomas Huth     g_free(path_str);
3051e8a1faeSThomas Huth }
3061e8a1faeSThomas Huth 
3071e8a1faeSThomas Huth 
3081e8a1faeSThomas Huth 
3091e8a1faeSThomas Huth /**
3101e8a1faeSThomas Huth  * main(): heart of the qgraph framework.
3111e8a1faeSThomas Huth  *
3121e8a1faeSThomas Huth  * - Initializes the glib test framework
3131e8a1faeSThomas Huth  * - Creates the graph by invoking the various _init constructors
3141e8a1faeSThomas Huth  * - Starts QEMU to mark the available devices
3151e8a1faeSThomas Huth  * - Walks the graph, and each path is added to
3161e8a1faeSThomas Huth  *   the glib test framework (walk_path)
3171e8a1faeSThomas Huth  * - Runs the tests, calling allocate_object() and allocating the
3181e8a1faeSThomas Huth  *   machine/drivers/test objects
3191e8a1faeSThomas Huth  * - Cleans up everything
3201e8a1faeSThomas Huth  */
main(int argc,char ** argv,char ** envp)321093360dcSChristian Schoenebeck int main(int argc, char **argv, char** envp)
3221e8a1faeSThomas Huth {
3231e8a1faeSThomas Huth     g_test_init(&argc, &argv, NULL);
32430ea13e9SAlex Bennée 
32530ea13e9SAlex Bennée     if (g_test_subprocess()) {
32630ea13e9SAlex Bennée         qos_printf("qos_test running single test in subprocess\n");
32730ea13e9SAlex Bennée     }
32830ea13e9SAlex Bennée 
329093360dcSChristian Schoenebeck     if (g_test_verbose()) {
330093360dcSChristian Schoenebeck         qos_printf("ENVIRONMENT VARIABLES: {\n");
331093360dcSChristian Schoenebeck         for (char **env = envp; *env != 0; env++) {
332093360dcSChristian Schoenebeck             qos_printf("\t%s\n", *env);
333093360dcSChristian Schoenebeck         }
334093360dcSChristian Schoenebeck         qos_printf("}\n");
335093360dcSChristian Schoenebeck     }
3361e8a1faeSThomas Huth     qos_graph_init();
3371e8a1faeSThomas Huth     module_call_init(MODULE_INIT_QOM);
3381e8a1faeSThomas Huth     module_call_init(MODULE_INIT_LIBQOS);
3391e8a1faeSThomas Huth     qos_set_machines_devices_available();
3401e8a1faeSThomas Huth 
3411e8a1faeSThomas Huth     qos_graph_foreach_test_path(walk_path);
34283ff78e5SChristian Schoenebeck     if (g_test_verbose()) {
34383ff78e5SChristian Schoenebeck         qos_dump_graph();
34483ff78e5SChristian Schoenebeck     }
3451e8a1faeSThomas Huth     g_test_run();
3461e8a1faeSThomas Huth     qtest_end();
3471e8a1faeSThomas Huth     qos_graph_destroy();
3481e8a1faeSThomas Huth     g_free(old_path);
3491e8a1faeSThomas Huth     return 0;
3501e8a1faeSThomas Huth }
351