Package: qemu
Version: 1:2.6+dfsg-3
Severity: wishlist
Tags: patch

Hi,
attached patch adds a tiny autopkgtest to make sure qemu-img is still
working after making chnages. I came to add this since I'm usually
testing qemu but not all the helpers and so I thought I'd start
somewhere. Please apply.

Cheers,
 -- Guido


-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'stable-updates'), (500, 'unstable'), 
(500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.6.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages qemu depends on:
ii  qemu-system  1:2.6+dfsg-3
ii  qemu-user    1:2.6+dfsg-3
ii  qemu-utils   1:2.6+dfsg-3

qemu recommends no packages.

Versions of packages qemu suggests:
ii  qemu-user-static  1:2.6+dfsg-3

-- no debconf information
>From 04b82511c314fe91579801338b6c03d46848a309 Mon Sep 17 00:00:00 2001
Message-Id: <04b82511c314fe91579801338b6c03d46848a309.1469888232.git....@sigxcpu.org>
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <[email protected]>
Date: Sat, 30 Jul 2016 12:20:27 +0200
Subject: [PATCH] Add minimal autopkgtest for qemu-img

---
 debian/tests/control          |  3 +++
 debian/tests/test-qemu-img.sh | 25 +++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 debian/tests/control
 create mode 100755 debian/tests/test-qemu-img.sh

diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..6a5cad2
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,3 @@
+Tests: test-qemu-img.sh
+Depends: qemu-utils
+Restrictions: allow-stderr
diff --git a/debian/tests/test-qemu-img.sh b/debian/tests/test-qemu-img.sh
new file mode 100755
index 0000000..2ae9b0f
--- /dev/null
+++ b/debian/tests/test-qemu-img.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+set -x
+
+TESTDIR=$(mktemp -d)
+
+cleanup() {
+  [ -z "${TESTDIR}" ] || rm -rf "${TESTDIR}"
+}
+
+trap cleanup EXIT
+
+RAW_IMG="${TESTDIR}/q.img"
+qemu-img create "${RAW_IMG}" 12G
+# Check for correct size
+ls -l "${RAW_IMG}" | grep -qs " 12884901888 "
+# Check if file is sparse
+ls -s "${RAW_IMG}" | grep -qs "^0 "
+
+# Convert to a qcow2 image
+QCOW2_IMG="${TESTDIR}/q.qcow2"
+qemu-img convert -Oqcow2 "${RAW_IMG}" "${QCOW2_IMG}"
+file "${QCOW2_IMG}" | grep "QEMU QCOW Image .* 12884901888"
+
-- 
2.8.1

Reply via email to