Displaying 15 results from an estimated 15 matches for "foreach_plugin".
2018 Sep 11
0
[PATCH nbdkit 3/4] tests: Move common code for testing every plugin to tests/functions.sh.
...right (C) 2017-2018 Red Hat Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -30,6 +32,19 @@
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
-# Some functions used by the tests.
-
-# (Currently empty)
+# foreach_plugin f
+#
+# For each plugin that was built, call test function f with the plugin
+# name as argument.
+foreach_plugin ()
+{
+ for p in @plugins@; do
+ # Was the plugin built?
+ d=@top_builddir@/plugins/$p
+ if [ -f $d/.libs/nbdkit-$p-plugin.so ] ||
+ [ -f $d/nbdkit-$p-...
2018 Sep 13
0
[PATCH v2 nbdkit 3/5] tests: Move common code for testing every plugin to tests/functions.sh.
...right (C) 2017-2018 Red Hat Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -30,6 +32,19 @@
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
-# Some functions used by the tests.
-
-# (Currently empty)
+# foreach_plugin f
+#
+# For each plugin that was built, call test function f with the plugin
+# name as argument.
+foreach_plugin ()
+{
+ for p in @plugins@; do
+ # Was the plugin built?
+ d="@top_builddir@/plugins/$p"
+ if [ -f "$d/.libs/nbdkit-$p-plugin.so" ] ||
+...
2018 Sep 13
1
Re: [PATCH v2 nbdkit 3/5] tests: Move common code for testing every plugin to tests/functions.sh.
...ctly from configure.ac instead of needing to use weird shell
> script, although we still need to preserve the test that the plugin
> was built so that the tests continue to work if a plugin is disabled
> or not built through missing dependencies.
> ---
> -# (Currently empty)
> +# foreach_plugin f
> +#
> +# For each plugin that was built, call test function f with the plugin
> +# name as argument.
Possible improvement - allow callers to pass parameters, as in:
foreach_plugin f arg1 arg2
> +foreach_plugin ()
> +{
f=$1; shift
> + for p in @plugins@; do
> +...
2018 Sep 11
1
Re: [PATCH nbdkit 3/4] tests: Move common code for testing every plugin to tests/functions.sh.
...++++++++----
> tests/test-dump-plugin.sh | 19 ++++++++-----------
> tests/test-help.sh | 18 ++++++++----------
> tests/test-version.sh | 18 ++++++++----------
> 7 files changed, 45 insertions(+), 36 deletions(-)
>
> +# foreach_plugin f
> +#
> +# For each plugin that was built, call test function f with the plugin
> +# name as argument.
> +foreach_plugin ()
> +{
> + for p in @plugins@; do
> + # Was the plugin built?
> + d=@top_builddir@/plugins/$p
> + if [ -f $d/.libs/nbdkit-$p-...
2020 Mar 20
2
[nbdkit PATCH] tests: Don't strand hung nbdkit processes
...leep 1
+ done
+ # If nbdkit has not exited, try SIGKILL and fail the test
+ if test $i = 60; then
+ echo "error: nbdkit pid $pid failed to respond to SIGTERM"
+ kill -9 $pid
+ # Append our failure after other cleanups
+ cleanup_fn exit 1
+ fi
}
# foreach_plugin f [args]
--
2.25.1
2018 Sep 11
7
[PATCH nbdkit 0/4] tests: Move common functions into tests/functions.sh
Combine much common code into tests/functions.sh.
Patch 1: Preparation for patch 3.
Patch 2: Fix a long-standing bug in how man pages links are generated.
Patch 3: Common code for iterating a test function over every plugin.
Patch 4: Common code for starting nbdkit in a test and waiting for the
PID file to appear. This is the largest and most complex of
the patches but is
2018 Sep 13
8
[PATCH v2 nbdkit 0/5] tests: Move common functions into tests/functions.sh
...e:
https://www.redhat.com/archives/libguestfs/2018-September/msg00057.html
v2:
- Fix tab vs spaces in configure.ac.
- To generate list of plugins, use printf instead of xargs.
- Use 'source ./functions.sh' instead of 'source functions'.
- functions.sh: Consistent quoting in foreach_plugin function.
- functions.sh: Change the contract of start_nbdkit so it requires
(and checks that) the first two parameters are '-P pidfile'. This
avoids needing to iterate over the arguments.
- functions.sh: Use {1..10} instead of seq.
- functions.sh: Add a common mechanism for ha...
2019 Aug 02
0
[nbdkit PATCH v2 15/17] sh: Enable parallel thread model, when possible
...-nbd.sh \
+ test-parallel-sh.sh \
$(NULL)
# Most in-depth tests need libguestfs, since that is a convenient way to
diff --git a/tests/test-dump-plugin.sh b/tests/test-dump-plugin.sh
index 982d5062..8f02f659 100755
--- a/tests/test-dump-plugin.sh
+++ b/tests/test-dump-plugin.sh
@@ -72,8 +72,9 @@ foreach_plugin do_test
# Test that --dump-plugin can be used to introspect a resulting dynamic
# thread model.
out=$({
- # sh does not yet support parallel
- nbdkit --dump-plugin sh
+ # Here, thread_model depends on atomic CLOEXEC support
+ nbdkit --dump-plugin sh | \
+ sed 's/^thread_mo...
2019 Aug 02
2
Re: [nbdkit PATCH v2 15/17] sh: Enable parallel thread model, when possible
...$(NULL)
>
> # Most in-depth tests need libguestfs, since that is a convenient way to
> diff --git a/tests/test-dump-plugin.sh b/tests/test-dump-plugin.sh
> index 982d5062..8f02f659 100755
> --- a/tests/test-dump-plugin.sh
> +++ b/tests/test-dump-plugin.sh
> @@ -72,8 +72,9 @@ foreach_plugin do_test
> # Test that --dump-plugin can be used to introspect a resulting dynamic
> # thread model.
> out=$({
> - # sh does not yet support parallel
> - nbdkit --dump-plugin sh
> + # Here, thread_model depends on atomic CLOEXEC support
> + nbdkit --dump-plugin sh...
2018 Sep 13
0
[PATCH v2 nbdkit 4/5] tests: Use a generic cleanup mechanism instead of explicit trap.
...{
+ status=$?
+ set +e
+ trap '' INT QUIT TERM EXIT ERR
+ echo $0: run cleanup hooks: exit code $status
+
+ for (( i = 0; i < ${#_cleanup_hook[@]}; ++i )); do
+ ${_cleanup_hook[i]}
+ done
+
+ exit $status
+}
+trap _run_cleanup_hooks INT QUIT TERM EXIT ERR
+
# foreach_plugin f
#
# For each plugin that was built, call test function f with the plugin
diff --git a/tests/test-blocksize.sh b/tests/test-blocksize.sh
index cb9b09f..21b55b9 100755
--- a/tests/test-blocksize.sh
+++ b/tests/test-blocksize.sh
@@ -31,6 +31,7 @@
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF...
2019 Aug 02
23
[nbdkit PATCH v2 00/17] fd leak safety
This is a major rewrite compared to my v1 series, where I've tried
a lot harder to ensure that we still accommodate building on Haiku
(although I have not actually yet fired up a Haiku VM to try it
for myself). I also managed to make the sh plugin fully parallel,
on capable platforms.
See also my question on patch 10 on whether I've picked the best
naming convention.
Eric Blake (17):
2018 Sep 11
0
[PATCH nbdkit 4/4] tests: Add a helper function which waits for nbdkit to start up.
...to appear.
+ for i in `seq 1 10`; do
+ if test -f "$pidfile"; then
+ break
+ fi
+ sleep 1
+ done
+ if ! test -f "$pidfile"; then
+ echo "$0: start_nbdkit: PID file $pidfile was not created"
+ exit 1
+ fi
+}
+
# foreach_plugin f
#
# For each plugin that was built, call test function f with the plugin
diff --git a/tests/test-blocksize.sh b/tests/test-blocksize.sh
index cb9b09f..3fe3723 100755
--- a/tests/test-blocksize.sh
+++ b/tests/test-blocksize.sh
@@ -31,6 +31,7 @@
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF...
2018 Sep 13
0
[PATCH v2 nbdkit 5/5] tests: Add a helper function which waits for nbdkit to start up.
...;; then
+ break
+ fi
+ sleep 1
+ done
+ if ! test -f "$pidfile"; then
+ echo "$0: start_nbdkit: PID file $pidfile was not created"
+ exit 1
+ fi
+
+ # Kill nbdkit on exit.
+ cleanup_fn kill "$(cat $pidfile)"
+}
+
# foreach_plugin f
#
# For each plugin that was built, call test function f with the plugin
diff --git a/tests/test-blocksize.sh b/tests/test-blocksize.sh
index 21b55b9..aa3cc13 100755
--- a/tests/test-blocksize.sh
+++ b/tests/test-blocksize.sh
@@ -50,14 +50,10 @@ if ! qemu-io -f raw -c 'r 0 1' -c 'w...
2020 Mar 26
15
[PATCH nbdkit 0/9] Create libnbdkit.so
This creates libnbdkit.so as discussed in the following thread:
https://www.redhat.com/archives/libguestfs/2020-March/thread.html#00203
test-delay-shutdown.sh fails for unclear reasons.
This series starts by reverting "tests: Don't strand hung nbdkit
processes" which is because several other tests fail randomly unless I
revert this patch. I didn't investigate this yet so it
2020 Aug 20
15
[PATCH nbdkit 0/13] Port to Windows without using a separate library.
Also available here:
https://github.com/rwmjones/nbdkit/tree/2020-windows-mingw-nolib
After a lot of work I have made the port to Windows work without using
a separate library. Instead, on Windows only, we build an "import
library" (library of stubs) which resolves references to nbdkit_*
functions in the main program and fixes up the plugin, basically the
first technique outlined in