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

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