thebeanogamer / rpms / qemu-kvm

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