Blame SOURCES/kvm-iotests-fix-nbd-test-233-to-work-correctly-with-raw-.patch

7711c0
From e33997285c334322f45b36900f63786ba4de8cc9 Mon Sep 17 00:00:00 2001
7711c0
From: John Snow <jsnow@redhat.com>
7711c0
Date: Fri, 22 Mar 2019 03:22:41 +0100
7711c0
Subject: [PATCH 074/163] iotests: fix nbd test 233 to work correctly with raw
7711c0
 images
7711c0
MIME-Version: 1.0
7711c0
Content-Type: text/plain; charset=UTF-8
7711c0
Content-Transfer-Encoding: 8bit
7711c0
7711c0
RH-Author: John Snow <jsnow@redhat.com>
7711c0
Message-id: <20190322032241.8111-29-jsnow@redhat.com>
7711c0
Patchwork-id: 85115
7711c0
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 28/28] iotests: fix nbd test 233 to work correctly with raw images
7711c0
Bugzilla: 1691563
7711c0
RH-Acked-by: Max Reitz <mreitz@redhat.com>
7711c0
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
7711c0
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
7711c0
From: Daniel P. Berrangé <berrange@redhat.com>
7711c0
7711c0
The first qemu-io command must honour the $IMGFMT that is set rather
7711c0
than hardcoding qcow2. The qemu-nbd commands should also set $IMGFMT
7711c0
to avoid the insecure format probe warning.
7711c0
7711c0
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7711c0
Reviewed-by: Eric Blake <eblake@redhat.com>
7711c0
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
7711c0
(cherry picked from commit e4c8f2925d22584b2008aadea5c70e1e05c2a522)
7711c0
Signed-off-by: John Snow <jsnow@redhat.com>
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 tests/qemu-iotests/233 | 9 ++++++---
7711c0
 1 file changed, 6 insertions(+), 3 deletions(-)
7711c0
7711c0
diff --git a/tests/qemu-iotests/233 b/tests/qemu-iotests/233
7711c0
index a4da60d..1814efe 100755
7711c0
--- a/tests/qemu-iotests/233
7711c0
+++ b/tests/qemu-iotests/233
7711c0
@@ -66,7 +66,7 @@ $QEMU_IO -c 'w -P 0x11 1m 1m' "$TEST_IMG" | _filter_qemu_io
7711c0
 
7711c0
 echo
7711c0
 echo "== check TLS client to plain server fails =="
7711c0
-nbd_server_start_tcp_socket "$TEST_IMG"
7711c0
+nbd_server_start_tcp_socket -f $IMGFMT "$TEST_IMG"
7711c0
 
7711c0
 $QEMU_IMG info --image-opts \
7711c0
     --object tls-creds-x509,dir=${tls_dir}/client1,endpoint=client,id=tls0 \
7711c0
@@ -78,7 +78,10 @@ nbd_server_stop
7711c0
 echo
7711c0
 echo "== check plain client to TLS server fails =="
7711c0
 
7711c0
-nbd_server_start_tcp_socket --object tls-creds-x509,dir=${tls_dir}/server1,endpoint=server,id=tls0,verify-peer=yes --tls-creds tls0 "$TEST_IMG"
7711c0
+nbd_server_start_tcp_socket \
7711c0
+    --object tls-creds-x509,dir=${tls_dir}/server1,endpoint=server,id=tls0,verify-peer=yes \
7711c0
+    --tls-creds tls0 \
7711c0
+    -f $IMGFMT "$TEST_IMG"
7711c0
 
7711c0
 $QEMU_IMG info nbd://localhost:$nbd_tcp_port 2>&1 | sed "s/$nbd_tcp_port/PORT/g"
7711c0
 
7711c0
@@ -104,7 +107,7 @@ $QEMU_IO -c 'r -P 0x11 1m 1m' -c 'w -P 0x22 1m 1m' --image-opts \
7711c0
     driver=nbd,host=$nbd_tcp_addr,port=$nbd_tcp_port,tls-creds=tls0 \
7711c0
     2>&1 | _filter_qemu_io
7711c0
 
7711c0
-$QEMU_IO -f qcow2 -r -U -c 'r -P 0x22 1m 1m' "$TEST_IMG" | _filter_qemu_io
7711c0
+$QEMU_IO -f $IMGFMT -r -U -c 'r -P 0x22 1m 1m' "$TEST_IMG" | _filter_qemu_io
7711c0
 
7711c0
 # success, all done
7711c0
 echo "*** done"
7711c0
-- 
7711c0
1.8.3.1
7711c0