From patchwork Thu Jul 6 12:08:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 9828113 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 4EC5D60361 for ; Thu, 6 Jul 2017 12:17:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F98F28573 for ; Thu, 6 Jul 2017 12:17:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32CB0285E1; Thu, 6 Jul 2017 12:17:42 +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 5535828573 for ; Thu, 6 Jul 2017 12:17:41 +0000 (UTC) Received: from localhost ([::1]:51183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dT5j2-0002mI-Hl for patchwork-qemu-devel@patchwork.kernel.org; Thu, 06 Jul 2017 08:17:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dT5bt-0005hv-A6 for qemu-devel@nongnu.org; Thu, 06 Jul 2017 08:10:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dT5bp-0004qn-9m for qemu-devel@nongnu.org; Thu, 06 Jul 2017 08:10:17 -0400 Received: from mail-db5eur01on0096.outbound.protection.outlook.com ([104.47.2.96]:45343 helo=EUR01-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 1dT5bo-0004qN-RJ for qemu-devel@nongnu.org; Thu, 06 Jul 2017 08:10:13 -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=Qn/nTmfmWF+SXIX/XzDuyzxrC+O4mjXuSXLIhKwDG7Q+RL9fHOBbZWmdfwrBD3sPKuR8px6aBtejAQUsALaxD2DNwgn4s+dSeyrAT54lQgdQhkEupa9mVi8aGu9shjUWQAHR01WpqloxWcmJDW/h/wG4wFROCCp5YliftTTXXuQ= 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 AM5PR0801MB1985.eurprd08.prod.outlook.com (2603:10a6:203:4b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1240.13; Thu, 6 Jul 2017 12:10:05 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Thu, 6 Jul 2017 15:08:54 +0300 Message-ID: <1499342940-56739-8-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499342940-56739-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1499342940-56739-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HK2PR02CA0118.apcprd02.prod.outlook.com (2a01:111:e400:79aa::44) To AM5PR0801MB1985.eurprd08.prod.outlook.com (2603:10a6:203:4b::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4728ed07-a55f-47b3-bf24-08d4c467f329 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:AM5PR0801MB1985; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1985; 3:I15f7JirVm1nk2Ai6eYu2m1+O0u7TWRjBQkNa2h/Mz3jcFH7W3npDnXvwm8vlnsc4wG8ghBBIEVuKFaOLOLYiv7LyhiATTfa65L/2r9+DKAvs4H8qGZF7M+Bhw2yT/vgwaoAGrew+tgXsRj5yvc79/HmGmZrgQ4O45g01nvgyJDPs8MWisiiL7qRDbNzimE+nYv9+wNhmeuB1973RC5VS58jwLhsQ/dFC8EORD2LSn1TZsMyJ5tlBg0LxceKqNrJWUdVyW9Q2vdlQFCigjAvDHVD+VItBWGl6vvD4wvtVDqqryFJRUlbEUsOCqHREPYyjrmcCcMa9rxi6wxDkNj86LHTKRWrwkWEYPWTavbTI9bGi3xYYObfGVGTsDUKt8L7HTo3qngvwLQGUbID5kRHBR2e+w8F25vgMNSGo0Nh1fjC6dBnF1kHiZ4DYlG/kUUvy9RwDJxU/TbX+XalRdCaZVGtUoSjGFmHRXf4PfjTFILQGM/K6t+I/7S+X4bJYRsvg2ZNydx6K3rHgxQpD0hBcMU2hFbfC62lNSMv/6s4F/Y9os+7StOuWIKKLZsScx9EWl94AtHqGzlwRNsqW6WreYikXap7+/ZOKGKJL40yXfan0szITAr93Lwiumpbhu0FXzqSoiIHSpTFn799ecR+N/W5hkeyq4tmRGzM7yJgxFdTFK+3IMPSsfstk307TITK9AaBjzvJVGzEwLthqvDznTMGAdtqPljl4uAoFkTyZUzQD6C+UKADHmulOk8bpZ0Y X-MS-TrafficTypeDiagnostic: AM5PR0801MB1985: X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1985; 25:sSqLmCNSMIlsGjMek68ZqYeEf8MbRrF21JsC1ZFWoPAcU3KMiK8q49Zqz/kTu3h5GXc1pH+4wYs7h8onO0dPj7ZmbnF2qu84dzaOMVXre3CdvAthsbcngZYaT44G07Oj8p3xJ/DLMz00at4cQvETdb0nvNMrMSVdySWOttvZ1qTfWFvIJUXWyrPwdCYWE4P74GcN8Les254lsFM8gtZtTUfcAihxQL0ETSLbLk59PsJpCJVOn8NYKPt/Pwv0OOX6GSVgKCNcjXC8qNurONvat29KnVSUMsXc1AH0eJ2P3EmyJ9W6IeGVkKkvwVe8qb4+2/H8X9t7C8n24PD7uSeXjY33nZgfvhar9N1L+mk2gRzkB+ZdTcdVT1kd4zxbp9uIPJvX4fV7hZNJxrcJv6UYSFJeWq0a8tR20X6u6cun5gs23iosHhOMH34EGcgYkpV4hvNQ4VrRDLFtzvngDatIucDk3yfR619fGvnX9FmQDYeVCm+XMdW16GebMCV188ALwfnm9177iXU/3uXHL5o5/KCqyzYHEs4KWHvto8SlECnQehjWdHlddab8T+Qex1Pq+5oeWMs1f/zfguhWPGaveov5//lcO1iE9jomTdzwmE5CDuu0NEjr0RWn/sS4tnlAEQpV2aRx3JPD85QqGdQnkUjz36gJFGmE0DvSKsbTJEdkSqPWbmHIG3GbKk1kbM4kDNZphrKeU1aVw5UMzyRKfWg8tiFWUv4KQcBBwSXkzq0zNlU0wehWKFVXvE8f/GufcgJSSgp4KIKdfKgCrh82t1r2O1o06uoRNDNbiOmhNG2zXTxE5gwRVrm+4LRwuB4BLSo8BSs+6bQcmajNcokDkGX3Dg+YNHH/rZjf0c6AOt+HjaS4YpI0Y0+wUi/a1xObPZN+BwugollzQn+3KtKXZYC0SQ9m5cfwFup2QSEfWq0= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1985; 31:m33Ton6RNh8YhkfbgEZBavO9+LJg2kFYXARCB8HhLoi2R8f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P9O4mvm0Ps/y+Snr6tPwsvyWbihNGdqHLXM= 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)(2017060910047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM5PR0801MB1985; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5PR0801MB1985; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1985; 4:tObMd2lDLi1kv7liNl46k9Nnw7gGckzdi0MFgBzb?= =?us-ascii?Q?c++BYTe9fHeh7w1gFn1MGYZmatPv52cbhTWIkBlPV1gxATnuNWcLeiH12D+x?= =?us-ascii?Q?fZuXLgGmCkDHvpt3WHPdWlf+3+XkxUpcmtGfBlwaX/XJgOF4bSvdQq+vCujf?= =?us-ascii?Q?m1dKVsqjx0MFvJBndIb/2YLbtYp3b4csGkPGlEUBmU37eCFKd8XabG4gqi0J?= =?us-ascii?Q?Usy45ERHvZZICA+pwpfXcVUCDB23eSUVdtRU44UXfLxKg8JPPPkAJA2lmwxY?= =?us-ascii?Q?fo2RlWrXy0R7Tmkmgt5A14VxVWpbGoHj4iQi9MXhd7wBFp8jRM0d/x2hYSKI?= =?us-ascii?Q?u30Xga1P0eP7FB/AJrmNrNy2cKtppLwdXsPvZLEZDYp4at9eNUBymgO2eDM5?= =?us-ascii?Q?y3mu2Hwhxu/oTOiyVESSBR+y5W5ZrMTosQhrLmWp7A60EdUVA4KENux7Eqy1?= =?us-ascii?Q?TY4agna0/9HbNFK8CAS9j2aCUvmxKLAOsvssgSGC6fCWtEPrvdikczRTKUeR?= =?us-ascii?Q?jK0iU8TxgvLwmVAUroEEJbXEvMHRn++bT/gMUVxEIR4SdGKjxfSkjmgjbNhN?= =?us-ascii?Q?SCYfU1ep4paKpXZ3S3drlPr0W0SEhudRlAJRrN2vj6W3Z/PZMsVdGYNzUFw2?= =?us-ascii?Q?a5YZMKuzwIwyvC47tJT/3gvY+Vp3ea+vstmzqW7lmDielizcnF0Kks1DCQQJ?= =?us-ascii?Q?cYEWdSALo4i8UP5TsMryquZDA6Jw8DSVwJ05RFM85SUWNhyVQGtHgJKTSwue?= =?us-ascii?Q?d0wFaZ0iCuM/fhuuvQpja/Z94BWyr8MoR2Cm3PGucsJFmGosoPSO1Z+Q5hWY?= =?us-ascii?Q?bqjmsViiuVMSQbdjfc9LxludVjI6PAaYFGVLZDFBYfdpTDDbautrvizjv65G?= =?us-ascii?Q?QakyvNAP1jyau0Q6De6/4nIpJHB1y2WfBLChbabaj1wIZLAbHHo0yRPx/8d3?= =?us-ascii?Q?NPSaUiuGITBmUrGGUHSTl4UKIEZq89zcIPMQnQFYcxVTg1ernACMIqpCep5V?= =?us-ascii?Q?IDVSYNAA1JpXfyIl8M16hsrkMR3irDouFLV8izc2SzxQvfa70K+MKxQnAcl0?= =?us-ascii?Q?AA1dPp/f/gMAU91GVvDA9W2H5GJvUkWwkmZk1Ex3HQVTHbcqvJ8Tiw5auVeH?= =?us-ascii?Q?2ak+9gxwDS12xTYkjB3nGqDyMANX3FXEbEZTV/J/zoSMDzLgz8P7WgyeZOKd?= =?us-ascii?Q?BP7vgawfFe8BMU+ZN8XlpoEy0cN+G0NdQmaVH35V9umYjCEGkS3/vDwdLg?= =?us-ascii?Q?=3D=3D?= X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39450400003)(39400400002)(39840400002)(39410400002)(2870700001)(81166006)(8676002)(36756003)(2351001)(23676002)(50226002)(25786009)(86362001)(50466002)(305945005)(478600001)(5660300001)(189998001)(6116002)(3846002)(7736002)(4326008)(107886003)(38730400002)(66066001)(110136004)(47776003)(2950100002)(53936002)(6666003)(76176999)(6506006)(6512007)(2361001)(6916009)(33646002)(50986999)(42186005)(6486002)(2906002)(53416004); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR0801MB1985; H:xantnef-ws.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1985; 23:y4Kvl03D12C9tBOVDeHIogFGsN4vVm0HZuMGsi1?= =?us-ascii?Q?Cu8qQsvWhojSCYyQAhtgqJbBwbYQVJvvIrkDa4THe7cHCkfaQ/E83shZTvgl?= =?us-ascii?Q?VZwvBOaxqTMNOpBtrKBgf2Rr//1/vZ+C2xWsHGTniapw49t/VHsE4IJsKzAV?= =?us-ascii?Q?KBM1WIEUHqbEqlwHdU5vMwSfu8/L1lBPpubqLZDd5X9mZgE2BLRw6+HPN49Q?= =?us-ascii?Q?N3VNOd1Bc5RWgExmjHgVuMr/VCYKCLIlqzNAUFIjp50IhtusMNvlvQpkLZsU?= =?us-ascii?Q?O7zc3ZsvFSDqU8V1ovMRL6XGOzIGt0MZ8fR3Oa9Vr+lSw/YHPNGfG9ij0Okd?= =?us-ascii?Q?zgBLMbS4UTL5DSXsyvOXlOPIAQcnEvWiL3gXRtMDrK6Y9/K5mzgVVhOGVr+A?= =?us-ascii?Q?dGZm2//aidf4QH4hsdfeN2nqpgo7iIWYg5PpWJWQ2Z7drMg4SfaKfjic1iwE?= =?us-ascii?Q?y0DtHilXtib8NVcfedAa7HL0QbrREMxAdoFTg8tczSllbfvF7eRt3nwIG/JN?= =?us-ascii?Q?fzrWjvxhOU5jIi+DuEgPynQcy0tkrTG8umeey67vSic2nnTsUpwLDiQWZZHr?= =?us-ascii?Q?3aN9Gnrd+Ic49AlkrMfF0CzTp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mlsNZf9uaBCnbLFfSOeWuDtC9cVRYHXUVO6qz8bMXkzclh96MdbYyC6QWFkOb2O5IwOQOm6oX/gBZXB6N8mkwvkv045PqRxmeTBGkmvAiiFFUX5GVDGvzemkwXx4AM/iFxbLqWPDsXVFWS+wYunR6tFuNe7fJ+W/jKKP1QbhcZSVvWr4OERGi6lrdbXQMwnZ7YDo+heWf1KJCRMIwgA/66js= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1985; 20:9XW62ZASD7Rl7Pqzw7TYg9eD0JzZ20w040aYPn9/uR57QAwqZjVMt1Tz+F1PeiV9kyJKTx+tDTClcmbHaPaHYWTiFGfDOiUq42JKevsez9LKpDW7IAhAnBYyTTHupP1pQpODMiW/AxEZrgiMYEjx+G8xAhym8Y5kcdRCEqIziPA= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2017 12:10:05.7607 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1985 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.2.96 Subject: [Qemu-devel] [PATCH v6 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