From nobody Thu Nov 6 12:14:37 2025 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1540946118968427.687070131509; Tue, 30 Oct 2018 17:35:18 -0700 (PDT) Received: from localhost ([::1]:56248 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHeTa-0005VA-Mg for importer@patchew.org; Tue, 30 Oct 2018 20:35:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHeQJ-00027i-Ly for qemu-devel@nongnu.org; Tue, 30 Oct 2018 20:31:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHeQG-0003mU-2y for qemu-devel@nongnu.org; Tue, 30 Oct 2018 20:31:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49938) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHeQ8-0003PR-50; Tue, 30 Oct 2018 20:31:41 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2DDD5308421B; Wed, 31 Oct 2018 00:31:30 +0000 (UTC) Received: from localhost (ovpn-116-56.gru2.redhat.com [10.97.116.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id A164A601A8; Wed, 31 Oct 2018 00:31:29 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Tue, 30 Oct 2018 21:31:07 -0300 Message-Id: <20181031003120.26771-3-ehabkost@redhat.com> In-Reply-To: <20181031003120.26771-1-ehabkost@redhat.com> References: <20181031003120.26771-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 31 Oct 2018 00:31:30 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 02/15] iotests: Make nbd-fault-injector flush 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: Kevin Wolf , Fam Zheng , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , Cleber Rosa , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz When closing a connection, make the nbd-fault-injector flush the socket. Without this, the output is a bit unreliable with Python 3. Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Reviewed-by: Eric Blake Message-Id: <20181022135307.14398-2-mreitz@redhat.com> Signed-off-by: Eduardo Habkost --- tests/qemu-iotests/083.out | 9 +++++++++ tests/qemu-iotests/nbd-fault-injector.py | 1 + 2 files changed, 10 insertions(+) diff --git a/tests/qemu-iotests/083.out b/tests/qemu-iotests/083.out index be6079d27e..f9af8bb691 100644 --- a/tests/qemu-iotests/083.out +++ b/tests/qemu-iotests/083.out @@ -41,6 +41,7 @@ can't open device nbd+tcp://127.0.0.1:PORT/foo =20 =3D=3D=3D Check disconnect after neg2 =3D=3D=3D =20 +Unable to read from socket: Connection reset by peer Connection closed read failed: Input/output error =20 @@ -54,6 +55,7 @@ can't open device nbd+tcp://127.0.0.1:PORT/foo =20 =3D=3D=3D Check disconnect before request =3D=3D=3D =20 +Unable to read from socket: Connection reset by peer Connection closed read failed: Input/output error =20 @@ -116,6 +118,7 @@ can't open device nbd+tcp://127.0.0.1:PORT/ =20 =3D=3D=3D Check disconnect after neg-classic =3D=3D=3D =20 +Unable to read from socket: Connection reset by peer Connection closed read failed: Input/output error =20 @@ -161,6 +164,8 @@ can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd= .sock =20 =3D=3D=3D Check disconnect after neg2 =3D=3D=3D =20 +Unable to read from socket: Connection reset by peer +Connection closed read failed: Input/output error =20 =3D=3D=3D Check disconnect 8 neg2 =3D=3D=3D @@ -173,6 +178,8 @@ can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd= .sock =20 =3D=3D=3D Check disconnect before request =3D=3D=3D =20 +Unable to read from socket: Connection reset by peer +Connection closed read failed: Input/output error =20 =3D=3D=3D Check disconnect after request =3D=3D=3D @@ -234,6 +241,8 @@ can't open device nbd+unix:///?socket=3DTEST_DIR/nbd.so= ck =20 =3D=3D=3D Check disconnect after neg-classic =3D=3D=3D =20 +Unable to read from socket: Connection reset by peer +Connection closed read failed: Input/output error =20 *** done diff --git a/tests/qemu-iotests/nbd-fault-injector.py b/tests/qemu-iotests/= nbd-fault-injector.py index f9193c0fae..439a090eb6 100755 --- a/tests/qemu-iotests/nbd-fault-injector.py +++ b/tests/qemu-iotests/nbd-fault-injector.py @@ -112,6 +112,7 @@ class FaultInjectionSocket(object): if rule.match(event, io): if rule.when =3D=3D 0 or bufsize is None: print('Closing connection on rule match %s' % rule.nam= e) + self.sock.flush() sys.exit(0) if rule.when !=3D -1: return rule.when --=20 2.18.0.rc1.1.g3f1ff2140