Add patch to fix the xz plugin test with recent guestfish.

This commit is contained in:
Richard W.M. Jones 2018-06-06 20:14:31 +01:00
parent 4bcef61e81
commit ba2c1c3cd1
3 changed files with 62 additions and 7 deletions

View File

@ -1,9 +1,9 @@
From 06adc3dbfa162074a3cf20c58b8949f447b37ae5 Mon Sep 17 00:00:00 2001
From 974f6aba15d71984b5f05dc8b5f10bb7a5cec082 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 6 Jun 2018 19:29:35 +0100
Subject: [PATCH] tests: Provide full path to Unix domain sockets.
Subject: [PATCH 1/2] tests: Provide full path to Unix domain sockets.
Maybe a bug in libvirt?
See also this thread:
https://www.redhat.com/archives/libvir-list/2018-June/msg00490.html
---
tests/test-cache.sh | 3 ++-
@ -11,7 +11,7 @@ https://www.redhat.com/archives/libvir-list/2018-June/msg00490.html
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/test-cache.sh b/tests/test-cache.sh
index e5e9e82..ac99ce2 100755
index e5e9e82..c46e7be 100755
--- a/tests/test-cache.sh
+++ b/tests/test-cache.sh
@@ -32,6 +32,7 @@
@ -27,12 +27,12 @@ index e5e9e82..ac99ce2 100755
# Open the overlay and perform some operations.
-guestfish --format=raw -a 'nbd://?socket=cache.sock' <<'EOF'
+guestfish --format=raw -a "nbd://?socket=`pwd`/cache.sock" <<'EOF'
+guestfish --format=raw -a "nbd://?socket=$PWD/cache.sock" <<'EOF'
run
part-disk /dev/sda gpt
mkfs ext4 /dev/sda1
diff --git a/tests/test-cow.sh b/tests/test-cow.sh
index 443ba38..4b798c8 100755
index 443ba38..01d2d04 100755
--- a/tests/test-cow.sh
+++ b/tests/test-cow.sh
@@ -32,6 +32,7 @@
@ -48,7 +48,7 @@ index 443ba38..4b798c8 100755
# Write some data into the overlay.
-guestfish --format=raw -a 'nbd://?socket=cow.sock' -m /dev/sda1 <<EOF
+guestfish --format=raw -a "nbd://?socket=`pwd`/cow.sock" -m /dev/sda1 <<EOF
+guestfish --format=raw -a "nbd://?socket=$PWD/cow.sock" -m /dev/sda1 <<EOF
fill-dir / 10000
fill-pattern "abcde" 5M /large
write /hello "hello, world"

View File

@ -0,0 +1,52 @@
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

View File

@ -26,7 +26,9 @@ URL: https://github.com/libguestfs/nbdkit
Source0: http://libguestfs.org/download/nbdkit/%{name}-%{version}.tar.gz
# Upstream patches to fix the tests.
Patch1: 0001-tests-Provide-full-path-to-Unix-domain-sockets.patch
Patch2: 0002-tests-xz-Use-16M-block-size-when-preparing-disk-for-.patch
%if 0%{?rhel} == 7
# On RHEL 7, nothing in the virt stack is shipped on aarch64 and
@ -646,6 +648,7 @@ popd
* Wed Jun 6 2018 Richard W.M. Jones <rjones@redhat.com> - 1.3.1-1
- New upstream version 1.3.1.
- Add patch to work around libvirt problem with relative socket paths.
- Add patch to fix the xz plugin test with recent guestfish.
* Fri Apr 6 2018 Richard W.M. Jones <rjones@redhat.com> - 1.3.0-1
- Move to development branch version 1.3.0.