From patchwork Wed Jul 5 14:01:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 9826599 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 94B6460317 for ; Wed, 5 Jul 2017 14:14:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B79628504 for ; Wed, 5 Jul 2017 14:14:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FA0028538; Wed, 5 Jul 2017 14:14:28 +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 0E13528504 for ; Wed, 5 Jul 2017 14:14:27 +0000 (UTC) Received: from localhost ([::1]:46438 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSl4U-0006Bk-AU for patchwork-qemu-devel@patchwork.kernel.org; Wed, 05 Jul 2017 10:14:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSkt0-0004l5-GK for qemu-devel@nongnu.org; Wed, 05 Jul 2017 10:02:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSksx-0007mV-9Z for qemu-devel@nongnu.org; Wed, 05 Jul 2017 10:02:34 -0400 Received: from mail-eopbgr40118.outbound.protection.outlook.com ([40.107.4.118]:22336 helo=EUR03-DB5-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 1dSksx-0007l7-0E for qemu-devel@nongnu.org; Wed, 05 Jul 2017 10:02:31 -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=G0umJqoE/d+IElFVGO3RpNwZ31X5WanRqmvCPSi8eWs=; b=L7v7+SjlNceSZWcwcVC4T1TqtW9iXwIvS3bCKlcS/kPVs+XcP/mvBQUaxLCQRmWItmnJ6BkbSbDC2OjySrUNeon0M9BSQao8yppGcllJEWNJ+/hqr2NFFappATlJyhLRsKtfBPyQqjNmIqEI4ZfBNJk79S3BKLygcQ+UoM5I6R4= 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 HE1PR0801MB1996.eurprd08.prod.outlook.com (2603:10a6:3:50::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1220.11; Wed, 5 Jul 2017 14:02:28 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 17:01:58 +0300 Message-ID: <1499263324-15184-8-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499263324-15184-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1499263324-15184-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: DB6PR02CA0007.eurprd02.prod.outlook.com (2603:10a6:6:15::20) To HE1PR0801MB1996.eurprd08.prod.outlook.com (2603:10a6:3:50::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: be8ea26b-692b-4ae4-be23-08d4c3ae7991 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:HE1PR0801MB1996; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1996; 3:LBWErQ2sc+fW113pjAA5FAIwCyvPpMlFpl0C9QdF7mnhu4NpYXNJIh6uBNVxoyyuN34U+AUQJY4j5iNexOEysvQNh1eKp6A1gNv2tPwQkL3ARw31hMoP4LVsaPA7mbmSX4Cxbq9NI4XZCYgk/LFO4VMiOSOi39IDCi86DcUV1snz1axZF+++FMZTb7mjTWItK4PO/VAPALRqF+SJngOLHhcxkX5ApXHGzdQ0Q5oe/Goeips72fQdRno+bmAVGGJMVYeYjpX47T561dMPZNA8jGJNZjDYYWz4Q+URnbYunyOJNQgcYJlEXIs5lnpy7zLkpeNCTN5N8cKqHimXPqo6ePznT5bVIfvzE0hg67f+UMH5bnJrYvuQ7kexMKM3xtqEGzLJVNL1Ag7hmdLjJYUzvzs7vGkm5PehBA+f+C/GPbXd01w4p+P0SdDNGJqjhF+MRBnlEJLOMpqymX7+vFodaySBDVtCokt92VNw6fPOmNWhCHKib3USqSFznFA2oi7mZti6ix55LHDUtqcfNhQf9FUd7HFNDEd/LzqN18QrNfpCRee568jsij3oZ9lBi+mnXl3jMOF3KUjkApO6BIUkCiJyd2ZEQ8B75aTZxoiRHBgWYW6E8Nxi4Lf4uZ4MAXfxy1A04fSiiCrsxluQrvM33h3ImUDrofroDMYE7P08AiSFHaV7uL/09qyJ4lkisPj5ZQZ3BgD5W1UGuwt9zpiodV/v5W9RMCm2JhEh40IbJO+k7jqz0+9qGEmWTFsJQFKl X-MS-TrafficTypeDiagnostic: HE1PR0801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9xlij67nMYbuWQhCn7LQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6041248)(20161123560025)(20161123558100)(20161123562025)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0801MB1996; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0801MB1996; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0801MB1996; 4:GvYas84Jm0Si2fIIjScDCqV8j/EuaaWPYcl9dJRt?= =?us-ascii?Q?rWH0R6/3MMoTCjuQcMRMBkgPBs0iqMHCNzTOucV9KgryFs6YRrta7um8F84V?= =?us-ascii?Q?jwvZAw2L5DGCcXNTASkWQXTbNATUJZ/jOU93Gk6G0JAdR9eNlGMfMV/76Ybr?= =?us-ascii?Q?vHb7mC3K6S1vGft9z7o1uqmij1DrDBhaGXRT0PVuYkZGxHDL7RTzB2g2N9d8?= =?us-ascii?Q?cnAotmIqDiGbDPYGv4zZ58fgIFt8okvXIV/i9KLUGKSGJKYtWvoxgOF2J2n8?= =?us-ascii?Q?GesloMOWgPgcvhnLRhiG/qx01fgPspIYPhYauw2iegRXBUqzK8AqgFH08y5i?= =?us-ascii?Q?H+dpUniZg4tN6XYHH6HQFuCWhrz0uYZrMyBZ4F+KeCO5WPB4tJmMYiH6KT/2?= =?us-ascii?Q?WgFRYEjtmT87wJmgP7ZvWLtjkXNtSLJ/uJSjOmPlPeJn+GhMoD3/ijZLcPse?= =?us-ascii?Q?IuzaQ8/OLXkEEJJA0BurfwIKdvSZPur+yH3LATFzKyYfB4cAuiko1JMvHwVc?= =?us-ascii?Q?ID8/9irC9QH2eQMVzZokzQz54/z6UMyVT1N6Z3l5pS7WtR180uqf0BmTZ3QU?= =?us-ascii?Q?Yo4Mb0MKofPQQYpmfo9o+sP63lrI8ceSMNJ6qiNDdsZJPSaathnNJRmL/zam?= =?us-ascii?Q?Mmm1My1IsyfvSVYX/RsKNlpsTp8+nOIwXEBWrzUxgvJK0GfSn6fYOha7Xbff?= =?us-ascii?Q?E01yqGPvZc0Mrg3moVSDKBPzYuDvpHAA4gUgU/4e04XTMb0v0LQuUEdqdBWR?= =?us-ascii?Q?tim2Y2iDzwV7gzEnzGzFIFnKvI0knfQfoDEGgX6/HRhfkE7gl8UNIoK+yUTd?= =?us-ascii?Q?ZpTEyUDkisFLgMirZLnH1x2yqCv84mf/wt93aT5TxpwE9gY5cP+wAMqxaC5u?= =?us-ascii?Q?csMNBTbu/a9KyEjzBCqqPIYvHpsm/w1m2sjMBxvKWhUsZmnmyZJ6M8eExBJ1?= =?us-ascii?Q?R9M744DdPTYilo/UJG9bVXUpStUh/iinhkzV+uPzJz3Cv/jfNJbFrISBSRjU?= =?us-ascii?Q?DWtx5BpsEnkuRdkCACTe9GTJwgaV5Dv8dLA5KboMBgD8WQ3JI9cXWAmzYwgF?= =?us-ascii?Q?0/jxTTUp13peLBuDWtAfk24/cL1Ppxtr/l+dG+1yM3/dIW6qd+GFZSUWyH73?= =?us-ascii?Q?E2ik7I2EsZAhSr+p7wZu9N56cBgXAPsQDga33vdYwezRIK3cDme/3XU0d4Fb?= =?us-ascii?Q?A7d9wZVFc0anY4A=3D?= X-Forefront-PRVS: 0359162B6D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39450400003)(39840400002)(39400400002)(39410400002)(6116002)(3846002)(8676002)(2950100002)(2361001)(6666003)(33646002)(2351001)(53936002)(86362001)(2906002)(38730400002)(107886003)(110136004)(50226002)(42186005)(6512007)(81166006)(4326008)(25786009)(50986999)(478600001)(189998001)(2870700001)(76176999)(5660300001)(6506006)(6486002)(66066001)(50466002)(36756003)(23676002)(7736002)(6916009)(47776003)(305945005)(53416004); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0801MB1996; H:xantnef-ws.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0801MB1996; 23:oCsyI5+K0bY1Y+DZmPGOIKz6GCcUXxVtxUO9LIs?= =?us-ascii?Q?abgX7v16//YZUtyPMjN5FBxPnZpjfpUx9a5sR4kjRCjY65D9P7VQwdJKajmC?= =?us-ascii?Q?g0sCjJsC6Kjq5360sR2OFMOga2lSvvI+p9YPqfOgprtYYdsZDNx4CyE4A6L/?= =?us-ascii?Q?nLybIJCAuUNwJxFW32h8HBMlVZ+bxmXrtLqUUtetVbv/lwTa4MhyaTPbl+w4?= =?us-ascii?Q?VhnP3/cBLz1rWSaKJdxvx82/CihV2kYmXfUnC3YWkjOu+p86TEJnqphR9Z8g?= =?us-ascii?Q?X0FXEXuRBeQ/bkv7+EBEJq3Bh1vGo38Et4/0ZQEvNkznUgenYd3Dj0/YmN0G?= =?us-ascii?Q?xMtV4YDjBffFjppW6phRcV3F7hreNtF2Q/bsHzh54Riq5yun1/BI4C6w9+T6?= =?us-ascii?Q?RwzXdvvZeLr6r5rUrpAJs8PQ16PJtpujO+yRauGlCuIwPsAGkUTIIqJ6foX4?= =?us-ascii?Q?+d5P89NEbeejn8UqI6iPHX2uQdeBu5n5c28dG6XHLm3uwHpBpxvdTspJccDt?= =?us-ascii?Q?gP5Bq6nPdkLdN+oJS3OrRLd+A+VU8lojFzeK/QgGr5+PHdrBevbVGw/u5pgL?= =?us-ascii?Q?BBrrhqc2tORPjkJ0pO4smvQWqTUv2vJ7CngWoo4ZYurtl4e0fC10H3Kkzx/A?= =?us-ascii?Q?oHWC1z5wcGGSPjTZuTynPTp1V0qYMqL9Y+PuGnuN23OHhVUd6Ficp2PXk+9z?= =?us-ascii?Q?u2rmnYRMgsDl1BeAjUqYNqpSCcEyepN/lb1SG1nGq2F6TnsGtaT3pBFYxc0u?= =?us-ascii?Q?eixz6gncyxewD4ve7EjCX0grTo9I9SiYzjorQ1cDwx0O2V52PVcsKTBTXTAS?= =?us-ascii?Q?feI2CyJ0tHHScOntcF9hvSFU9CAWHo7dpUkm27mIJUzin3Do7+aRuUowWm1z?= =?us-ascii?Q?SAJ3bBIOvhY6BHtvPW5WxHN04njWOjvfNapdwT04AvJgO3fMhKEMa0JLint1?= =?us-ascii?Q?OBcpLvBTLb7Dj7hfKP3AvTdCsCVNL8G60kUf0oKSOTWDVKpGIsPko1kRWzHP?= =?us-ascii?Q?34RYRZ6APCFaigaP7m01ImbfWrjpSwmi0x8K5ApOGBPHcGsHVZkOCxVs6JT6?= =?us-ascii?Q?HuOavxSvyE84xdHRzkeIDZ7JB0Xdh?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0801MB1996; 6:QAbxL+9B6dknpuflOkgHmoDx6wE6WQ1xEVFT4+zs?= =?us-ascii?Q?zwHq8+dvtBeJBFVU9NWeDyNS/M/vHkJ6tPQrHcpUvHBP9uNEsKTj//YaE2c6?= =?us-ascii?Q?3WFLF9YgHQ8Z9mPpdD11wUo83/RJ+NlBLTrUZGFdXCUzWWiHeKdN+sIx1jKO?= =?us-ascii?Q?sVHXhlAERZKzCnVwLvVUpvL7bvQANsMR41nRaWZmkR4TdYeUXCP3PipVhCQI?= =?us-ascii?Q?LUfzSuawvqzDiUofgKBYIiUXLXTy0UxKIl74+SufsBlszkMLSQ4wBcs8neYW?= =?us-ascii?Q?oPpAoC5RoF5as5Ocx0hfgCqAhArmnldS7uNYSuFzUPdcMqAexOjXscHru02G?= =?us-ascii?Q?iEMTX428TaAnUtzOC8QXV81yXUOVM2u4SrUJTpat3WequBYTn5SOkzdRnP5O?= =?us-ascii?Q?KeKnxkIehHirqlAvN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lwV9Lh1C6N/A2b6npNEUOTd/HP0iK2B0TD5tpFYcu6J8FZukM3oktsWIeTyEPnLrDcHsRTvNlM5qUFqY5O7LNXBVygjU2RzwWYBOyV8yThIRHgyVdJIksoUYw= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1996; 20:fbEfanb9ZbPlE3CdDv3CA3ZXUmXgoKgdW2MDoATS9yVc+/rjPufebQUrKX7i6E5oaFrIn2ecX5xp45CF0FXhoh98jyHUo5X9Roj8ZMa/o+7qOfslEcBlVq/NvjMCL7eyJL2hT2tCt6TbkzTeMmieWqm75rguvZ195OpclxNMbyM= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2017 14:02:28.5215 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1996 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.4.118 Subject: [Qemu-devel] [PATCH v5 07/13] test-char: split char_udp_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: Anton Nefedov , den@virtuozzo.com, amit@kernel.org, mst@redhat.com, marcandre.lureau@redhat.com, pbonzini@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-udp Signed-off-by: Anton Nefedov Reviewed-by: Marc-André Lureau --- tests/test-char.c | 56 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/tests/test-char.c b/tests/test-char.c index 6add1aa..1265224 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -411,16 +411,11 @@ static void char_pipe_test(void) } #endif -static void char_udp_test(void) +static int make_udp_socket(int *port) { - struct sockaddr_in addr = { 0, }, other; - SocketIdleData d = { 0, }; - Chardev *chr; - CharBackend be; + struct sockaddr_in addr = { 0, }; socklen_t alen = sizeof(addr); int ret, sock = qemu_socket(PF_INET, SOCK_DGRAM, 0); - char buf[10]; - char *tmp; g_assert_cmpint(sock, >, 0); addr.sin_family = AF_INET ; @@ -431,19 +426,41 @@ static void char_udp_test(void) ret = getsockname(sock, (struct sockaddr *)&addr, &alen); g_assert_cmpint(ret, ==, 0); - tmp = g_strdup_printf("udp:127.0.0.1:%d", - ntohs(addr.sin_port)); - chr = qemu_chr_new("client", tmp); - g_assert_nonnull(chr); + *port = ntohs(addr.sin_port); + return sock; +} + +static void char_udp_test_internal(Chardev *reuse_chr, int sock) +{ + struct sockaddr_in other; + SocketIdleData d = { 0, }; + Chardev *chr; + CharBackend *be; + socklen_t alen = sizeof(other); + int ret; + char buf[10]; + char *tmp = NULL; + + if (reuse_chr) { + chr = reuse_chr; + be = chr->be; + } else { + int port; + sock = make_udp_socket(&port); + tmp = g_strdup_printf("udp:127.0.0.1:%d", port); + chr = qemu_chr_new("client", tmp); + g_assert_nonnull(chr); + + be = g_alloca(sizeof(CharBackend)); + qemu_chr_fe_init(be, chr, &error_abort); + } d.chr = chr; - qemu_chr_fe_init(&be, chr, &error_abort); - qemu_chr_fe_set_handlers(&be, socket_can_read_hello, socket_read_hello, + qemu_chr_fe_set_handlers(be, socket_can_read_hello, socket_read_hello, NULL, NULL, &d, NULL, true); ret = qemu_chr_write_all(chr, (uint8_t *)"hello", 5); g_assert_cmpint(ret, ==, 5); - alen = sizeof(addr); ret = recvfrom(sock, buf, sizeof(buf), 0, (struct sockaddr *)&other, &alen); g_assert_cmpint(ret, ==, 5); @@ -452,9 +469,16 @@ static void char_udp_test(void) main_loop(); - close(sock); + if (!reuse_chr) { + close(sock); + qemu_chr_fe_deinit(be, true); + } g_free(tmp); - qemu_chr_fe_deinit(&be, true); +} + +static void char_udp_test(void) +{ + char_udp_test_internal(NULL, 0); } #ifdef HAVE_CHARDEV_SERIAL