Pablo Greco e6a3ae
From 471ed976b9bd7ed28c1cd2bf514e69098495f4ed Mon Sep 17 00:00:00 2001
Pablo Greco e6a3ae
From: Max Reitz <mreitz@redhat.com>
Pablo Greco e6a3ae
Date: Wed, 3 Apr 2019 17:13:08 +0100
Pablo Greco e6a3ae
Subject: [PATCH 01/11] iotests: 153: Fix dead code
Pablo Greco e6a3ae
Pablo Greco e6a3ae
RH-Author: Max Reitz <mreitz@redhat.com>
Pablo Greco e6a3ae
Message-id: <20190403171315.20841-2-mreitz@redhat.com>
Pablo Greco e6a3ae
Patchwork-id: 85399
Pablo Greco e6a3ae
O-Subject: [RHEL-8.1 qemu-kvm PATCH 1/8] iotests: 153: Fix dead code
Pablo Greco e6a3ae
Bugzilla: 1694148
Pablo Greco e6a3ae
RH-Acked-by: John Snow <jsnow@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
From: Fam Zheng <famz@redhat.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
This step was left behind my mistake. As suggested by the echoed text,
Pablo Greco e6a3ae
the intention was to test two devices with the same image, with
Pablo Greco e6a3ae
different options. The behavior should be the same as two QEMU
Pablo Greco e6a3ae
processes. Complete it.
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Signed-off-by: Fam Zheng <famz@redhat.com>
Pablo Greco e6a3ae
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Pablo Greco e6a3ae
(cherry picked from commit 0e1a582750269d3dde0481ca034b08a5784e430c)
Pablo Greco e6a3ae
Signed-off-by: Max Reitz <mreitz@redhat.com>
Pablo Greco e6a3ae
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Pablo Greco e6a3ae
---
Pablo Greco e6a3ae
 tests/qemu-iotests/153     |  2 ++
Pablo Greco e6a3ae
 tests/qemu-iotests/153.out | 25 +++++++++++++++++++++++++
Pablo Greco e6a3ae
 2 files changed, 27 insertions(+)
Pablo Greco e6a3ae
Pablo Greco e6a3ae
diff --git a/tests/qemu-iotests/153 b/tests/qemu-iotests/153
Pablo Greco e6a3ae
index 673813c..0daeb1b 100755
Pablo Greco e6a3ae
--- a/tests/qemu-iotests/153
Pablo Greco e6a3ae
+++ b/tests/qemu-iotests/153
Pablo Greco e6a3ae
@@ -162,6 +162,7 @@ for opts1 in "" "read-only=on" "read-only=on,force-share=on"; do
Pablo Greco e6a3ae
     _cleanup_qemu
Pablo Greco e6a3ae
 done
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
+test_opts="read-only=off read-only=on read-only=on,force-share=on"
Pablo Greco e6a3ae
 for opt1 in $test_opts; do
Pablo Greco e6a3ae
     for opt2 in $test_opts; do
Pablo Greco e6a3ae
         echo
Pablo Greco e6a3ae
@@ -170,6 +171,7 @@ for opt1 in $test_opts; do
Pablo Greco e6a3ae
     done
Pablo Greco e6a3ae
 done
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
+echo
Pablo Greco e6a3ae
 echo "== Creating ${TEST_IMG}.[abc] ==" | _filter_testdir
Pablo Greco e6a3ae
 (
Pablo Greco e6a3ae
     $QEMU_IMG create -f qcow2 "${TEST_IMG}.a" -b "${TEST_IMG}"
Pablo Greco e6a3ae
diff --git a/tests/qemu-iotests/153.out b/tests/qemu-iotests/153.out
Pablo Greco e6a3ae
index 3492ba7..93eaf10 100644
Pablo Greco e6a3ae
--- a/tests/qemu-iotests/153.out
Pablo Greco e6a3ae
+++ b/tests/qemu-iotests/153.out
Pablo Greco e6a3ae
@@ -369,6 +369,31 @@ _qemu_img_wrapper bench -U -w -c 1 TEST_DIR/t.qcow2
Pablo Greco e6a3ae
 qemu-img: Could not open 'TEST_DIR/t.qcow2': force-share=on can only be used with read-only images
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
 Round done
Pablo Greco e6a3ae
+
Pablo Greco e6a3ae
+== Two devices with the same image (read-only=off - read-only=off) ==
Pablo Greco e6a3ae
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,read-only=off: Failed to get "write" lock
Pablo Greco e6a3ae
+Is another process using the image?
Pablo Greco e6a3ae
+
Pablo Greco e6a3ae
+== Two devices with the same image (read-only=off - read-only=on) ==
Pablo Greco e6a3ae
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,read-only=on: Failed to get shared "write" lock
Pablo Greco e6a3ae
+Is another process using the image?
Pablo Greco e6a3ae
+
Pablo Greco e6a3ae
+== Two devices with the same image (read-only=off - read-only=on,force-share=on) ==
Pablo Greco e6a3ae
+
Pablo Greco e6a3ae
+== Two devices with the same image (read-only=on - read-only=off) ==
Pablo Greco e6a3ae
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,read-only=off: Failed to get "write" lock
Pablo Greco e6a3ae
+Is another process using the image?
Pablo Greco e6a3ae
+
Pablo Greco e6a3ae
+== Two devices with the same image (read-only=on - read-only=on) ==
Pablo Greco e6a3ae
+
Pablo Greco e6a3ae
+== Two devices with the same image (read-only=on - read-only=on,force-share=on) ==
Pablo Greco e6a3ae
+
Pablo Greco e6a3ae
+== Two devices with the same image (read-only=on,force-share=on - read-only=off) ==
Pablo Greco e6a3ae
+
Pablo Greco e6a3ae
+== Two devices with the same image (read-only=on,force-share=on - read-only=on) ==
Pablo Greco e6a3ae
+
Pablo Greco e6a3ae
+== Two devices with the same image (read-only=on,force-share=on - read-only=on,force-share=on) ==
Pablo Greco e6a3ae
+
Pablo Greco e6a3ae
 == Creating TEST_DIR/t.qcow2.[abc] ==
Pablo Greco e6a3ae
 Formatting 'TEST_DIR/t.IMGFMT.a', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT
Pablo Greco e6a3ae
 Formatting 'TEST_DIR/t.IMGFMT.b', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT
Pablo Greco e6a3ae
-- 
Pablo Greco e6a3ae
1.8.3.1
Pablo Greco e6a3ae