root / tests / qemu-iotests / 029 @ 9a05feab
History | View | Annotate | Download (1.6 kB)
1 | 8455e4ee | Kevin Wolf | #!/bin/bash |
---|---|---|---|
2 | 8455e4ee | Kevin Wolf | # |
3 | 8455e4ee | Kevin Wolf | # Test loading internal snapshots where the L1 table of the snapshot |
4 | 8455e4ee | Kevin Wolf | # is smaller than the current L1 table. |
5 | 8455e4ee | Kevin Wolf | # |
6 | 8455e4ee | Kevin Wolf | # Copyright (C) 2011 Red Hat, Inc. |
7 | 8455e4ee | Kevin Wolf | # |
8 | 8455e4ee | Kevin Wolf | # This program is free software; you can redistribute it and/or modify |
9 | 8455e4ee | Kevin Wolf | # it under the terms of the GNU General Public License as published by |
10 | 8455e4ee | Kevin Wolf | # the Free Software Foundation; either version 2 of the License, or |
11 | 8455e4ee | Kevin Wolf | # (at your option) any later version. |
12 | 8455e4ee | Kevin Wolf | # |
13 | 8455e4ee | Kevin Wolf | # This program is distributed in the hope that it will be useful, |
14 | 8455e4ee | Kevin Wolf | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | 8455e4ee | Kevin Wolf | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | 8455e4ee | Kevin Wolf | # GNU General Public License for more details. |
17 | 8455e4ee | Kevin Wolf | # |
18 | 8455e4ee | Kevin Wolf | # You should have received a copy of the GNU General Public License |
19 | 8455e4ee | Kevin Wolf | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 | 8455e4ee | Kevin Wolf | # |
21 | 8455e4ee | Kevin Wolf | |
22 | 8455e4ee | Kevin Wolf | # creator |
23 | 8455e4ee | Kevin Wolf | owner=kwolf@redhat.com |
24 | 8455e4ee | Kevin Wolf | |
25 | 8455e4ee | Kevin Wolf | seq=`basename $0` |
26 | 8455e4ee | Kevin Wolf | echo "QA output created by $seq" |
27 | 8455e4ee | Kevin Wolf | |
28 | 8455e4ee | Kevin Wolf | here=`pwd` |
29 | 8455e4ee | Kevin Wolf | tmp=/tmp/$$ |
30 | 8455e4ee | Kevin Wolf | status=1 # failure is the default! |
31 | 8455e4ee | Kevin Wolf | |
32 | 8455e4ee | Kevin Wolf | _cleanup() |
33 | 8455e4ee | Kevin Wolf | { |
34 | 8455e4ee | Kevin Wolf | _cleanup_test_img |
35 | 8455e4ee | Kevin Wolf | } |
36 | 8455e4ee | Kevin Wolf | trap "_cleanup; exit \$status" 0 1 2 3 15 |
37 | 8455e4ee | Kevin Wolf | |
38 | 8455e4ee | Kevin Wolf | # get standard environment, filters and checks |
39 | 8455e4ee | Kevin Wolf | . ./common.rc |
40 | 8455e4ee | Kevin Wolf | . ./common.filter |
41 | 8455e4ee | Kevin Wolf | . ./common.pattern |
42 | 8455e4ee | Kevin Wolf | |
43 | 8455e4ee | Kevin Wolf | # Any format supporting intenal snapshots |
44 | 8455e4ee | Kevin Wolf | _supported_fmt qcow2 |
45 | 8455e4ee | Kevin Wolf | _supported_proto generic |
46 | 8455e4ee | Kevin Wolf | _supported_os Linux |
47 | 8455e4ee | Kevin Wolf | |
48 | 8455e4ee | Kevin Wolf | CLUSTER_SIZE=65536 |
49 | 8455e4ee | Kevin Wolf | _make_test_img 64M |
50 | fef9c191 | Jeff Cody | $QEMU_IMG snapshot -c foo "$TEST_IMG" |
51 | fef9c191 | Jeff Cody | $QEMU_IO -c 'write -b 0 4k' "$TEST_IMG" | _filter_qemu_io |
52 | fef9c191 | Jeff Cody | $QEMU_IMG snapshot -a foo "$TEST_IMG" |
53 | 8455e4ee | Kevin Wolf | _check_test_img |
54 | 8455e4ee | Kevin Wolf | |
55 | 8455e4ee | Kevin Wolf | CLUSTER_SIZE=1024 |
56 | 8455e4ee | Kevin Wolf | _make_test_img 16M |
57 | fef9c191 | Jeff Cody | $QEMU_IMG snapshot -c foo "$TEST_IMG" |
58 | fef9c191 | Jeff Cody | $QEMU_IO -c 'write -b 0 4M' "$TEST_IMG" | _filter_qemu_io |
59 | fef9c191 | Jeff Cody | $QEMU_IMG snapshot -a foo "$TEST_IMG" |
60 | 8455e4ee | Kevin Wolf | _check_test_img |
61 | 8455e4ee | Kevin Wolf | |
62 | 8455e4ee | Kevin Wolf | # success, all done |
63 | 8455e4ee | Kevin Wolf | echo "*** done" |
64 | 8455e4ee | Kevin Wolf | rm -f $seq.full |
65 | 8455e4ee | Kevin Wolf | status=0 |