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

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