[4/4] iotests: Add regression test for commit base locking
diff mbox series

Message ID 20180309080910.7274-5-famz@redhat.com
State New
Headers show
Series
  • Untitled series #32818
Related show

Commit Message

Fam Zheng March 9, 2018, 8:09 a.m. UTC
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/qemu-iotests/153     | 6 ++++++
 tests/qemu-iotests/153.out | 4 ++++
 2 files changed, 10 insertions(+)

Patch
diff mbox series

diff --git a/tests/qemu-iotests/153 b/tests/qemu-iotests/153
index fa25eb24bd..5a82acebd3 100755
--- a/tests/qemu-iotests/153
+++ b/tests/qemu-iotests/153
@@ -177,6 +177,12 @@  rm -f "${TEST_IMG}.lnk" &>/dev/null
 ln -s ${TEST_IMG} "${TEST_IMG}.lnk" || echo "Failed to create link"
 _run_qemu_with_images "${TEST_IMG}.lnk" "${TEST_IMG}"
 
+echo
+echo "== Active commit to intermediate layer should work when base in use =="
+_launch_qemu -drive format=$IMGFMT,file="${TEST_IMG}.a",id=drive0 \
+             -device virtio-blk,drive=drive0
+_run_cmd $QEMU_IMG commit -b "${TEST_IMG}.b" "${TEST_IMG}.c"
+
 echo
 echo "== Closing an image should unlock it =="
 _launch_qemu
diff --git a/tests/qemu-iotests/153.out b/tests/qemu-iotests/153.out
index 5b917b177c..60d2d661f1 100644
--- a/tests/qemu-iotests/153.out
+++ b/tests/qemu-iotests/153.out
@@ -373,6 +373,10 @@  Is another process using the image?
 QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2: Failed to get "write" lock
 Is another process using the image?
 
+== Active commit to intermediate layer should work when base in use ==
+
+_qemu_img_wrapper commit -b TEST_DIR/t.qcow2.b TEST_DIR/t.qcow2.c
+
 == Closing an image should unlock it ==
 {"return": {}}
 Adding drive