From nobody Sun Oct 5 21:12:42 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) 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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 15481111065632.600120335700126; Mon, 21 Jan 2019 14:51:46 -0800 (PST) Received: from localhost ([127.0.0.1]:35401 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gliPx-0002fj-DL for importer@patchew.org; Mon, 21 Jan 2019 17:51:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gliNl-0001BO-ET for qemu-devel@nongnu.org; Mon, 21 Jan 2019 17:49:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gliNj-00051n-Ai for qemu-devel@nongnu.org; Mon, 21 Jan 2019 17:49:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37704) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gliNb-0004u1-Ai; Mon, 21 Jan 2019 17:49:19 -0500 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 DE4B987638; Mon, 21 Jan 2019 22:49:12 +0000 (UTC) Received: from blue.redhat.com (ovpn-117-44.phx2.redhat.com [10.3.117.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1EEB76013B; Mon, 21 Jan 2019 22:49:10 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Mon, 21 Jan 2019 16:48:47 -0600 Message-Id: <20190121224907.26634-2-eblake@redhat.com> In-Reply-To: <20190121224907.26634-1-eblake@redhat.com> References: <20190121224907.26634-1-eblake@redhat.com> MIME-Version: 1.0 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.26]); Mon, 21 Jan 2019 22:49:12 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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 01/21] iotests: Make 233 output more reliable 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 , "open list:Block layer core" , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We have a race between the nbd server and the client both trying to report errors at once which can make the test sometimes fail if the output lines swap order under load. Break the race by collecting server messages into a file and then replaying that at the end of the test. We may yet want to fix the server to not output ANYTHING for a client action except when -v was used (to avoid malicious clients from being able to DoS a server by filling up its logs), but that is saved for a future patch. Signed-off-by: Eric Blake CC: Daniel P. Berrang=C3=A9 Message-Id: <20190117193658.16413-2-eblake@redhat.com> Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/qemu-iotests/233 | 11 ++++++++--- tests/qemu-iotests/233.out | 4 +++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/233 b/tests/qemu-iotests/233 index 1814efe3333..ab15c777370 100755 --- a/tests/qemu-iotests/233 +++ b/tests/qemu-iotests/233 @@ -2,7 +2,7 @@ # # Test NBD TLS certificate / authorization integration # -# Copyright (C) 2018 Red Hat, Inc. +# Copyright (C) 2018-2019 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -30,6 +30,7 @@ _cleanup() { nbd_server_stop _cleanup_test_img + rm -f "$TEST_DIR/server.log" tls_x509_cleanup } trap "_cleanup; exit \$status" 0 1 2 3 15 @@ -66,7 +67,7 @@ $QEMU_IO -c 'w -P 0x11 1m 1m' "$TEST_IMG" | _filter_qemu_= io echo echo "=3D=3D check TLS client to plain server fails =3D=3D" -nbd_server_start_tcp_socket -f $IMGFMT "$TEST_IMG" +nbd_server_start_tcp_socket -f $IMGFMT "$TEST_IMG" 2> "$TEST_DIR/server.lo= g" $QEMU_IMG info --image-opts \ --object tls-creds-x509,dir=3D${tls_dir}/client1,endpoint=3Dclient,id= =3Dtls0 \ @@ -81,7 +82,7 @@ echo "=3D=3D check plain client to TLS server fails =3D= =3D" nbd_server_start_tcp_socket \ --object tls-creds-x509,dir=3D${tls_dir}/server1,endpoint=3Dserver,id= =3Dtls0,verify-peer=3Dyes \ --tls-creds tls0 \ - -f $IMGFMT "$TEST_IMG" + -f $IMGFMT "$TEST_IMG" 2>> "$TEST_DIR/server.log" $QEMU_IMG info nbd://localhost:$nbd_tcp_port 2>&1 | sed "s/$nbd_tcp_port/P= ORT/g" @@ -109,6 +110,10 @@ $QEMU_IO -c 'r -P 0x11 1m 1m' -c 'w -P 0x22 1m 1m' --i= mage-opts \ $QEMU_IO -f $IMGFMT -r -U -c 'r -P 0x22 1m 1m' "$TEST_IMG" | _filter_qemu_= io +echo +echo "=3D=3D final server log =3D=3D" +cat "$TEST_DIR/server.log" + # success, all done echo "*** done" rm -f $seq.full diff --git a/tests/qemu-iotests/233.out b/tests/qemu-iotests/233.out index 5f416721b03..2199d8a8b32 100644 --- a/tests/qemu-iotests/233.out +++ b/tests/qemu-iotests/233.out @@ -27,7 +27,6 @@ virtual size: 64M (67108864 bytes) disk size: unavailable =3D=3D check TLS with different CA fails =3D=3D -qemu-nbd: option negotiation failed: Verify failed: No certificate was fou= nd. qemu-img: Could not open 'driver=3Dnbd,host=3D127.0.0.1,port=3DPORT,tls-cr= eds=3Dtls0': The certificate hasn't got a known issuer =3D=3D perform I/O over TLS =3D=3D @@ -37,4 +36,7 @@ wrote 1048576/1048576 bytes at offset 1048576 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) read 1048576/1048576 bytes at offset 1048576 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D final server log =3D=3D +qemu-nbd: option negotiation failed: Verify failed: No certificate was fou= nd. *** done --=20 2.20.1