diff options
Diffstat (limited to 'tests/test-filter-redirector.c')
-rw-r--r-- | tests/test-filter-redirector.c | 56 |
1 files changed, 26 insertions, 30 deletions
diff --git a/tests/test-filter-redirector.c b/tests/test-filter-redirector.c index 3afd411..f256614 100644 --- a/tests/test-filter-redirector.c +++ b/tests/test-filter-redirector.c @@ -70,7 +70,6 @@ static const char *get_devstr(void) static void test_redirector_tx(void) { int backend_sock[2], recv_sock; - char *cmdline; uint32_t ret = 0, len = 0; char send_buf[] = "Hello!!"; char sock_path0[] = "filter-redirector0.XXXXXX"; @@ -87,20 +86,19 @@ static void test_redirector_tx(void) ret = mkstemp(sock_path1); g_assert_cmpint(ret, !=, -1); - cmdline = g_strdup_printf("-netdev socket,id=qtest-bn0,fd=%d " - "-device %s,netdev=qtest-bn0,id=qtest-e0 " - "-chardev socket,id=redirector0,path=%s,server,nowait " - "-chardev socket,id=redirector1,path=%s,server,nowait " - "-chardev socket,id=redirector2,path=%s,nowait " - "-object filter-redirector,id=qtest-f0,netdev=qtest-bn0," - "queue=tx,outdev=redirector0 " - "-object filter-redirector,id=qtest-f1,netdev=qtest-bn0," - "queue=tx,indev=redirector2 " - "-object filter-redirector,id=qtest-f2,netdev=qtest-bn0," - "queue=tx,outdev=redirector1 ", backend_sock[1], get_devstr(), - sock_path0, sock_path1, sock_path0); - qtest_start(cmdline); - g_free(cmdline); + global_qtest = qtest_startf( + "-netdev socket,id=qtest-bn0,fd=%d " + "-device %s,netdev=qtest-bn0,id=qtest-e0 " + "-chardev socket,id=redirector0,path=%s,server,nowait " + "-chardev socket,id=redirector1,path=%s,server,nowait " + "-chardev socket,id=redirector2,path=%s,nowait " + "-object filter-redirector,id=qtest-f0,netdev=qtest-bn0," + "queue=tx,outdev=redirector0 " + "-object filter-redirector,id=qtest-f1,netdev=qtest-bn0," + "queue=tx,indev=redirector2 " + "-object filter-redirector,id=qtest-f2,netdev=qtest-bn0," + "queue=tx,outdev=redirector1 ", backend_sock[1], get_devstr(), + sock_path0, sock_path1, sock_path0); recv_sock = unix_connect(sock_path1, NULL); g_assert_cmpint(recv_sock, !=, -1); @@ -141,7 +139,6 @@ static void test_redirector_tx(void) static void test_redirector_rx(void) { int backend_sock[2], send_sock; - char *cmdline; uint32_t ret = 0, len = 0; char send_buf[] = "Hello!!"; char sock_path0[] = "filter-redirector0.XXXXXX"; @@ -158,20 +155,19 @@ static void test_redirector_rx(void) ret = mkstemp(sock_path1); g_assert_cmpint(ret, !=, -1); - cmdline = g_strdup_printf("-netdev socket,id=qtest-bn0,fd=%d " - "-device %s,netdev=qtest-bn0,id=qtest-e0 " - "-chardev socket,id=redirector0,path=%s,server,nowait " - "-chardev socket,id=redirector1,path=%s,server,nowait " - "-chardev socket,id=redirector2,path=%s,nowait " - "-object filter-redirector,id=qtest-f0,netdev=qtest-bn0," - "queue=rx,indev=redirector0 " - "-object filter-redirector,id=qtest-f1,netdev=qtest-bn0," - "queue=rx,outdev=redirector2 " - "-object filter-redirector,id=qtest-f2,netdev=qtest-bn0," - "queue=rx,indev=redirector1 ", backend_sock[1], get_devstr(), - sock_path0, sock_path1, sock_path0); - qtest_start(cmdline); - g_free(cmdline); + global_qtest = qtest_startf( + "-netdev socket,id=qtest-bn0,fd=%d " + "-device %s,netdev=qtest-bn0,id=qtest-e0 " + "-chardev socket,id=redirector0,path=%s,server,nowait " + "-chardev socket,id=redirector1,path=%s,server,nowait " + "-chardev socket,id=redirector2,path=%s,nowait " + "-object filter-redirector,id=qtest-f0,netdev=qtest-bn0," + "queue=rx,indev=redirector0 " + "-object filter-redirector,id=qtest-f1,netdev=qtest-bn0," + "queue=rx,outdev=redirector2 " + "-object filter-redirector,id=qtest-f2,netdev=qtest-bn0," + "queue=rx,indev=redirector1 ", backend_sock[1], get_devstr(), + sock_path0, sock_path1, sock_path0); struct iovec iov[] = { { |