yeahuh / rpms / qemu-kvm

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