From patchwork Sun Nov 18 02:24:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 999413 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42yG9T0W8Sz9rxp for ; Sun, 18 Nov 2018 13:28:28 +1100 (AEDT) Received: from localhost ([::1]:50984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOCoz-0000ON-VE for incoming@patchwork.ozlabs.org; Sat, 17 Nov 2018 21:28:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOCoQ-0000Nw-Vm for qemu-devel@nongnu.org; Sat, 17 Nov 2018 21:27:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gOCku-0004IV-28 for qemu-devel@nongnu.org; Sat, 17 Nov 2018 21:24:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48972) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gOCkq-0004Fc-MD; Sat, 17 Nov 2018 21:24:08 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EF105C057F3A; Sun, 18 Nov 2018 02:24:07 +0000 (UTC) Received: from red.redhat.com (ovpn-121-37.rdu2.redhat.com [10.10.121.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6193867FA; Sun, 18 Nov 2018 02:24:06 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Sat, 17 Nov 2018 20:24:03 -0600 Message-Id: <20181118022403.2211483-1-eblake@redhat.com> In-Reply-To: <20181116155325.22428-7-berrange@redhat.com> References: <20181116155325.22428-7-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sun, 18 Nov 2018 02:24:08 +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] [PATCH 7/6] iotests: Also test I/O over NBD TLS 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Enhance test 233 to also perform I/O beyond the initial handshake. Signed-off-by: Eric Blake Reviewed-by: Daniel P. Berrangé --- Depends on my tweak to 2/6 to suppress an EIO error message on a failed read after NBD_CMD_DISC. tests/qemu-iotests/233 | 12 +++++++++++- tests/qemu-iotests/233.out | 10 ++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/233 b/tests/qemu-iotests/233 index a1ba8c09c06..5b6982be6ad 100755 --- a/tests/qemu-iotests/233 +++ b/tests/qemu-iotests/233 @@ -61,7 +61,7 @@ tls_x509_create_client "ca2" "client2" echo echo "== preparing image ==" _make_test_img 64M - +$QEMU_IO -c 'w -P 0x11 1m 1m' "$TEST_IMG" | _filter_qemu_io echo echo "== check TLS client to plain server fails ==" @@ -95,6 +95,16 @@ $QEMU_IMG info --image-opts \ driver=nbd,host=$nbd_tcp_addr,port=$nbd_tcp_port,tls-creds=tls0 \ 2>&1 | sed "s/$nbd_tcp_port/PORT/g" +echo +echo "== perform I/O over TLS ==" +QEMU_IO_OPTIONS=$QEMU_IO_OPTIONS_NO_FMT +$QEMU_IO -c 'r -P 0x11 1m 1m' -c 'w -P 0x22 1m 1m' --image-opts \ + --object tls-creds-x509,dir=${tls_dir}/client1,endpoint=client,id=tls0 \ + driver=nbd,host=$nbd_tcp_addr,port=$nbd_tcp_port,tls-creds=tls0 \ + 2>&1 | sed "s/$nbd_tcp_port/PORT/g" | _filter_qemu_io + +$QEMU_IO -f qcow2 -r -U -c 'r -P 0x22 1m 1m' "$TEST_IMG" | _filter_qemu_io + # success, all done echo "*** done" rm -f $seq.full diff --git a/tests/qemu-iotests/233.out b/tests/qemu-iotests/233.out index 616e9238c89..94acd9b9479 100644 --- a/tests/qemu-iotests/233.out +++ b/tests/qemu-iotests/233.out @@ -9,6 +9,8 @@ Generating a signed certificate... == preparing image == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 +wrote 1048576/1048576 bytes at offset 1048576 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) == check TLS client to plain server fails == qemu-img: Could not open 'driver=nbd,host=127.0.0.1,port=PORT,tls-creds=tls0': Denied by server for option 5 (starttls) @@ -27,4 +29,12 @@ disk size: unavailable == check TLS with different CA fails == option negotiation failed: Verify failed: No certificate was found. qemu-img: Could not open 'driver=nbd,host=127.0.0.1,port=PORT,tls-creds=tls0': The certificate hasn't got a known issuer + +== perform I/O over TLS == +read 1048576/1048576 bytes at offset 1048576 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +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) *** done