From 52be0a6c5001a54fbab68beaa6903da8a7fb5b89 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 13 Sep 2017 09:57:26 +0100 Subject: [PATCH] tests/qemu: Split qemu snapshot isolation into 3 tests. It contained 3 tests before. It's better to run them in parallel. Just a simple refactoring, no change. --- tests/qemu/Makefile.am | 4 +- ...pshot-isolation-add-drive-opts-readonly.sh | 68 +++++++++++++++++++ .../qemu-snapshot-isolation-add-drive-ro.sh | 68 +++++++++++++++++++ ...on.sh => qemu-snapshot-isolation-qcow2.sh} | 64 +++-------------- 4 files changed, 150 insertions(+), 54 deletions(-) create mode 100755 tests/qemu/qemu-snapshot-isolation-add-drive-opts-readonly.sh create mode 100755 tests/qemu/qemu-snapshot-isolation-add-drive-ro.sh rename tests/qemu/{qemu-snapshot-isolation.sh => qemu-snapshot-isolation-qcow2.sh} (51%) diff --git a/tests/qemu/Makefile.am b/tests/qemu/Makefile.am index 72a7b9845..3faaa65ef 100644 --- a/tests/qemu/Makefile.am +++ b/tests/qemu/Makefile.am @@ -23,7 +23,9 @@ include $(top_srcdir)/subdir-rules.mk TESTS = \ qemu-liveness.sh \ - qemu-snapshot-isolation.sh \ + qemu-snapshot-isolation-add-drive-opts-readonly.sh \ + qemu-snapshot-isolation-add-drive-ro.sh \ + qemu-snapshot-isolation-qcow2.sh \ qemu-force-tcg.sh TESTS_ENVIRONMENT = $(top_builddir)/run --test diff --git a/tests/qemu/qemu-snapshot-isolation-add-drive-opts-readonly.sh b/tests/qemu/qemu-snapshot-isolation-add-drive-opts-readonly.sh new file mode 100755 index 000000000..a0b640151 --- /dev/null +++ b/tests/qemu/qemu-snapshot-isolation-add-drive-opts-readonly.sh @@ -0,0 +1,68 @@ +#!/bin/bash - +# libguestfs +# Copyright (C) 2011-2017 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. + +# Test that qemu snapshots are really isolating writes from the +# underlying disk image. If this test were to fail, you could expect +# libguestfs to cause massive disk corruption on live guests. + +set -e + +$TEST_FUNCTIONS +skip_if_skipped + +f=isolation-add-drive-opts-readonly.img +rm -f $f + +guestfish sparse $f 100M +md5sum="$(do_md5 $f)" + +guestfish <