2 # Check live snapshot, followed by active commit, and another snapshot.
4 # This test is to catch the error case of BZ #1300209:
5 # https://bugzilla.redhat.com/show_bug.cgi?id=1300209
7 # Copyright (C) 2016 Red Hat, Inc.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
24 owner
=jcody@redhat.com
27 echo "QA output created by $seq"
29 status
=1 # failure is the default!
31 TMP_SNAP1
=${TEST_DIR}/tmp.qcow2
32 TMP_SNAP2
=${TEST_DIR}/tmp2.qcow2
37 for img
in "${TEST_IMG}" "${TMP_SNAP1}" "${TMP_SNAP2}"; do
42 trap "_cleanup; exit \$status" 0 1 2 3 15
44 # get standard environment, filters and checks
57 echo === Launching QEMU
===
60 qemu_comm_method
="qmp"
61 _launch_qemu
-drive file="${TEST_IMG}",if=virtio
66 echo === Performing Live Snapshot
1 ===
69 _send_qemu_cmd
$h "{ 'execute': 'qmp_capabilities' }" "return"
72 # First live snapshot, new overlay as active layer
73 _send_qemu_cmd
$h "{ 'execute': 'blockdev-snapshot-sync',
76 'snapshot-file':'${TMP_SNAP1}',
82 echo === Performing block-commit on active layer
===
85 # Block commit on active layer, push the new overlay into base
86 _send_qemu_cmd
$h "{ 'execute': 'block-commit',
92 _send_qemu_cmd
$h "{ 'execute': 'block-job-complete',
99 echo === Performing Live Snapshot
2 ===
102 # New live snapshot, new overlays as active layer
103 _send_qemu_cmd
$h "{ 'execute': 'blockdev-snapshot-sync',
106 'snapshot-file':'${TMP_SNAP2}',