New upstream development version 1.17.1.

Add nbdkit-eval-plugin.
Add nbdkit-ip-filter.
This commit is contained in:
Richard W.M. Jones 2019-12-01 20:03:32 +00:00
parent f269e46c70
commit d35741a127
3 changed files with 20 additions and 162 deletions

View File

@ -1,154 +0,0 @@
From 376cda7c1ede6f03f8e922e7eae8f8b60cdf8e79 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 14 Nov 2019 11:11:22 +0000
Subject: [PATCH] tests/test-captive.sh: Try to make this test more stable on
slower machines.
This test relies on sending a signal to nbdkit which causes nbdkit to
exit before the captive subprocess. On slow machines (especially
armv7 and s390x in Fedora Koji) it appears that the captive subprocess
can still exit before nbdkit receives the signal, resulting in an
incorrect exit status and test failure.
There's not a lot we can do here except to increase the sleep.
Alternatives might be to try to inspect the status of the nbdkit
process to see if it has become a zombie yet, but that would be hard
to make portable.
Typical failure on armv7:
FAIL: test-captive.sh
=====================
+ fail=0
++ mktemp -u
+ sock=/tmp/tmp.bHGd8vKHxI
+ files='/tmp/tmp.bHGd8vKHxI captive.out captive.pid'
+ rm -f /tmp/tmp.bHGd8vKHxI captive.out captive.pid
+ cleanup_fn rm -f /tmp/tmp.bHGd8vKHxI captive.out captive.pid
+ _cleanup_hook[${#_cleanup_hook[@]}]='rm -f /tmp/tmp.bHGd8vKHxI captive.out captive.pid'
+ nbdkit -U /tmp/tmp.bHGd8vKHxI example1 --run '
echo nbd=$nbd; echo port=$port; echo socket=$unixsocket
'
++ cat captive.out
+ '[' 'nbd=nbd:unix:/tmp/tmp.bHGd8vKHxI
port=
socket=/tmp/tmp.bHGd8vKHxI' '!=' 'nbd=nbd:unix:/tmp/tmp.bHGd8vKHxI
port=
socket=/tmp/tmp.bHGd8vKHxI' ']'
+ status=0
+ nbdkit -U - example1 --run 'exit 2'
+ status=2
+ test 2 '!=' 2
+ test -s captive.out
+ status=0
+ nbdkit -U - -P captive.pid example1 --run '
for i in {1..60}; do
if test -s captive.pid; then break; fi
sleep 1
done
if ! test -s captive.pid; then
echo "$0: no pidfile yet"
exit 10
fi
kill -s ABRT $(cat captive.pid) || exit 10
sleep 5
'
++ kill -l ABRT
+ test 0 '!=' 134
+ echo './test-captive.sh: unexpected exit status 0'
./test-captive.sh: unexpected exit status 0
+ fail=1
+ test -s captive.out
+ exit 1
+ _run_cleanup_hooks
+ status=1
+ set +e
+ trap '' INT QUIT TERM EXIT ERR
+ echo ./test-captive.sh: run cleanup hooks: exit code 1
./test-captive.sh: run cleanup hooks: exit code 1
+ (( i = 0 ))
+ (( i < 1 ))
+ rm -f /tmp/tmp.bHGd8vKHxI captive.out captive.pid
+ (( ++i ))
+ (( i < 1 ))
+ exit 1
FAIL test-captive.sh (exit status: 1)
Typical failure on s390x:
FAIL: test-captive.sh
=====================
+ fail=0
++ mktemp -u
+ sock=/tmp/tmp.vTRXPPqeJR
+ files='/tmp/tmp.vTRXPPqeJR captive.out captive.pid'
+ rm -f /tmp/tmp.vTRXPPqeJR captive.out captive.pid
+ cleanup_fn rm -f /tmp/tmp.vTRXPPqeJR captive.out captive.pid
+ _cleanup_hook[${#_cleanup_hook[@]}]='rm -f /tmp/tmp.vTRXPPqeJR captive.out captive.pid'
+ nbdkit -U /tmp/tmp.vTRXPPqeJR example1 --run '
echo nbd=$nbd; echo port=$port; echo socket=$unixsocket
'
++ cat captive.out
+ '[' 'nbd=nbd:unix:/tmp/tmp.vTRXPPqeJR
port=
socket=/tmp/tmp.vTRXPPqeJR' '!=' 'nbd=nbd:unix:/tmp/tmp.vTRXPPqeJR
port=
socket=/tmp/tmp.vTRXPPqeJR' ']'
+ status=0
+ nbdkit -U - example1 --run 'exit 2'
+ status=2
+ test 2 '!=' 2
+ test -s captive.out
+ status=0
+ nbdkit -U - -P captive.pid example1 --run '
for i in {1..60}; do
if test -s captive.pid; then break; fi
sleep 1
done
if ! test -s captive.pid; then
echo "$0: no pidfile yet"
exit 10
fi
kill -s ABRT $(cat captive.pid) || exit 10
sleep 5
'
++ kill -l ABRT
+ test 0 '!=' 134
+ echo './test-captive.sh: unexpected exit status 0'
./test-captive.sh: unexpected exit status 0
+ fail=1
+ test -s captive.out
+ exit 1
+ _run_cleanup_hooks
+ status=1
+ set +e
+ trap '' INT QUIT TERM EXIT ERR
+ echo ./test-captive.sh: run cleanup hooks: exit code 1
./test-captive.sh: run cleanup hooks: exit code 1
+ (( i = 0 ))
+ (( i < 1 ))
+ rm -f /tmp/tmp.vTRXPPqeJR captive.out captive.pid
+ (( ++i ))
+ (( i < 1 ))
+ exit 1
FAIL test-captive.sh (exit status: 1)
---
tests/test-captive.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test-captive.sh b/tests/test-captive.sh
index 82697a5..8762b86 100755
--- a/tests/test-captive.sh
+++ b/tests/test-captive.sh
@@ -81,7 +81,7 @@ if ! test -s captive.pid; then
exit 10
fi
kill -s ABRT $(cat captive.pid) || exit 10
-sleep 5
+sleep 10
' > captive.out || status=$?
if test $status != $(( 128 + $(kill -l ABRT) )); then
echo "$0: unexpected exit status $status"
--
2.23.0

View File

@ -29,11 +29,11 @@
%global patches_touch_autotools %{nil}
# The source directory.
%global source_directory 1.16-stable
%global source_directory 1.17-development
Name: nbdkit
Version: 1.16.0
Release: 6%{?dist}
Version: 1.17.1
Release: 1%{?dist}
Summary: NBD server
License: BSD
@ -46,9 +46,6 @@ Source1: http://libguestfs.org/download/nbdkit/%{source_directory}/%{name
Source2: libguestfs.keyring
%endif
# Upstream patch to try to make test-captive more stable.
Patch1: 0001-tests-test-captive.sh-Try-to-make-this-test-more-sta.patch
%if 0%{patches_touch_autotools}
BuildRequires: autoconf, automake, libtool
%endif
@ -156,6 +153,7 @@ License: BSD
Requires: %{name}-server%{?_isa} = %{version}-%{release}
Provides: %{name}-data-plugin = %{version}-%{release}
Provides: %{name}-eval-plugin = %{version}-%{release}
Provides: %{name}-file-plugin = %{version}-%{release}
Provides: %{name}-floppy-plugin = %{version}-%{release}
Provides: %{name}-full-plugin = %{version}-%{release}
@ -177,6 +175,8 @@ trivial dependencies.
nbdkit-data-plugin Serve small amounts of data from the command line.
nbdkit-eval-plugin Write a shell script plugin on the command line.
nbdkit-file-plugin The normal file plugin for serving files.
nbdkit-floppy-plugin Create a virtual floppy disk from a directory.
@ -454,6 +454,7 @@ Provides: %{name}-cow-filter = %{version}-%{release}
Provides: %{name}-delay-filter = %{version}-%{release}
Provides: %{name}-error-filter = %{version}-%{release}
Provides: %{name}-fua-filter = %{version}-%{release}
Provides: %{name}-ip-filter = %{version}-%{release}
Provides: %{name}-log-filter = %{version}-%{release}
Provides: %{name}-nocache-filter = %{version}-%{release}
Provides: %{name}-noextents-filter = %{version}-%{release}
@ -486,6 +487,8 @@ nbdkit-error-filter Inject errors.
nbdkit-fua-filter Modify flush behaviour in plugins.
nbdkit-ip-filter Filter clients by IP address.
nbdkit-log-filter Log all transactions to a file.
nbdkit-nocache-filter Disable cache requests in the underlying plugin.
@ -657,6 +660,7 @@ make %{?_smp_mflags} check || {
%doc README
%license LICENSE
%{_libdir}/%{name}/plugins/nbdkit-data-plugin.so
%{_libdir}/%{name}/plugins/nbdkit-eval-plugin.so
%{_libdir}/%{name}/plugins/nbdkit-file-plugin.so
%{_libdir}/%{name}/plugins/nbdkit-floppy-plugin.so
%{_libdir}/%{name}/plugins/nbdkit-full-plugin.so
@ -671,6 +675,7 @@ make %{?_smp_mflags} check || {
%{_libdir}/%{name}/plugins/nbdkit-streaming-plugin.so
%{_libdir}/%{name}/plugins/nbdkit-zero-plugin.so
%{_mandir}/man1/nbdkit-data-plugin.1*
%{_mandir}/man1/nbdkit-eval-plugin.1*
%{_mandir}/man1/nbdkit-file-plugin.1*
%{_mandir}/man1/nbdkit-floppy-plugin.1*
%{_mandir}/man1/nbdkit-full-plugin.1*
@ -833,6 +838,7 @@ make %{?_smp_mflags} check || {
%{_libdir}/%{name}/filters/nbdkit-delay-filter.so
%{_libdir}/%{name}/filters/nbdkit-error-filter.so
%{_libdir}/%{name}/filters/nbdkit-fua-filter.so
%{_libdir}/%{name}/filters/nbdkit-ip-filter.so
%{_libdir}/%{name}/filters/nbdkit-log-filter.so
%{_libdir}/%{name}/filters/nbdkit-nocache-filter.so
%{_libdir}/%{name}/filters/nbdkit-noextents-filter.so
@ -852,6 +858,7 @@ make %{?_smp_mflags} check || {
%{_mandir}/man1/nbdkit-delay-filter.1*
%{_mandir}/man1/nbdkit-error-filter.1*
%{_mandir}/man1/nbdkit-fua-filter.1*
%{_mandir}/man1/nbdkit-ip-filter.1*
%{_mandir}/man1/nbdkit-log-filter.1*
%{_mandir}/man1/nbdkit-nocache-filter.1*
%{_mandir}/man1/nbdkit-noextents-filter.1*
@ -906,6 +913,11 @@ make %{?_smp_mflags} check || {
%changelog
* Sun Dec 1 2019 Richard W.M. Jones <rjones@redhat.com> - 1.17.1-1
- New upstream development version 1.17.1.
- Add nbdkit-eval-plugin.
- Add nbdkit-ip-filter.
* Wed Nov 27 2019 Richard W.M. Jones <rjones@redhat.com> - 1.16.0-6
- Use gpgverify macro instead of explicit gpgv2 command.

View File

@ -1,2 +1,2 @@
SHA512 (nbdkit-1.16.0.tar.gz) = 71f38d0290f6ae9bb765d728857b7eaee12d3960d46ad760f9ebe76c747a26fa72a770982af94d43cda5631f90a3c24002ca671aba599e674e929dcafa533e6e
SHA512 (nbdkit-1.16.0.tar.gz.sig) = bedc654fc3dd5b08415f482678fb7eba4a4c590d139176b0a08833642ee1503af36e868d80dbbeb3ad1e869b2ba001d6f997f8b516988963787e2c00ca4eabb3
SHA512 (nbdkit-1.17.1.tar.gz) = 58cc49eb638157a07553a8bbb7c6675dc0f123752797f5535a2e7a63d905d576b0328d06cf80d0631d442648846388b343c01359cae821f932ca4f7b3a5ea92c
SHA512 (nbdkit-1.17.1.tar.gz.sig) = e925ac21cd182b0812b7be89ba3c7db0eafa177c84cd988c0ebb9b13377326895153071c6ffe5192538de9fe2c61ec6fe039b8fc80eb58e5a9f2e0156adc6668