mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
'make extra-tests' was a monolithic set of tests that did all sorts of things: valgrind, tests over local guests, tests with upstream qemu, tests with upstream libvirt, tests with the appliance attach method. This made it hard to perform individual tests, eg. just valgrind testing. It was also hard to maintain because the tests were not located in the same directories as the programs and sometimes duplicated tests that were run elsewhere. This commit splits up 'make extra-tests' into 5 separate targets: make check-valgrind # run a subset of tests under valgrind make check-valgrind-local-guests # test under valgrind with local guests make check-with-appliance # test with attach-method == appliance make check-with-upstream-qemu # test with an alternate/upstream qemu make check-with-upstream-libvirt # test with an alternate/upstream libvirt (You can also still run 'make extra-tests' which is now simply a rule that runs the above 5 targets in order). This replaces everything that was in the tests/extra directory, so that has now gone.
55 lines
1.8 KiB
Bash
Executable File
55 lines
1.8 KiB
Bash
Executable File
#!/bin/bash -
|
|
# libguestfs virt-resize 2.0 test script
|
|
# Copyright (C) 2010-2012 Red Hat Inc.
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write to the Free Software
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
export LANG=C
|
|
set -e
|
|
|
|
# Test expanding.
|
|
#
|
|
# This exercises a number of interesting codepaths including resizing
|
|
# LV content, handling GPT, and using qcow2 as a target.
|
|
|
|
$VG ../fish/guestfish -N bootrootlv:/dev/VG/LV:ext2:ext4:400M:32M:gpt </dev/null
|
|
|
|
qemu-img create -f qcow2 test2.img 500M
|
|
$VG ./virt-resize -d --debug-gc \
|
|
--expand /dev/sda2 \
|
|
--lv-expand /dev/VG/LV \
|
|
--format raw --output-format qcow2 \
|
|
test1.img test2.img
|
|
|
|
# Test shrinking in a semi-realistic scenario. Although the disk
|
|
# image created above contains no data, we will nevertheless use
|
|
# similar operations to ones that might be used by a real admin.
|
|
|
|
../fish/guestfish -a test1.img <<EOF
|
|
run
|
|
resize2fs-size /dev/VG/LV 190M
|
|
lvresize /dev/VG/LV 190
|
|
pvresize-size /dev/sda2 200M
|
|
fsck ext4 /dev/VG/LV
|
|
EOF
|
|
|
|
rm -f test2.img; ../fish/guestfish sparse test2.img 300M
|
|
$VG ./virt-resize -d --debug-gc \
|
|
--shrink /dev/sda2 \
|
|
--format raw --output-format raw \
|
|
test1.img test2.img
|
|
|
|
rm -f test1.img test2.img
|