Blob Blame History Raw
From 013a3a96a102d1b1481a08b6d37bdf958d123985 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 6 Jun 2018 20:06:39 +0100
Subject: [PATCH 2/2] tests: xz: Use 16M block size when preparing disk for xz
 plugin test.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In a recent commit guestfish changed the default size for disk images
prepared using the -N parameter from 100M to 1G:

  https://github.com/libguestfs/libguestfs/commit/adc23829e4b128562c2c29d984654528bd259644

For the xz plugin test we prepared a disk image using guestfish and
then xz-compressing the output, but we did not take our own advice and
use the --block-size parameter to limit the xz block size.  Because of
the increased size of the disk as a whole, this pushed the block size
beyond the limit that the xz plugin can handle, and the test would
fail with:

  nbdkit: error: /var/tmp/nbdkit-1.3.1/tests/disk.xz: xz file largest block is bigger than maxblock
  Either recompress the xz file with smaller blocks (see nbdkit-xz-plugin(1))
  or make maxblock parameter bigger.
  maxblock = 536870912 (bytes)
  largest block in xz file = 1073741824 (bytes)

Simple fix by adding the --block-size parameter.

Note that to see the effect of this change you will need to ‘make
maintainer-clean’ or remove the files ‘tests/disk’ and ‘tests/disk.xz’
by hand.
---
 tests/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4582120..0cc2618 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -328,7 +328,7 @@ test_xz_LDADD = libtest.la $(LIBGUESTFS_LIBS)
 
 disk.xz: disk
 	rm -f $@
-	xz --best -c disk > $@
+	xz --best --block-size=16777216 -c disk > $@
 
 endif HAVE_GUESTFISH
 endif HAVE_LIBLZMA
-- 
2.16.2