From patchwork Mon Jun 26 16:45:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 9810113 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6A70060329 for ; Mon, 26 Jun 2017 16:55:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F62728520 for ; Mon, 26 Jun 2017 16:55:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51C9428550; Mon, 26 Jun 2017 16:55:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0616428520 for ; Mon, 26 Jun 2017 16:55:01 +0000 (UTC) Received: from localhost ([::1]:47657 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPXHw-0000d4-4l for patchwork-qemu-devel@patchwork.kernel.org; Mon, 26 Jun 2017 12:55:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPXAN-0002Hd-LI for qemu-devel@nongnu.org; Mon, 26 Jun 2017 12:47:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dPXAK-00032I-HB for qemu-devel@nongnu.org; Mon, 26 Jun 2017 12:47:11 -0400 Received: from mail-eopbgr50110.outbound.protection.outlook.com ([40.107.5.110]:5493 helo=EUR03-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dPXAK-000316-0W for qemu-devel@nongnu.org; Mon, 26 Jun 2017 12:47:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LMQ7BmwfJ2Z6xUw3pAyRTXVw/m6Bro7zdBucGqGFC8I=; b=ReKpDfeO/JIg+5vmsJ88WD8rk8oJ2o3327UOpdiMjA1zJ+rw0cg91dKZQxpl+uZuVMIIESyAQjESmfygu6MkhTOlWNzfa5apuZudrENuceQI6MIv2CdQ5PcaTPiixkLehsKQfn83fdx8qiKjm0XiOlPKfhlVLm3s1HW/iEtvmrE= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=none action=none header.from=virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by VI1PR0801MB1998.eurprd08.prod.outlook.com (2603:10a6:800:8a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1199.15; Mon, 26 Jun 2017 16:47:02 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Mon, 26 Jun 2017 19:45:45 +0300 Message-ID: <1498495550-72357-9-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498495550-72357-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1498495550-72357-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HK2P15301CA0013.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::23) To VI1PR0801MB1998.eurprd08.prod.outlook.com (2603:10a6:800:8a::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15f81924-c1f0-49af-ebec-08d4bcb2fa71 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095); SRVR:VI1PR0801MB1998; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1998; 3:CCX+Lc7QkdrKqAMXLsE7iFhjI+WtFurGjMYqZXyMuh69vzIL7Do1vHCf2EN7ZuhrnNnOD41iKVtJsrv2xGtWbGmVWkrq0sa+u5qZz3W0fIi8LNR2NoI3vk4OLj+wkOEiXMe7tZdsMfZVm6VkU8jJjPq60Ex6mv9ChYlOCOzMIMBKVQyj301VU5RvrdIJzlA+m8sZ4gP40q+bpoGSi7kFvlSzP22G3c/pG4KOztatMpv8ZqXrRb1Lz4ScGe3I+6lvOn+/eFqWT1mgjkvDfNpx7rPynsdXVXB09fkhvq8nn/7KkX3xqnIoUVpfamUWFrxixHGbe0UCPXYaGCf2nRGsiNKbvmcQpTe122hBQY9E86Xlda7IhAdnJRwIoQkJEvIDghj67JaZYGDxevYiq+9aSbzlxmJEu5qkc0km13PIQ4x12qoALhotqM5q+sA5qc4Cw+DNbHe3UhsYlwuJdt44LuFMs8TmRWw5qvaoaDGoosMyV35FrwYcBLRFGpn+B8K4Xv74ivJy0ZZSY2G3K+lA6g6YOB4SxAAXBOJr5vs1Va/OS8DxuI5V4uaEQqkXZ2W1gE7yKESCTDnTCuM6OysPcuWmzBKZTql+8eP3+G+Q6W2Iga7pE5Btac4o7QbGMJ0qwlTYkpNQq+4CPTTIC67tctPGtrKyZa7HGWsSM1z3nu5WsBzVkjCIHlurXcikTgXV X-MS-TrafficTypeDiagnostic: VI1PR0801MB1998: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1998; 25:2/Pn5pJk0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report-Test: UriScan:(236129657087228)(227227094722967); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6041248)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0801MB1998; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0801MB1998; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0801MB1998; 4:7dPLs181uMBaJFPK5RkRERuk8PFxV0nsb4OWQ4fm?= =?us-ascii?Q?xVtuiUBT7rymLacmHBy+GkTJnpHBPW02kEEyJ5XcY/LE12QbrnOH9hkj0yJ+?= =?us-ascii?Q?OWus3EsWzdFkpVEHZLlSChoaOnC5r5DGYBAeamcNjYA4/ykRI5+rkP4079sE?= =?us-ascii?Q?IaloKe/PavTCFt90qzaJLB/2kPg9Ocgn8JtBQ6CszP9/wL6uVZuSH6mEuJQr?= =?us-ascii?Q?N8pS200q07/J50+2ZgfQjysXGs1yfM9mH0nJL0G1gZ/9JxkmNJ+cy8WASgfI?= =?us-ascii?Q?cmeoORVjAdjtOTSXyVn3TlpXNQs/nGr5bN7ki7+k/f9Bf1rvFBQxECw56Fsu?= =?us-ascii?Q?lJae0ZiP7BshM1XYZFeBcMeeXFr282iUIZxcBG0wqef4Kj3mnBfnNFs0Qc9d?= =?us-ascii?Q?b7x07F1dlREDjIn4ZGyvv212TLnqWjB7D4qA29eicvfjjACT5kM8CkTIgYN7?= =?us-ascii?Q?qhGy5uEH0AYv8eiFQmF5wHC48YI7SvWG6Q7e8GdvUsnF4De8rULQHYAEycFb?= =?us-ascii?Q?egpEG3JVdsQ0gX5Inp2wzloLknNqql01UfX9H4/2DJwadjMI+05u3TozEoYx?= =?us-ascii?Q?/zuU1xkik2c2ZGmMqLK6DAM60lePYDVPfHfYQtyapuGoXxew4FmJJKm8S3z7?= =?us-ascii?Q?R2hEcIUjoXDe31efthDkfGcdrqjhrhlMi0Xf3e8kiWTVaMT9c2UuGtzRsOQy?= =?us-ascii?Q?FlUqlhNojhdPvGpUOB+Pe8z/32lCzwnnAPofhg0yTj/37RIAVygEviPedY+g?= =?us-ascii?Q?WHfqWatIUmb85qa5rjkwLZfEpkS7ty8sl7ayrjxq4xFLJQfVTt2ary06PNJi?= =?us-ascii?Q?LppyopldR3oPqpFGHGF22lW2BJ5A8c0Un56NkaI9jmKXw5rSLbpljy4NkBAj?= =?us-ascii?Q?QhOeNsQdpCT/n3oazPYyzeqQS7w1sf63nNIGsAD6iXljG8rCV7IuuEdDhyv9?= =?us-ascii?Q?C1xjkC5OXJQK5hLAnBIkrCskkL/DJN1HvzSZsMegfTI1sWA8LOA1+4tF8X8U?= =?us-ascii?Q?rai6V7VB3RFmuxwRyxjdkd4zn+HwzXKQedxT+PplMlEM4X6GJdUZAoAhDUeA?= =?us-ascii?Q?q9nLt2kymD4XQOaEIMMPfrbI9DJr/nmFkET84VlzfgjidL12XscV4PoAooMn?= =?us-ascii?Q?58eweCswFKwKrWgQg0P4waPABnsFGEedxnh7PvuTNwuffbSlRUFT1TB2zlkC?= =?us-ascii?Q?v3Jf3nYoTidpE4b90kJoOUJIAFIvdSRMPBG5asFO9xRHzTQhoBGVsvST1Q?= =?us-ascii?Q?=3D=3D?= X-Forefront-PRVS: 0350D7A55D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39400400002)(39410400002)(39840400002)(39450400003)(189998001)(575784001)(86362001)(53416004)(2870700001)(478600001)(53936002)(6486002)(5660300001)(50226002)(50466002)(42186005)(36756003)(81166006)(25786009)(50986999)(6506006)(76176999)(3846002)(23676002)(66066001)(47776003)(305945005)(33646002)(2906002)(38730400002)(110136004)(2361001)(6116002)(107886003)(4326008)(7736002)(6512007)(2351001)(2950100002)(8676002)(6666003)(6916009); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0801MB1998; H:xantnef-ws.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0801MB1998; 23:emsGG2+qKeKY6l03oNpTi1Qs74eT4TP654f+ETx?= =?us-ascii?Q?qShYQz8kFEoYuOAg8hgfyx9scZFpcCzZ0lVeijMg2bDQjRhLxooch45FrTaM?= =?us-ascii?Q?1bjPYVQzncbZUyXognqnJ9M5vneNLiun0QKf4GJ8mgaet0dYpZCbY6gMcvzN?= =?us-ascii?Q?W+GX1kbx/041igykL+aHW/nGMDiraRqjssC+MF9XAPqminaQ/ikEpPtIohR/?= =?us-ascii?Q?cY0Vn5wtZdyYe9Qhdx26FJHQx5GgsqKHGVc5EBoFrw/N+jEsZVwNlgGt7JY9?= =?us-ascii?Q?N2HSvvYBvwZWgLd3jikhan7+4mnWolkZQqM3V/GE507+s6j+fl9H0D9CFKYW?= =?us-ascii?Q?agtwTq33CkdLhGPj6qtNyt2eEbbyFG8Dmn14LS7BF1G7zYqFntU1BZfMwG9I?= =?us-ascii?Q?eiO8dRtG14wGYNYYzOLsW2OvP4WgqsbjEuUtqcJJxbiOq6SEDEbkBbThosAa?= =?us-ascii?Q?8PCYPkD6/eqenWAL9x+Iqj8e3xH/fngO9lVcvkOi1Py3LXopzkutGS9S8oQ9?= =?us-ascii?Q?ppkYonU4cfb00czYgUKXMtGSI75AR7lyhUQjSNZ2i/JMhm/OQ9Lx7nAlBXYQ?= =?us-ascii?Q?hzuCDsxYy9btKaURqhyh/vjHC2O2Q5WdIt0hmWumRiJmUWZqS9KEvKWI+j79?= =?us-ascii?Q?7X2P8nDpCmu26qe7BrekcWz999LNS6cLtdxLsaK6mymO/YLWXqz+h1+Wn968?= =?us-ascii?Q?opxibqe+VK5xyxD/7THAEh9gVbakKv8k9r7RLARotFOHk3TOyUWR3Jo9VIJs?= =?us-ascii?Q?9sB8KuOU7mRPYYHCaWpJ99WQw2IChfiH4it/PNt19npyZBhwYbCodLkTBp+C?= =?us-ascii?Q?4Z0a3r8ETwmAxYj+acQWCzJ/w6vBmHJ5BImrPcEQEw1nMuboJXwYCv769LND?= =?us-ascii?Q?AA8NJVi1omP+pWNyoIHDQCyc5Mez3xjT8qmSwzeqTiHb9a5DRWaRm0hA3mdw?= =?us-ascii?Q?he8tvIht0Dr5qSZrJwQK4VfcETTzSZ90xWSkfY0//qCczKwIIuzzhAULnvbt?= =?us-ascii?Q?mEmOMJWBOpPn7AiIhqV2l2SycQ2ZuccPwr2AArfpdti+OeH/moTV19t2d4B4?= =?us-ascii?Q?ZB7SouUAEXAvpeKGpglGQvazEpfSMxvu5UB0mmB55YFXKVrouTQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0801MB1998; 6:nHRHOcZFmtvOqyj7qugpxqWSXNGaaSKIo3sZ/U3J?= =?us-ascii?Q?YDXjJEU6TYfdIxiVy+eVXN2xX5WFO6Ca1ehPzwqT4K9b43d6H0yJkiu9qyMw?= =?us-ascii?Q?SidGKoODEbTp1krE7h70nSLLXc23ASBcZNswgFVyGQAIlh0vmDvltvvgaIO4?= =?us-ascii?Q?R2Ms6U2ok5Mfm9KJ+5diiXCb58FO/bZ1DEAKE3eMbdQ4Qu/+gBcyFocOmgjX?= =?us-ascii?Q?zBS5jwXP1I6qTUjVCf6mi5zMXWZNtDqZWbdamPcRJrk7lHYKEFGykPUAZex0?= =?us-ascii?Q?drAxZ27RSqgOuTwu2Xm52p93R0wb8DKNEksOuxpFvmEpRKGH814X4hKUYPmr?= =?us-ascii?Q?znD42SpZvHsSQ9jdRUOO9xjKHD2TvTdLyQHoreVbiWsjWoYpfX8ubHQOdKgi?= =?us-ascii?Q?xc2k7uuuKXdJ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AXVtzqEqkVQ1L9gZBoBZBna4SVxqtoKXjPgOCxZYrH3RbdVOgaOrpnxt6GWqFk9RXFf7rRyAk/b/z5gb/OgCcVzoEc6ZWweDpDHzZWJ1blJdzD3AeUXfK269hSq9bLZ3rf41ZNQ= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1998; 20:RkT6g7p7uQyRwzrqd3lopvxO9wOoynDLemxElEfdZXlkHBMBllG7Id28raovCq2kP9okCJy+c3Nz5mKqtYaNfUj0NhG5qw+zYIAW2N8hBY2tVzgOhFsu7tbEXQQaozbtD0W18rF+3lu3Ao3ZuZk/yo5Let+pHSN0kHBBbb9n7qE= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2017 16:47:02.1021 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1998 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.5.110 Subject: [Qemu-devel] [PATCH v4 08/13] test-char: split char_file_test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, Anton Nefedov , den@virtuozzo.com, marcandre.lureau@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP makes it possible to test the existing chardev-file Signed-off-by: Anton Nefedov Reviewed-by: Marc-André Lureau --- tests/test-char.c | 125 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 78 insertions(+), 47 deletions(-) diff --git a/tests/test-char.c b/tests/test-char.c index 1f0de25..cc153ed 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -505,76 +505,104 @@ static void char_serial_test(void) } #endif -static void char_file_test(void) +#ifndef _WIN32 +static void char_file_fifo_test(void) { + Chardev *chr; + CharBackend be; char *tmp_path = g_dir_make_tmp("qemu-test-char.XXXXXX", NULL); + char *fifo = g_build_filename(tmp_path, "fifo", NULL); char *out = g_build_filename(tmp_path, "out", NULL); - char *contents = NULL; - ChardevFile file = { .out = out }; + ChardevFile file = { .in = fifo, + .has_in = true, + .out = out }; ChardevBackend backend = { .type = CHARDEV_BACKEND_KIND_FILE, .u.file.data = &file }; + FeHandler fe = { 0, }; + int fd, ret; + + if (mkfifo(fifo, 0600) < 0) { + abort(); + } + + fd = open(fifo, O_RDWR); + ret = write(fd, "fifo-in", 8); + g_assert_cmpint(ret, ==, 8); + + chr = qemu_chardev_new(NULL, TYPE_CHARDEV_FILE, &backend, + &error_abort); + + qemu_chr_fe_init(&be, chr, &error_abort); + qemu_chr_fe_set_handlers(&be, + fe_can_read, + fe_read, + fe_event, + NULL, + &fe, NULL, true); + + main_loop(); + + close(fd); + + g_assert_cmpint(fe.read_count, ==, 8); + g_assert_cmpstr(fe.read_buf, ==, "fifo-in"); + + qemu_chr_fe_deinit(&be, true); + + g_unlink(fifo); + g_free(fifo); + g_unlink(out); + g_free(out); + g_rmdir(tmp_path); + g_free(tmp_path); +} +#endif + +static void char_file_test_internal(Chardev *ext_chr, const char *filepath) +{ + char *tmp_path = g_dir_make_tmp("qemu-test-char.XXXXXX", NULL); + char *out; Chardev *chr; + char *contents = NULL; + ChardevFile file = {}; + ChardevBackend backend = { .type = CHARDEV_BACKEND_KIND_FILE, + .u.file.data = &file }; gsize length; int ret; - chr = qemu_chardev_new(NULL, TYPE_CHARDEV_FILE, &backend, - &error_abort); + if (ext_chr) { + chr = ext_chr; + out = g_strdup(filepath); + file.out = out; + } else { + out = g_build_filename(tmp_path, "out", NULL); + file.out = out; + chr = qemu_chardev_new(NULL, TYPE_CHARDEV_FILE, &backend, + &error_abort); + } ret = qemu_chr_write_all(chr, (uint8_t *)"hello!", 6); g_assert_cmpint(ret, ==, 6); - object_unref(OBJECT(chr)); ret = g_file_get_contents(out, &contents, &length, NULL); g_assert(ret == TRUE); g_assert_cmpint(length, ==, 6); g_assert(strncmp(contents, "hello!", 6) == 0); - g_free(contents); -#ifndef _WIN32 - { - CharBackend be; - FeHandler fe = { 0, }; - char *fifo = g_build_filename(tmp_path, "fifo", NULL); - int fd; - - if (mkfifo(fifo, 0600) < 0) { - abort(); - } - - fd = open(fifo, O_RDWR); - ret = write(fd, "fifo-in", 8); - g_assert_cmpint(ret, ==, 8); - - file.in = fifo; - file.has_in = true; - chr = qemu_chardev_new(NULL, TYPE_CHARDEV_FILE, &backend, - &error_abort); - - qemu_chr_fe_init(&be, chr, &error_abort); - qemu_chr_fe_set_handlers(&be, - fe_can_read, - fe_read, - fe_event, - NULL, - &fe, NULL, true); - - main_loop(); - - close(fd); - - g_assert_cmpint(fe.read_count, ==, 8); - g_assert_cmpstr(fe.read_buf, ==, "fifo-in"); - qemu_chr_fe_deinit(&be, true); - g_unlink(fifo); - g_free(fifo); + if (!ext_chr) { + object_unref(OBJECT(chr)); + g_unlink(out); } -#endif - - g_unlink(out); + g_free(contents); g_rmdir(tmp_path); g_free(tmp_path); g_free(out); } +static void char_file_test(void) +{ + char_file_test_internal(NULL, NULL); +} + static void char_null_test(void) { Error *err = NULL; @@ -652,6 +680,9 @@ int main(int argc, char **argv) g_test_add_func("/char/pipe", char_pipe_test); #endif g_test_add_func("/char/file", char_file_test); +#ifndef _WIN32 + g_test_add_func("/char/file-fifo", char_file_fifo_test); +#endif g_test_add_func("/char/socket", char_socket_test); g_test_add_func("/char/udp", char_udp_test); #ifdef HAVE_CHARDEV_SERIAL