[Pkg-libvirt-commits] [libguestfs] 04/14: tests: qemu: Test force_tcg setting is effective.

Hilko Bengen bengen at moszumanska.debian.org
Sat Aug 30 08:29:25 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag upstream/1.27.21
in repository libguestfs.

commit bf47ed1b6ab94f54737b914e15e5a35a148c1b7c
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Wed Jul 2 18:18:39 2014 +0100

    tests: qemu: Test force_tcg setting is effective.
---
 tests/qemu/Makefile.am       |  3 ++-
 tests/qemu/qemu-force-tcg.sh | 49 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 1 deletion(-)

diff --git a/tests/qemu/Makefile.am b/tests/qemu/Makefile.am
index 25b65df..40237ca 100644
--- a/tests/qemu/Makefile.am
+++ b/tests/qemu/Makefile.am
@@ -23,7 +23,8 @@ include $(top_srcdir)/subdir-rules.mk
 
 TESTS = \
 	qemu-liveness.sh \
-	qemu-snapshot-isolation.sh
+	qemu-snapshot-isolation.sh \
+	qemu-force-tcg.sh
 
 TESTS_ENVIRONMENT = $(top_builddir)/run --test
 
diff --git a/tests/qemu/qemu-force-tcg.sh b/tests/qemu/qemu-force-tcg.sh
new file mode 100755
index 0000000..3641795
--- /dev/null
+++ b/tests/qemu/qemu-force-tcg.sh
@@ -0,0 +1,49 @@
+#!/bin/bash -
+# libguestfs
+# Copyright (C) 2014 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.
+
+# Check force_tcg really forces TCG mode.
+
+if [ -n "$SKIP_QEMU_FORCE_TCG_SH" ]; then
+    echo "$0: test skipped because environment variable is set."
+    exit 77
+fi
+
+# Only applicable to the direct and libvirt backends:
+if [ "$($guestfish get-backend)" = "uml" ]; then
+    echo "$0: skipping test because it is only applicable when qemu is being used."
+    exit 77
+fi
+
+set -e
+
+rm -f qemu-force-tcg.out
+
+../../fish/guestfish -a /dev/null <<EOF
+set-backend-setting force_tcg 1
+run
+debug sh "cat /sys/devices/system/clocksource/clocksource0/current_clocksource" | cat > qemu-force-tcg.out
+EOF
+
+# The output file should *not* contain kvm-clock.
+if [ "$(cat qemu-force-tcg.out)" = "kvm-clock" ]; then
+    echo "$0: force_tcg setting did not force TCG mode"
+    cat qemu-force-tcg.out
+    exit 1
+fi
+
+rm qemu-force-tcg.out

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list