cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
05bba0
From 119ce531952beab96a8b807721e2180d99382073 Mon Sep 17 00:00:00 2001
05bba0
From: Jeffrey Cody <jcody@redhat.com>
05bba0
Date: Wed, 29 Jul 2015 16:59:55 +0200
05bba0
Subject: [PATCH 04/13] block: qemu-iotests - add check for multiplication
05bba0
 overflow in vpc
05bba0
05bba0
Message-id: <9e859f3912d1852e48fb7e25a3679bd74500c36d.1438188988.git.jcody@redhat.com>
05bba0
Patchwork-id: 67198
05bba0
O-Subject: [RHEL-7.2 qemu-kvm PATCH 3/3] block: qemu-iotests - add check for multiplication overflow in vpc
05bba0
Bugzilla: 1217349
05bba0
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
05bba0
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
05bba0
RH-Acked-by: Max Reitz <mreitz@redhat.com>
05bba0
05bba0
This checks that VPC is able to successfully fail (without segfault)
05bba0
on an image file with a max_table_entries that exceeds 0x40000000.
05bba0
05bba0
This table entry is within the valid range for VPC (although too large
05bba0
for this sample image).
05bba0
05bba0
Cc: qemu-stable@nongnu.org
05bba0
Signed-off-by: Jeff Cody <jcody@redhat.com>
05bba0
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
05bba0
(cherry picked from commit 77c102c26ead946fe7589d4bddcdfa5cb431ebfe)
05bba0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
05bba0
05bba0
Conflicts:
05bba0
	tests/qemu-iotests/group
05bba0
05bba0
Signed-off-by: Jeff Cody <jcody@redhat.com>
05bba0
---
05bba0
 tests/qemu-iotests/135     | 54 ++++++++++++++++++++++++++++++++++++++++++++++
05bba0
 tests/qemu-iotests/135.out |  5 +++++
05bba0
 tests/qemu-iotests/group   |  1 +
05bba0
 3 files changed, 60 insertions(+)
05bba0
 create mode 100755 tests/qemu-iotests/135
05bba0
 create mode 100644 tests/qemu-iotests/135.out
05bba0
05bba0
diff --git a/tests/qemu-iotests/135 b/tests/qemu-iotests/135
05bba0
new file mode 100755
05bba0
index 0000000..16bf736
05bba0
--- /dev/null
05bba0
+++ b/tests/qemu-iotests/135
05bba0
@@ -0,0 +1,54 @@
05bba0
+#!/bin/bash
05bba0
+#
05bba0
+# Test VPC open of image with large Max Table Entries value.
05bba0
+#
05bba0
+# Copyright (C) 2015 Red Hat, Inc.
05bba0
+#
05bba0
+# This program is free software; you can redistribute it and/or modify
05bba0
+# it under the terms of the GNU General Public License as published by
05bba0
+# the Free Software Foundation; either version 2 of the License, or
05bba0
+# (at your option) any later version.
05bba0
+#
05bba0
+# This program is distributed in the hope that it will be useful,
05bba0
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
05bba0
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
05bba0
+# GNU General Public License for more details.
05bba0
+#
05bba0
+# You should have received a copy of the GNU General Public License
05bba0
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
05bba0
+#
05bba0
+
05bba0
+# creator
05bba0
+owner=jcody@redhat.com
05bba0
+
05bba0
+seq=`basename $0`
05bba0
+echo "QA output created by $seq"
05bba0
+
05bba0
+here=`pwd`
05bba0
+tmp=/tmp/$$
05bba0
+status=1	# failure is the default!
05bba0
+
05bba0
+_cleanup()
05bba0
+{
05bba0
+    _cleanup_test_img
05bba0
+}
05bba0
+trap "_cleanup; exit \$status" 0 1 2 3 15
05bba0
+
05bba0
+# get standard environment, filters and checks
05bba0
+. ./common.rc
05bba0
+. ./common.filter
05bba0
+
05bba0
+_supported_fmt vpc
05bba0
+_supported_proto generic
05bba0
+_supported_os Linux
05bba0
+
05bba0
+_use_sample_img afl5.img.bz2
05bba0
+
05bba0
+echo
05bba0
+echo "=== Verify image open and failure ===="
05bba0
+$QEMU_IMG info "$TEST_IMG" 2>&1| _filter_testdir
05bba0
+
05bba0
+# success, all done
05bba0
+echo "*** done"
05bba0
+rm -f $seq.full
05bba0
+status=0
05bba0
diff --git a/tests/qemu-iotests/135.out b/tests/qemu-iotests/135.out
05bba0
new file mode 100644
05bba0
index 0000000..793898b
05bba0
--- /dev/null
05bba0
+++ b/tests/qemu-iotests/135.out
05bba0
@@ -0,0 +1,5 @@
05bba0
+QA output created by 135
05bba0
+
05bba0
+=== Verify image open and failure ====
05bba0
+qemu-img: Could not open 'TEST_DIR/afl5.img': Max Table Entries too large (1073741825)
05bba0
+*** done
05bba0
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
05bba0
index 0644c42..58b3d05 100644
05bba0
--- a/tests/qemu-iotests/group
05bba0
+++ b/tests/qemu-iotests/group
05bba0
@@ -92,3 +92,4 @@
05bba0
 114 rw auto quick
05bba0
 121 rw auto
05bba0
 130 rw auto quick
05bba0
+135 rw auto
05bba0
-- 
05bba0
1.8.3.1
05bba0