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