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

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