New upstream version 1.1.7.
- Remove patches which are now all upstream.
This commit is contained in:
parent
01cfedc007
commit
6056e460b4
@ -1,27 +0,0 @@
|
||||
From 030c5e2573faa84887b09b847bb48a280a698f1f Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Sun, 16 Feb 2014 12:55:48 +0000
|
||||
Subject: [PATCH 1/2] Don't pass NULL pointer to asprintf when generating --run
|
||||
command.
|
||||
|
||||
This fixes commit 4ce0dbc3f425e6d609cc6739dac8c23b44b1c61b.
|
||||
---
|
||||
src/main.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main.c b/src/main.c
|
||||
index 9c1c2f0..9dcd030 100644
|
||||
--- a/src/main.c
|
||||
+++ b/src/main.c
|
||||
@@ -546,7 +546,7 @@ run_command (void)
|
||||
"port='%s'\n"
|
||||
"unixsocket='%s'\n"
|
||||
"%s",
|
||||
- url, port, unixsocket, run);
|
||||
+ url, port ? port : "", unixsocket ? unixsocket : "", run);
|
||||
if (r == -1) {
|
||||
perror ("asprintf");
|
||||
exit (EXIT_FAILURE);
|
||||
--
|
||||
1.8.4.2
|
||||
|
@ -1,493 +0,0 @@
|
||||
From 76d7450b5b5abea8781fbe99c0053bbd9704d247 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Sun, 16 Feb 2014 12:10:01 +0000
|
||||
Subject: [PATCH 2/2] tests: Test the nbdkit command line more thoroughly.
|
||||
|
||||
---
|
||||
tests/Makefile.am | 28 ++++++++++++++--
|
||||
tests/test-captive.sh | 54 +++++++++++++++++++++++++++++++
|
||||
tests/test-dump-config.sh | 41 ++++++++++++++++++++++++
|
||||
tests/test-foreground.sh | 80 ++++++++++++++++++++++++++++++++++++++++++++++
|
||||
tests/test-help-plugin.sh | 41 ++++++++++++++++++++++++
|
||||
tests/test-help.sh | 41 ++++++++++++++++++++++++
|
||||
tests/test-single.sh | 40 +++++++++++++++++++++++
|
||||
tests/test-start.sh | 81 +++++++++++++++++++++++++++++++++++++++++++++++
|
||||
8 files changed, 403 insertions(+), 3 deletions(-)
|
||||
create mode 100755 tests/test-captive.sh
|
||||
create mode 100755 tests/test-dump-config.sh
|
||||
create mode 100755 tests/test-foreground.sh
|
||||
create mode 100755 tests/test-help-plugin.sh
|
||||
create mode 100755 tests/test-help.sh
|
||||
create mode 100755 tests/test-single.sh
|
||||
create mode 100755 tests/test-start.sh
|
||||
|
||||
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
||||
index 417cb3d..619bed2 100644
|
||||
--- a/tests/Makefile.am
|
||||
+++ b/tests/Makefile.am
|
||||
@@ -33,9 +33,31 @@
|
||||
CLEANFILES = *~
|
||||
MAINTAINERCLEANFILES =
|
||||
|
||||
-EXTRA_DIST = test.pl test.py
|
||||
+EXTRA_DIST = \
|
||||
+ test-captive.sh \
|
||||
+ test-dump-config.sh \
|
||||
+ test-foreground.sh \
|
||||
+ test-help.sh \
|
||||
+ test-help-plugin.sh \
|
||||
+ test.pl \
|
||||
+ test.py \
|
||||
+ test-single.sh \
|
||||
+ test-start.sh
|
||||
+
|
||||
+# Basic server command line and start-up tests.
|
||||
+
|
||||
+TESTS = \
|
||||
+ test-help.sh \
|
||||
+ test-help-plugin.sh \
|
||||
+ test-dump-config.sh \
|
||||
+ test-start.sh \
|
||||
+ test-foreground.sh \
|
||||
+ test-single.sh \
|
||||
+ test-captive.sh
|
||||
+
|
||||
+# In-depth tests need libguestfs, since that is a convenient way to
|
||||
+# drive qemu.
|
||||
|
||||
-# Tests need libguestfs, since that is a convenient way to drive qemu.
|
||||
if HAVE_LIBGUESTFS
|
||||
|
||||
# Use the 'direct' backend, and ensure maximum libguestfs debugging is
|
||||
@@ -52,7 +74,7 @@ libtest_la_CFLAGS = $(WARNINGS_CFLAGS)
|
||||
|
||||
# Basic connection test.
|
||||
check_PROGRAMS = test-connect
|
||||
-TESTS = test-connect
|
||||
+TESTS += test-connect
|
||||
check_DATA =
|
||||
|
||||
test_connect_SOURCES = test-connect.c test.h
|
||||
diff --git a/tests/test-captive.sh b/tests/test-captive.sh
|
||||
new file mode 100755
|
||||
index 0000000..5f18b5f
|
||||
--- /dev/null
|
||||
+++ b/tests/test-captive.sh
|
||||
@@ -0,0 +1,54 @@
|
||||
+#!/bin/bash -
|
||||
+# nbdkit
|
||||
+# Copyright (C) 2014 Red Hat Inc.
|
||||
+# All rights reserved.
|
||||
+#
|
||||
+# Redistribution and use in source and binary forms, with or without
|
||||
+# modification, are permitted provided that the following conditions are
|
||||
+# met:
|
||||
+#
|
||||
+# * Redistributions of source code must retain the above copyright
|
||||
+# notice, this list of conditions and the following disclaimer.
|
||||
+#
|
||||
+# * Redistributions in binary form must reproduce the above copyright
|
||||
+# notice, this list of conditions and the following disclaimer in the
|
||||
+# documentation and/or other materials provided with the distribution.
|
||||
+#
|
||||
+# * Neither the name of Red Hat nor the names of its contributors may be
|
||||
+# used to endorse or promote products derived from this software without
|
||||
+# specific prior written permission.
|
||||
+#
|
||||
+# THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND
|
||||
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
+# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR
|
||||
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
+# SUCH DAMAGE.
|
||||
+
|
||||
+set -e
|
||||
+set -x
|
||||
+
|
||||
+# Test nbdkit --run (captive nbdkit) option.
|
||||
+
|
||||
+rm -f captive.sock captive.out
|
||||
+
|
||||
+../src/nbdkit -U captive.sock \
|
||||
+ ../plugins/example1/.libs/nbdkit-example1-plugin.so \
|
||||
+ --run 'sleep 5; echo nbd=$nbd; echo port=$port; echo socket=$unixsocket' > captive.out
|
||||
+
|
||||
+# Check the output.
|
||||
+if [ "$(cat captive.out)" != "nbd=nbd:unix:$(pwd)/captive.sock
|
||||
+port=
|
||||
+socket=$(pwd)/captive.sock" ]; then
|
||||
+ echo "$0: unexpected output"
|
||||
+ cat captive.out
|
||||
+ exit 1
|
||||
+fi
|
||||
+
|
||||
+rm captive.sock captive.out
|
||||
diff --git a/tests/test-dump-config.sh b/tests/test-dump-config.sh
|
||||
new file mode 100755
|
||||
index 0000000..1ed7fb7
|
||||
--- /dev/null
|
||||
+++ b/tests/test-dump-config.sh
|
||||
@@ -0,0 +1,41 @@
|
||||
+#!/bin/bash -
|
||||
+# nbdkit
|
||||
+# Copyright (C) 2014 Red Hat Inc.
|
||||
+# All rights reserved.
|
||||
+#
|
||||
+# Redistribution and use in source and binary forms, with or without
|
||||
+# modification, are permitted provided that the following conditions are
|
||||
+# met:
|
||||
+#
|
||||
+# * Redistributions of source code must retain the above copyright
|
||||
+# notice, this list of conditions and the following disclaimer.
|
||||
+#
|
||||
+# * Redistributions in binary form must reproduce the above copyright
|
||||
+# notice, this list of conditions and the following disclaimer in the
|
||||
+# documentation and/or other materials provided with the distribution.
|
||||
+#
|
||||
+# * Neither the name of Red Hat nor the names of its contributors may be
|
||||
+# used to endorse or promote products derived from this software without
|
||||
+# specific prior written permission.
|
||||
+#
|
||||
+# THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND
|
||||
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
+# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR
|
||||
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
+# SUCH DAMAGE.
|
||||
+
|
||||
+set -e
|
||||
+
|
||||
+output="$(../src/nbdkit --dump-config)"
|
||||
+if [[ ! ( "$output" =~ ^libdir= ) ]]; then
|
||||
+ echo "$0: unexpected output from nbdkit --dump-config"
|
||||
+ echo "$output"
|
||||
+ exit 1
|
||||
+fi
|
||||
diff --git a/tests/test-foreground.sh b/tests/test-foreground.sh
|
||||
new file mode 100755
|
||||
index 0000000..daa733e
|
||||
--- /dev/null
|
||||
+++ b/tests/test-foreground.sh
|
||||
@@ -0,0 +1,80 @@
|
||||
+#!/bin/bash -
|
||||
+# nbdkit
|
||||
+# Copyright (C) 2014 Red Hat Inc.
|
||||
+# All rights reserved.
|
||||
+#
|
||||
+# Redistribution and use in source and binary forms, with or without
|
||||
+# modification, are permitted provided that the following conditions are
|
||||
+# met:
|
||||
+#
|
||||
+# * Redistributions of source code must retain the above copyright
|
||||
+# notice, this list of conditions and the following disclaimer.
|
||||
+#
|
||||
+# * Redistributions in binary form must reproduce the above copyright
|
||||
+# notice, this list of conditions and the following disclaimer in the
|
||||
+# documentation and/or other materials provided with the distribution.
|
||||
+#
|
||||
+# * Neither the name of Red Hat nor the names of its contributors may be
|
||||
+# used to endorse or promote products derived from this software without
|
||||
+# specific prior written permission.
|
||||
+#
|
||||
+# THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND
|
||||
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
+# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR
|
||||
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
+# SUCH DAMAGE.
|
||||
+
|
||||
+set -e
|
||||
+set -x
|
||||
+
|
||||
+# Test nbdkit -f option.
|
||||
+
|
||||
+rm -f foreground.pid foreground.sock
|
||||
+
|
||||
+../src/nbdkit \
|
||||
+ -f -P foreground.pid -U foreground.sock \
|
||||
+ ../plugins/example1/.libs/nbdkit-example1-plugin.so &
|
||||
+bg_pid=$!
|
||||
+
|
||||
+# We may have to wait a short time for the pid file to appear.
|
||||
+for i in `seq 1 10`; do
|
||||
+ if test -f foreground.pid; then
|
||||
+ break
|
||||
+ fi
|
||||
+ sleep 1
|
||||
+done
|
||||
+if ! test -f foreground.pid; then
|
||||
+ echo "$0: PID file was not created"
|
||||
+ exit 1
|
||||
+fi
|
||||
+
|
||||
+pid="$(cat foreground.pid)"
|
||||
+
|
||||
+test "$bg_pid" -eq "$pid"
|
||||
+
|
||||
+# Check the socket was created (and is a socket).
|
||||
+test -S foreground.sock
|
||||
+
|
||||
+# Kill the process.
|
||||
+kill $pid
|
||||
+
|
||||
+# Check the process exits (eventually).
|
||||
+for i in `seq 1 10`; do
|
||||
+ if ! kill -s 0 $pid; then
|
||||
+ break;
|
||||
+ fi
|
||||
+ sleep 1
|
||||
+done
|
||||
+if kill -s 0 $pid; then
|
||||
+ echo "$0: process did not exit after sending a signal"
|
||||
+ exit 1
|
||||
+fi
|
||||
+
|
||||
+rm foreground.pid foreground.sock
|
||||
diff --git a/tests/test-help-plugin.sh b/tests/test-help-plugin.sh
|
||||
new file mode 100755
|
||||
index 0000000..dba1028
|
||||
--- /dev/null
|
||||
+++ b/tests/test-help-plugin.sh
|
||||
@@ -0,0 +1,41 @@
|
||||
+#!/bin/bash -
|
||||
+# nbdkit
|
||||
+# Copyright (C) 2014 Red Hat Inc.
|
||||
+# All rights reserved.
|
||||
+#
|
||||
+# Redistribution and use in source and binary forms, with or without
|
||||
+# modification, are permitted provided that the following conditions are
|
||||
+# met:
|
||||
+#
|
||||
+# * Redistributions of source code must retain the above copyright
|
||||
+# notice, this list of conditions and the following disclaimer.
|
||||
+#
|
||||
+# * Redistributions in binary form must reproduce the above copyright
|
||||
+# notice, this list of conditions and the following disclaimer in the
|
||||
+# documentation and/or other materials provided with the distribution.
|
||||
+#
|
||||
+# * Neither the name of Red Hat nor the names of its contributors may be
|
||||
+# used to endorse or promote products derived from this software without
|
||||
+# specific prior written permission.
|
||||
+#
|
||||
+# THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND
|
||||
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
+# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR
|
||||
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
+# SUCH DAMAGE.
|
||||
+
|
||||
+set -e
|
||||
+
|
||||
+output="$(../src/nbdkit ../plugins/file/.libs/nbdkit-file-plugin.so --help)"
|
||||
+if [[ ! ( "$output" =~ "nbdkit file plugin" ) ]]; then
|
||||
+ echo "$0: unexpected output from nbdkit file --help"
|
||||
+ echo "$output"
|
||||
+ exit 1
|
||||
+fi
|
||||
diff --git a/tests/test-help.sh b/tests/test-help.sh
|
||||
new file mode 100755
|
||||
index 0000000..299480b
|
||||
--- /dev/null
|
||||
+++ b/tests/test-help.sh
|
||||
@@ -0,0 +1,41 @@
|
||||
+#!/bin/bash -
|
||||
+# nbdkit
|
||||
+# Copyright (C) 2014 Red Hat Inc.
|
||||
+# All rights reserved.
|
||||
+#
|
||||
+# Redistribution and use in source and binary forms, with or without
|
||||
+# modification, are permitted provided that the following conditions are
|
||||
+# met:
|
||||
+#
|
||||
+# * Redistributions of source code must retain the above copyright
|
||||
+# notice, this list of conditions and the following disclaimer.
|
||||
+#
|
||||
+# * Redistributions in binary form must reproduce the above copyright
|
||||
+# notice, this list of conditions and the following disclaimer in the
|
||||
+# documentation and/or other materials provided with the distribution.
|
||||
+#
|
||||
+# * Neither the name of Red Hat nor the names of its contributors may be
|
||||
+# used to endorse or promote products derived from this software without
|
||||
+# specific prior written permission.
|
||||
+#
|
||||
+# THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND
|
||||
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
+# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR
|
||||
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
+# SUCH DAMAGE.
|
||||
+
|
||||
+set -e
|
||||
+
|
||||
+output="$(../src/nbdkit --help)"
|
||||
+if [[ ! ( "$output" =~ dump-config ) ]]; then
|
||||
+ echo "$0: unexpected output from nbdkit --help"
|
||||
+ echo "$output"
|
||||
+ exit 1
|
||||
+fi
|
||||
diff --git a/tests/test-single.sh b/tests/test-single.sh
|
||||
new file mode 100755
|
||||
index 0000000..ab0827d
|
||||
--- /dev/null
|
||||
+++ b/tests/test-single.sh
|
||||
@@ -0,0 +1,40 @@
|
||||
+#!/bin/bash -
|
||||
+# nbdkit
|
||||
+# Copyright (C) 2014 Red Hat Inc.
|
||||
+# All rights reserved.
|
||||
+#
|
||||
+# Redistribution and use in source and binary forms, with or without
|
||||
+# modification, are permitted provided that the following conditions are
|
||||
+# met:
|
||||
+#
|
||||
+# * Redistributions of source code must retain the above copyright
|
||||
+# notice, this list of conditions and the following disclaimer.
|
||||
+#
|
||||
+# * Redistributions in binary form must reproduce the above copyright
|
||||
+# notice, this list of conditions and the following disclaimer in the
|
||||
+# documentation and/or other materials provided with the distribution.
|
||||
+#
|
||||
+# * Neither the name of Red Hat nor the names of its contributors may be
|
||||
+# used to endorse or promote products derived from this software without
|
||||
+# specific prior written permission.
|
||||
+#
|
||||
+# THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND
|
||||
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
+# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR
|
||||
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
+# SUCH DAMAGE.
|
||||
+
|
||||
+set -e
|
||||
+set -x
|
||||
+
|
||||
+# Test nbdkit -s option.
|
||||
+# XXX Not sure what is a really good test of this.
|
||||
+
|
||||
+../src/nbdkit -s ../plugins/example1/.libs/nbdkit-example1-plugin.so </dev/null
|
||||
diff --git a/tests/test-start.sh b/tests/test-start.sh
|
||||
new file mode 100755
|
||||
index 0000000..7422040
|
||||
--- /dev/null
|
||||
+++ b/tests/test-start.sh
|
||||
@@ -0,0 +1,81 @@
|
||||
+#!/bin/bash -
|
||||
+# nbdkit
|
||||
+# Copyright (C) 2014 Red Hat Inc.
|
||||
+# All rights reserved.
|
||||
+#
|
||||
+# Redistribution and use in source and binary forms, with or without
|
||||
+# modification, are permitted provided that the following conditions are
|
||||
+# met:
|
||||
+#
|
||||
+# * Redistributions of source code must retain the above copyright
|
||||
+# notice, this list of conditions and the following disclaimer.
|
||||
+#
|
||||
+# * Redistributions in binary form must reproduce the above copyright
|
||||
+# notice, this list of conditions and the following disclaimer in the
|
||||
+# documentation and/or other materials provided with the distribution.
|
||||
+#
|
||||
+# * Neither the name of Red Hat nor the names of its contributors may be
|
||||
+# used to endorse or promote products derived from this software without
|
||||
+# specific prior written permission.
|
||||
+#
|
||||
+# THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND
|
||||
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
+# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR
|
||||
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
+# SUCH DAMAGE.
|
||||
+
|
||||
+set -e
|
||||
+set -x
|
||||
+
|
||||
+# Test nbdkit starts up, forks in the background, writes a PID file,
|
||||
+# and can be killed.
|
||||
+
|
||||
+rm -f start.pid start.sock
|
||||
+
|
||||
+../src/nbdkit \
|
||||
+ -P start.pid -U start.sock \
|
||||
+ ../plugins/example1/.libs/nbdkit-example1-plugin.so
|
||||
+
|
||||
+# We may have to wait a short time for the pid file to appear.
|
||||
+for i in `seq 1 10`; do
|
||||
+ if test -f start.pid; then
|
||||
+ break
|
||||
+ fi
|
||||
+ sleep 1
|
||||
+done
|
||||
+if ! test -f start.pid; then
|
||||
+ echo "$0: PID file was not created"
|
||||
+ exit 1
|
||||
+fi
|
||||
+
|
||||
+pid="$(cat start.pid)"
|
||||
+
|
||||
+# Check the process exists.
|
||||
+kill -s 0 $pid
|
||||
+
|
||||
+# Check the socket was created (and is a socket).
|
||||
+test -S start.sock
|
||||
+
|
||||
+# Kill the process.
|
||||
+kill $pid
|
||||
+
|
||||
+# Check the process exits (eventually).
|
||||
+for i in `seq 1 10`; do
|
||||
+ if ! kill -s 0 $pid; then
|
||||
+ break;
|
||||
+ fi
|
||||
+ sleep 1
|
||||
+done
|
||||
+if kill -s 0 $pid; then
|
||||
+ echo "$0: process did not exit after sending a signal"
|
||||
+ exit 1
|
||||
+fi
|
||||
+
|
||||
+rm start.pid start.sock
|
||||
--
|
||||
1.8.4.2
|
||||
|
151
autotools.patch
151
autotools.patch
@ -1,151 +0,0 @@
|
||||
--- nbdkit-1.1.6.old/tests/Makefile.in 2014-02-16 10:48:53.000000000 +0000
|
||||
+++ nbdkit-1.1.6/tests/Makefile.in 2014-02-21 13:05:58.276307978 +0000
|
||||
@@ -109,34 +109,36 @@
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
+TESTS = test-help.sh test-help-plugin.sh test-dump-config.sh \
|
||||
+ test-start.sh test-foreground.sh test-single.sh \
|
||||
+ test-captive.sh $(am__EXEEXT_5) $(am__EXEEXT_1) \
|
||||
+ $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4)
|
||||
@HAVE_LIBGUESTFS_TRUE@check_PROGRAMS = test-connect$(EXEEXT) \
|
||||
@HAVE_LIBGUESTFS_TRUE@ test-file$(EXEEXT) $(am__EXEEXT_1) \
|
||||
@HAVE_LIBGUESTFS_TRUE@ $(am__EXEEXT_2) $(am__EXEEXT_3) \
|
||||
@HAVE_LIBGUESTFS_TRUE@ $(am__EXEEXT_4)
|
||||
-@HAVE_LIBGUESTFS_TRUE@TESTS = test-connect$(EXEEXT) test-file$(EXEEXT) \
|
||||
-@HAVE_LIBGUESTFS_TRUE@ $(am__EXEEXT_1) $(am__EXEEXT_2) \
|
||||
-@HAVE_LIBGUESTFS_TRUE@ $(am__EXEEXT_3) $(am__EXEEXT_4)
|
||||
-@HAVE_LIBGUESTFS_TRUE@am__append_1 = file-data
|
||||
+@HAVE_LIBGUESTFS_TRUE@am__append_1 = test-connect test-file
|
||||
+@HAVE_LIBGUESTFS_TRUE@am__append_2 = file-data
|
||||
|
||||
# gzip plugin test.
|
||||
-@HAVE_GUESTFISH_TRUE@@HAVE_LIBGUESTFS_TRUE@@HAVE_ZLIB_TRUE@am__append_2 = test-gzip
|
||||
@HAVE_GUESTFISH_TRUE@@HAVE_LIBGUESTFS_TRUE@@HAVE_ZLIB_TRUE@am__append_3 = test-gzip
|
||||
-@HAVE_GUESTFISH_TRUE@@HAVE_LIBGUESTFS_TRUE@@HAVE_ZLIB_TRUE@am__append_4 = disk disk.gz
|
||||
+@HAVE_GUESTFISH_TRUE@@HAVE_LIBGUESTFS_TRUE@@HAVE_ZLIB_TRUE@am__append_4 = test-gzip
|
||||
@HAVE_GUESTFISH_TRUE@@HAVE_LIBGUESTFS_TRUE@@HAVE_ZLIB_TRUE@am__append_5 = disk disk.gz
|
||||
+@HAVE_GUESTFISH_TRUE@@HAVE_LIBGUESTFS_TRUE@@HAVE_ZLIB_TRUE@am__append_6 = disk disk.gz
|
||||
|
||||
# xz plugin test.
|
||||
-@HAVE_GUESTFISH_TRUE@@HAVE_LIBGUESTFS_TRUE@@HAVE_LIBLZMA_TRUE@am__append_6 = test-xz
|
||||
@HAVE_GUESTFISH_TRUE@@HAVE_LIBGUESTFS_TRUE@@HAVE_LIBLZMA_TRUE@am__append_7 = test-xz
|
||||
-@HAVE_GUESTFISH_TRUE@@HAVE_LIBGUESTFS_TRUE@@HAVE_LIBLZMA_TRUE@am__append_8 = disk.xz
|
||||
+@HAVE_GUESTFISH_TRUE@@HAVE_LIBGUESTFS_TRUE@@HAVE_LIBLZMA_TRUE@am__append_8 = test-xz
|
||||
@HAVE_GUESTFISH_TRUE@@HAVE_LIBGUESTFS_TRUE@@HAVE_LIBLZMA_TRUE@am__append_9 = disk.xz
|
||||
+@HAVE_GUESTFISH_TRUE@@HAVE_LIBGUESTFS_TRUE@@HAVE_LIBLZMA_TRUE@am__append_10 = disk.xz
|
||||
|
||||
# perl plugin test.
|
||||
-@HAVE_LIBGUESTFS_TRUE@@HAVE_PERL_TRUE@am__append_10 = test-perl
|
||||
@HAVE_LIBGUESTFS_TRUE@@HAVE_PERL_TRUE@am__append_11 = test-perl
|
||||
+@HAVE_LIBGUESTFS_TRUE@@HAVE_PERL_TRUE@am__append_12 = test-perl
|
||||
|
||||
# python plugin test.
|
||||
-@HAVE_LIBGUESTFS_TRUE@@HAVE_PYTHON_TRUE@am__append_12 = test-python
|
||||
@HAVE_LIBGUESTFS_TRUE@@HAVE_PYTHON_TRUE@am__append_13 = test-python
|
||||
+@HAVE_LIBGUESTFS_TRUE@@HAVE_PYTHON_TRUE@am__append_14 = test-python
|
||||
subdir = tests
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
|
||||
$(top_srcdir)/depcomp $(top_srcdir)/test-driver
|
||||
@@ -471,6 +473,8 @@
|
||||
bases=`echo $$bases`
|
||||
RECHECK_LOGS = $(TEST_LOGS)
|
||||
AM_RECURSIVE_TARGETS = check recheck
|
||||
+@HAVE_LIBGUESTFS_TRUE@am__EXEEXT_5 = test-connect$(EXEEXT) \
|
||||
+@HAVE_LIBGUESTFS_TRUE@ test-file$(EXEEXT)
|
||||
TEST_SUITE_LOG = test-suite.log
|
||||
TEST_EXTENSIONS = @EXEEXT@ .test
|
||||
LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
|
||||
@@ -632,10 +636,22 @@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
CLEANFILES = *~
|
||||
-MAINTAINERCLEANFILES = $(am__append_1) $(am__append_5) $(am__append_9)
|
||||
-EXTRA_DIST = test.pl test.py
|
||||
+MAINTAINERCLEANFILES = $(am__append_2) $(am__append_6) \
|
||||
+ $(am__append_10)
|
||||
+EXTRA_DIST = \
|
||||
+ test-captive.sh \
|
||||
+ test-dump-config.sh \
|
||||
+ test-foreground.sh \
|
||||
+ test-help.sh \
|
||||
+ test-help-plugin.sh \
|
||||
+ test.pl \
|
||||
+ test.py \
|
||||
+ test-single.sh \
|
||||
+ test-start.sh
|
||||
|
||||
-# Tests need libguestfs, since that is a convenient way to drive qemu.
|
||||
+
|
||||
+# In-depth tests need libguestfs, since that is a convenient way to
|
||||
+# drive qemu.
|
||||
|
||||
# Use the 'direct' backend, and ensure maximum libguestfs debugging is
|
||||
# written to the *.log files in case there is a problem.
|
||||
@@ -649,8 +665,8 @@
|
||||
@HAVE_LIBGUESTFS_TRUE@check_LTLIBRARIES = libtest.la
|
||||
@HAVE_LIBGUESTFS_TRUE@libtest_la_SOURCES = test.c test.h
|
||||
@HAVE_LIBGUESTFS_TRUE@libtest_la_CFLAGS = $(WARNINGS_CFLAGS)
|
||||
-@HAVE_LIBGUESTFS_TRUE@check_DATA = file-data $(am__append_4) \
|
||||
-@HAVE_LIBGUESTFS_TRUE@ $(am__append_8)
|
||||
+@HAVE_LIBGUESTFS_TRUE@check_DATA = file-data $(am__append_5) \
|
||||
+@HAVE_LIBGUESTFS_TRUE@ $(am__append_9)
|
||||
@HAVE_LIBGUESTFS_TRUE@test_connect_SOURCES = test-connect.c test.h
|
||||
@HAVE_LIBGUESTFS_TRUE@test_connect_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
|
||||
@HAVE_LIBGUESTFS_TRUE@test_connect_LDADD = libtest.la $(LIBGUESTFS_LIBS)
|
||||
@@ -1082,6 +1098,55 @@
|
||||
am__force_recheck=am--force-recheck \
|
||||
TEST_LOGS="$$log_list"; \
|
||||
exit $$?
|
||||
+test-help.sh.log: test-help.sh
|
||||
+ @p='test-help.sh'; \
|
||||
+ b='test-help.sh'; \
|
||||
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
|
||||
+ --log-file $$b.log --trs-file $$b.trs \
|
||||
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
|
||||
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
+test-help-plugin.sh.log: test-help-plugin.sh
|
||||
+ @p='test-help-plugin.sh'; \
|
||||
+ b='test-help-plugin.sh'; \
|
||||
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
|
||||
+ --log-file $$b.log --trs-file $$b.trs \
|
||||
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
|
||||
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
+test-dump-config.sh.log: test-dump-config.sh
|
||||
+ @p='test-dump-config.sh'; \
|
||||
+ b='test-dump-config.sh'; \
|
||||
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
|
||||
+ --log-file $$b.log --trs-file $$b.trs \
|
||||
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
|
||||
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
+test-start.sh.log: test-start.sh
|
||||
+ @p='test-start.sh'; \
|
||||
+ b='test-start.sh'; \
|
||||
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
|
||||
+ --log-file $$b.log --trs-file $$b.trs \
|
||||
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
|
||||
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
+test-foreground.sh.log: test-foreground.sh
|
||||
+ @p='test-foreground.sh'; \
|
||||
+ b='test-foreground.sh'; \
|
||||
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
|
||||
+ --log-file $$b.log --trs-file $$b.trs \
|
||||
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
|
||||
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
+test-single.sh.log: test-single.sh
|
||||
+ @p='test-single.sh'; \
|
||||
+ b='test-single.sh'; \
|
||||
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
|
||||
+ --log-file $$b.log --trs-file $$b.trs \
|
||||
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
|
||||
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
+test-captive.sh.log: test-captive.sh
|
||||
+ @p='test-captive.sh'; \
|
||||
+ b='test-captive.sh'; \
|
||||
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
|
||||
+ --log-file $$b.log --trs-file $$b.trs \
|
||||
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
|
||||
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
test-connect.log: test-connect$(EXEEXT)
|
||||
@p='test-connect$(EXEEXT)'; \
|
||||
b='test-connect'; \
|
20
nbdkit.spec
20
nbdkit.spec
@ -5,20 +5,14 @@
|
||||
%endif
|
||||
|
||||
Name: nbdkit
|
||||
Version: 1.1.6
|
||||
Release: 5%{?dist}
|
||||
Version: 1.1.7
|
||||
Release: 1%{?dist}
|
||||
Summary: NBD server
|
||||
|
||||
License: BSD
|
||||
URL: https://github.com/libguestfs/nbdkit
|
||||
Source0: http://libguestfs.org/download/nbdkit/%{name}-%{version}.tar.gz
|
||||
|
||||
# Upstream patches, fixing a minor bug and adding more tests.
|
||||
Patch1: 0001-Don-t-pass-NULL-pointer-to-asprintf-when-generating-.patch
|
||||
Patch2: 0002-tests-Test-the-nbdkit-command-line-more-thoroughly.patch
|
||||
# Patch automake crap resulting from changes above.
|
||||
Patch3: autotools.patch
|
||||
|
||||
BuildRequires: /usr/bin/pod2man
|
||||
%if 0%{?have_libguestfs}
|
||||
BuildRequires: libguestfs-devel
|
||||
@ -161,12 +155,6 @@ plugins for %{name}.
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
# Grrr 'patch' doesn't restore permissions:
|
||||
chmod +x tests/*.sh
|
||||
|
||||
|
||||
%build
|
||||
# Force immediate binding for hardened build for plugins.
|
||||
@ -264,6 +252,10 @@ make check
|
||||
|
||||
|
||||
%changelog
|
||||
* Fri Jun 20 2014 Richard W.M. Jones <rjones@redhat.com> - 1.1.7-1
|
||||
- New upstream version 1.1.7.
|
||||
- Remove patches which are now all upstream.
|
||||
|
||||
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.6-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user