Blame SOURCES/kvm-iotests-Add-test-for-U-force-share-conflicts.patch

26ba25
From d7e3dac2030556f68038b049b4bd6deafee43808 Mon Sep 17 00:00:00 2001
26ba25
From: Max Reitz <mreitz@redhat.com>
26ba25
Date: Mon, 18 Jun 2018 16:31:06 +0200
26ba25
Subject: [PATCH 048/268] iotests: Add test for -U/force-share conflicts
26ba25
26ba25
RH-Author: Max Reitz <mreitz@redhat.com>
26ba25
Message-id: <20180618163106.23010-4-mreitz@redhat.com>
26ba25
Patchwork-id: 80773
26ba25
O-Subject: [RHV-7.6 qemu-kvm-rhev PATCH 3/3] iotests: Add test for -U/force-share conflicts
26ba25
Bugzilla: 1576598
26ba25
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
26ba25
RH-Acked-by: Fam Zheng <famz@redhat.com>
26ba25
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
26ba25
26ba25
Signed-off-by: Max Reitz <mreitz@redhat.com>
26ba25
Message-id: 20180502202051.15493-4-mreitz@redhat.com
26ba25
Reviewed-by: Eric Blake <eblake@redhat.com>
26ba25
Signed-off-by: Max Reitz <mreitz@redhat.com>
26ba25
(cherry picked from commit 4e7d73c5fbd97e55ffe5af02f24d1f7dbe3bbf20)
26ba25
Signed-off-by: Max Reitz <mreitz@redhat.com>
26ba25
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
26ba25
---
26ba25
 tests/qemu-iotests/153     | 17 +++++++++++++++++
26ba25
 tests/qemu-iotests/153.out | 16 ++++++++++++++++
26ba25
 2 files changed, 33 insertions(+)
26ba25
26ba25
diff --git a/tests/qemu-iotests/153 b/tests/qemu-iotests/153
26ba25
index a0fd815..ec508c7 100755
26ba25
--- a/tests/qemu-iotests/153
26ba25
+++ b/tests/qemu-iotests/153
26ba25
@@ -242,6 +242,23 @@ _run_cmd $QEMU_IO "${TEST_IMG}" -c 'write 0 512'
26ba25
 
26ba25
 _cleanup_qemu
26ba25
 
26ba25
+echo
26ba25
+echo "== Detecting -U and force-share conflicts =="
26ba25
+
26ba25
+echo
26ba25
+echo 'No conflict:'
26ba25
+$QEMU_IMG info -U --image-opts driver=null-co,force-share=on
26ba25
+echo
26ba25
+echo 'Conflict:'
26ba25
+$QEMU_IMG info -U --image-opts driver=null-co,force-share=off
26ba25
+
26ba25
+echo
26ba25
+echo 'No conflict:'
26ba25
+$QEMU_IO -c 'open -r -U -o driver=null-co,force-share=on'
26ba25
+echo
26ba25
+echo 'Conflict:'
26ba25
+$QEMU_IO -c 'open -r -U -o driver=null-co,force-share=off'
26ba25
+
26ba25
 # success, all done
26ba25
 echo "*** done"
26ba25
 rm -f $seq.full
26ba25
diff --git a/tests/qemu-iotests/153.out b/tests/qemu-iotests/153.out
26ba25
index bb721cb..2510762 100644
26ba25
--- a/tests/qemu-iotests/153.out
26ba25
+++ b/tests/qemu-iotests/153.out
26ba25
@@ -399,4 +399,20 @@ Is another process using the image?
26ba25
 Closing the other
26ba25
 
26ba25
 _qemu_io_wrapper TEST_DIR/t.qcow2 -c write 0 512
26ba25
+
26ba25
+== Detecting -U and force-share conflicts ==
26ba25
+
26ba25
+No conflict:
26ba25
+image: null-co://
26ba25
+file format: null-co
26ba25
+virtual size: 1.0G (1073741824 bytes)
26ba25
+disk size: unavailable
26ba25
+
26ba25
+Conflict:
26ba25
+qemu-img: --force-share/-U conflicts with image options
26ba25
+
26ba25
+No conflict:
26ba25
+
26ba25
+Conflict:
26ba25
+-U conflicts with image options
26ba25
 *** done
26ba25
-- 
26ba25
1.8.3.1
26ba25