Blame SOURCES/kvm-iotests-Add-regression-test-for-commit-base-locking.patch

a94a18
From 9cac958ac666c9095490cf6814110c8083ad8929 Mon Sep 17 00:00:00 2001
a94a18
From: Fam Zheng <famz@redhat.com>
a94a18
Date: Tue, 13 Mar 2018 15:27:55 +0100
a94a18
Subject: [PATCH 2/4] iotests: Add regression test for commit base locking
a94a18
a94a18
RH-Author: Fam Zheng <famz@redhat.com>
a94a18
Message-id: <20180313152755.31475-3-famz@redhat.com>
a94a18
Patchwork-id: 79276
a94a18
O-Subject: [RHV7.5 qemu-kvm-ma PATCH v4 2/2] iotests: Add regression test for commit base locking
a94a18
Bugzilla: 1557206
a94a18
RH-Acked-by: Max Reitz <mreitz@redhat.com>
a94a18
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
a94a18
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
a94a18
a94a18
Signed-off-by: Fam Zheng <famz@redhat.com>
a94a18
Reviewed-by: Max Reitz <mreitz@redhat.com>
a94a18
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
a94a18
Signed-off-by: Fam Zheng <famz@redhat.com>
a94a18
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
a94a18
---
a94a18
 tests/qemu-iotests/153     | 11 +++++++++++
a94a18
 tests/qemu-iotests/153.out |  4 ++++
a94a18
 2 files changed, 15 insertions(+)
a94a18
a94a18
diff --git a/tests/qemu-iotests/153 b/tests/qemu-iotests/153
a94a18
index fa25eb2..0b62ac9 100755
a94a18
--- a/tests/qemu-iotests/153
a94a18
+++ b/tests/qemu-iotests/153
a94a18
@@ -178,6 +178,17 @@ ln -s ${TEST_IMG} "${TEST_IMG}.lnk" || echo "Failed to create link"
a94a18
 _run_qemu_with_images "${TEST_IMG}.lnk" "${TEST_IMG}"
a94a18
 
a94a18
 echo
a94a18
+echo "== Active commit to intermediate layer should work when base in use =="
a94a18
+_launch_qemu -drive format=$IMGFMT,file="${TEST_IMG}.a",id=drive0,if=none \
a94a18
+             -device virtio-blk,drive=drive0
a94a18
+
a94a18
+_send_qemu_cmd $QEMU_HANDLE \
a94a18
+    "{ 'execute': 'qmp_capabilities' }" \
a94a18
+    'return'
a94a18
+_run_cmd $QEMU_IMG commit -b "${TEST_IMG}.b" "${TEST_IMG}.c"
a94a18
+
a94a18
+_cleanup_qemu
a94a18
+
a94a18
 echo "== Closing an image should unlock it =="
a94a18
 _launch_qemu
a94a18
 
a94a18
diff --git a/tests/qemu-iotests/153.out b/tests/qemu-iotests/153.out
a94a18
index 5b917b1..3f19afb 100644
a94a18
--- a/tests/qemu-iotests/153.out
a94a18
+++ b/tests/qemu-iotests/153.out
a94a18
@@ -373,6 +373,10 @@ Is another process using the image?
a94a18
 QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2: Failed to get "write" lock
a94a18
 Is another process using the image?
a94a18
 
a94a18
+== Active commit to intermediate layer should work when base in use ==
a94a18
+{"return": {}}
a94a18
+
a94a18
+_qemu_img_wrapper commit -b TEST_DIR/t.qcow2.b TEST_DIR/t.qcow2.c
a94a18
 == Closing an image should unlock it ==
a94a18
 {"return": {}}
a94a18
 Adding drive
a94a18
-- 
a94a18
1.8.3.1
a94a18