2 # Copyright (C) 2013-2019 Red Hat Inc.
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are
8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
11 # * Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
15 # * Neither the name of Red Hat nor the names of its contributors may be
16 # used to endorse or promote products derived from this software without
17 # specific prior written permission.
19 # THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND
20 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21 # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR
23 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26 # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29 # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 include $(top_srcdir)/common-rules.mk
34 #----------------------------------------------------------------------
35 # This directory contains most of the nbdkit tests.
39 # TESTS Tests that don't have any special requirements.
41 # LIBNBD_TESTS Tests that link to the libnbd C library should be
42 # added to this variable.
44 # LIBGUESTFS_TESTS Tests that link to libguestfs C library should be
45 # added to this variable.
47 # check_*, noinst_*, EXTRA_PROGRAMS: These are the usual automake
48 # variables. Consult the automake manual for the meaning of these.
61 # Ensure we're testing the local copy by running everything through
62 # the nbdkit helper script in the top build directory.
64 # Use the 'direct' backend, and ensure maximum libguestfs debugging.
66 # Enable libnbd debugging.
68 PATH=$(abs_top_builddir):$(PATH) \
71 LIBGUESTFS_ATTACH_METHOD=appliance \
77 # All files that need to go into the tarball must be added here.
79 generate-file-data.sh \
91 test-cache-max-size.sh \
92 test-cache-on-read.sh \
93 test-cacheextents.sh \
100 test-data-extents.sh \
103 test-debug-flags.sh \
104 test-dump-config.sh \
105 test-dump-plugin.sh \
106 test-dump-plugin-example4.sh \
111 test-error-triggered.sh \
113 test-export-name.sh \
114 test-file-extents.sh \
120 test-help-plugin.sh \
121 test-info-address.sh \
122 test-info-base64.sh \
125 test-info-uptime.sh \
126 test-info-conntime.sh \
132 test-linuxdisk-copy-out.sh \
136 test-memory-largest.sh \
137 test-memory-largest-for-qemu.sh \
138 test-nbd-extents.sh \
140 test-nbd-tls-psk.sh \
141 test-nbdkit-backend-debug.sh \
144 test-null-extents.sh \
145 test_ocaml_plugin.ml \
148 test-offset-extents.sh \
149 test-parallel-file.sh \
150 test-parallel-nbd.sh \
151 test-parallel-sh.sh \
154 test-partitioning1.sh \
155 test-partitioning2.sh \
156 test-partitioning3.sh \
157 test-partitioning4.sh \
158 test-partitioning5.sh \
159 test-partitioning6.sh \
161 test-pattern-largest.sh \
162 test-pattern-largest-for-qemu.sh \
163 test-python-exception.sh \
166 test-python-plugin.py \
169 test-rate-dynamic.sh \
172 test-readahead-copy.sh \
173 test-readahead-test-plugin.sh \
174 test-readahead-test-request.py \
176 test-retry-extents.sh \
178 test-retry-readonly.sh \
179 test-retry-reopen-fail.sh \
180 test-retry-zero-flags.sh \
185 test-shebang-perl.sh \
186 test-shebang-python.sh \
187 test-shebang-ruby.sh \
192 test-single-from-file.sh \
194 test-random-sock.sh \
201 test-truncate-extents.sh \
205 test-version-filter.sh \
206 test-version-plugin.sh \
210 #----------------------------------------------------------------------
211 # Use 'make check' to run the ordinary tests as non-root. The
212 # following are special commands for particular scenarios:
214 # To run all the tests under valgrind, use the following rule:
216 NBDKIT_VALGRIND=1 $(MAKE) check
218 # To run only tests which require root, use:
220 $(MAKE) check TESTS="test-file-block test-swap.sh"
223 # Run a basic check against a real copy of VDDK. You must set
224 # vddkdir to point to the library location, eg:
226 # make check-vddk vddkdir=vmware-vix-disklib-distrib
228 $(MAKE) check TESTS=test-vddk-real.sh
231 #----------------------------------------------------------------------
232 # Basic server command line and start-up tests.
237 test-dump-config.sh \
243 test-help-plugin.sh \
244 test-version-plugin.sh \
245 test-version-filter.sh \
246 test-dump-plugin.sh \
249 test-single-from-file.sh \
251 test-random-sock.sh \
255 test-socket-activation \
257 test-debug-flags.sh \
263 test-socket-activation \
266 test_socket_activation_SOURCES = test-socket-activation.c
267 test_socket_activation_CPPFLAGS = \
268 -I$(top_srcdir)/common/include \
269 -I$(top_srcdir)/common/protocol \
271 test_socket_activation_CFLAGS = $(WARNINGS_CFLAGS)
275 # Test the header files can be included on their own.
277 test-just-plugin-header \
278 test-just-filter-header
281 test-just-plugin-header \
282 test-just-filter-header
285 test_just_plugin_header_SOURCES = \
286 test-just-plugin-header.c \
288 test_just_plugin_header_CPPFLAGS = \
289 -I$(top_srcdir)/include \
291 test_just_plugin_header_CFLAGS = $(WARNINGS_CFLAGS)
293 test_just_filter_header_SOURCES = \
294 test-just-filter-header.c \
296 test_just_filter_header_CPPFLAGS = \
297 -I$(top_srcdir)/include \
299 test_just_filter_header_CFLAGS = $(WARNINGS_CFLAGS)
302 # This builds a plugin using an ANSI (ISO C90) compiler to ensure that
303 # the header file is compatible. The plugin does nothing very
304 # interesting, it's mainly a compile test.
308 # check_LTLIBRARIES won't build a shared library (see automake manual).
309 # So we have to do this and add a dependency.
310 noinst_LTLIBRARIES += test-ansi-c-plugin.la
311 test-ansi-c.sh: test-ansi-c-plugin.la
313 test_ansi_c_plugin_la_SOURCES = \
314 test-ansi-c-plugin.c \
315 $(top_srcdir)/include/nbdkit-plugin.h \
317 test_ansi_c_plugin_la_CPPFLAGS = \
319 -I$(top_srcdir)/include \
321 test_ansi_c_plugin_la_CFLAGS = $(WARNINGS_CFLAGS)
322 # For use of the -rpath option, see:
323 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
324 test_ansi_c_plugin_la_LDFLAGS = \
325 -module -avoid-version -shared -rpath /nowhere \
327 endif CAN_TEST_ANSI_C
330 # This builds a plugin and a filter using the C++ compiler. They
331 # don't do anything interesting when run.
335 # check_LTLIBRARIES won't build a shared library (see automake manual).
336 # So we have to do this and add a dependency.
337 noinst_LTLIBRARIES += test-cxx-plugin.la test-cxx-filter.la
338 test-cxx.sh: test-cxx-plugin.la test-cxx-filter.la
340 test_cxx_plugin_la_SOURCES = \
341 test-cxx-plugin.cpp \
342 $(top_srcdir)/include/nbdkit-plugin.h \
344 test_cxx_plugin_la_CPPFLAGS = \
345 -I$(top_srcdir)/include \
347 test_cxx_plugin_la_CXXFLAGS = $(WARNINGS_CFLAGS)
348 # For use of the -rpath option, see:
349 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
350 test_cxx_plugin_la_LDFLAGS = \
351 -module -avoid-version -shared -rpath /nowhere \
354 test_cxx_filter_la_SOURCES = \
355 test-cxx-filter.cpp \
356 $(top_srcdir)/include/nbdkit-filter.h \
358 test_cxx_filter_la_CPPFLAGS = \
359 -I$(top_srcdir)/include \
361 test_cxx_filter_la_CXXFLAGS = $(WARNINGS_CFLAGS)
362 # For use of the -rpath option, see:
363 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
364 test_cxx_filter_la_LDFLAGS = \
365 -module -avoid-version -shared -rpath /nowhere \
369 # Exit with parent test.
370 check_PROGRAMS += test-exit-with-parent
371 TESTS += test-exit-with-parent
373 test_exit_with_parent_SOURCES = \
374 test-exit-with-parent.c test.h \
376 test_exit_with_parent_CPPFLAGS = \
377 -I$(top_srcdir)/common/include \
379 test_exit_with_parent_CFLAGS = \
381 $(LIBGUESTFS_CFLAGS) \
384 # PKI files for the TLS tests.
385 check_DATA += pki/.stamp
386 pki/.stamp: $(srcdir)/make-pki.sh
387 SRCDIR=$(srcdir) $(srcdir)/make-pki.sh
389 # PSK keys for the TLS-PSK tests.
390 check_DATA += keys.psk
391 keys.psk: $(srcdir)/make-psk.sh
392 SRCDIR=$(srcdir) $(srcdir)/make-psk.sh
394 # Keys are expensive to recreate so only delete them when we do
395 # ‘make distclean’.
396 DISTCLEANFILES = keys.psk
397 distclean-local: distclean-local-tls
401 #----------------------------------------------------------------------
402 # Tests of C plugins or tests which require plugins.
406 # Common data shared by multiple tests
407 check_DATA += file-data
408 CLEANFILES += file-data
409 file-data: generate-file-data.sh
410 $(srcdir)/generate-file-data.sh $@
412 # While most tests need libguestfs, testing parallel I/O is easier when
413 # using qemu-io to kick off asynchronous requests.
415 test-parallel-file.sh \
416 test-parallel-nbd.sh \
417 test-parallel-sh.sh \
420 # Common test library.
421 check_LTLIBRARIES += libtest.la
422 libtest_la_SOURCES = test.c test.h
423 libtest_la_CFLAGS = $(WARNINGS_CFLAGS)
425 # Basic connection test.
426 LIBNBD_TESTS += test-connect
428 test_connect_SOURCES = test-connect.c
429 test_connect_CFLAGS = $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS)
430 test_connect_LDADD = $(LIBNBD_LIBS)
432 # newstyle protocol test.
433 LIBNBD_TESTS += test-newstyle
435 test_newstyle_SOURCES = test-newstyle.c
436 test_newstyle_CFLAGS = $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS)
437 test_newstyle_LDADD = $(LIBNBD_LIBS)
439 # oldstyle protocol test.
440 LIBNBD_TESTS += test-oldstyle
442 test_oldstyle_SOURCES = test-oldstyle.c
443 test_oldstyle_CFLAGS = $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS)
444 test_oldstyle_LDADD = $(LIBNBD_LIBS)
447 TESTS += test-eflags.sh
450 TESTS += test-export-name.sh
452 # common disk image shared with several tests
457 rm -rf disk.tmp $@ $@-t
459 echo -n "hello,world" > disk.tmp/hello.txt
460 $(top_builddir)/nbdkit -fv -U - linuxdisk disk.tmp size=100M \
461 --run 'qemu-img convert $$nbd $@-t'
467 LIBGUESTFS_TESTS += test-curl
469 test_curl_SOURCES = \
475 test_curl_CPPFLAGS = \
476 -I$(top_srcdir)/common/utils
479 $(LIBGUESTFS_CFLAGS) \
482 test_curl_LDFLAGS = \
483 $(top_builddir)/common/utils/libutils.la \
493 LIBGUESTFS_TESTS += test-data
496 test-data-base64.sh \
497 test-data-extents.sh \
502 test_data_SOURCES = test-data.c test.h
503 test_data_CPPFLAGS = -I$(top_srcdir)/common/include
504 test_data_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
505 test_data_LDADD = libtest.la $(LIBGUESTFS_LIBS)
508 TESTS += test-eval.sh
514 LIBGUESTFS_TESTS += test-ext2
515 check_DATA += ext2.img
516 CLEANFILES += ext2.img
523 mkfs ext4 /dev/sda : \
526 upload $< /disks/disk.img
529 test_ext2_SOURCES = test-ext2.c test.h
530 test_ext2_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
531 test_ext2_LDADD = libtest.la $(LIBGUESTFS_LIBS)
537 LIBNBD_TESTS += test-file
538 LIBGUESTFS_TESTS += test-file-block
540 test_file_SOURCES = test-file.c
541 test_file_CFLAGS = $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS)
542 test_file_LDADD = $(LIBNBD_LIBS)
544 test_file_block_SOURCES = test-file-block.c test.h
545 test_file_block_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
546 test_file_block_LDADD = libtest.la $(LIBGUESTFS_LIBS)
548 TESTS += test-file-extents.sh
550 # floppy plugin test.
551 TESTS += test-floppy.sh
554 TESTS += test-full.sh
558 LIBGUESTFS_TESTS += test-gzip
559 check_DATA += disk.gz
560 CLEANFILES += disk.gz
562 test_gzip_SOURCES = test-gzip.c test.h
563 test_gzip_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
564 test_gzip_LDADD = libtest.la $(LIBGUESTFS_LIBS)
573 test-info-address.sh \
574 test-info-base64.sh \
577 test-info-uptime.sh \
578 test-info-conntime.sh \
586 # linuxdisk plugin test.
589 test-linuxdisk-copy-out.sh \
592 # memory plugin test.
593 LIBGUESTFS_TESTS += test-memory
594 TESTS += test-memory-largest.sh test-memory-largest-for-qemu.sh
596 test_memory_SOURCES = test-memory.c test.h
597 test_memory_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
598 test_memory_LDADD = libtest.la $(LIBGUESTFS_LIBS)
600 # partitioning plugin test.
602 test-partitioning1.sh \
603 test-partitioning2.sh \
604 test-partitioning3.sh \
605 test-partitioning4.sh \
606 test-partitioning5.sh \
607 test-partitioning6.sh \
610 # pattern plugin test.
613 test-pattern-largest.sh \
614 test-pattern-largest-for-qemu.sh \
619 LIBGUESTFS_TESTS += test-nbd
621 test-nbd-extents.sh \
623 test-nbd-tls-psk.sh \
626 test_nbd_SOURCES = test-nbd.c test.h
627 test_nbd_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
628 test_nbd_LDADD = libtest.la $(LIBGUESTFS_LIBS)
629 endif HAVE_NBD_PLUGIN
632 LIBNBD_TESTS += test-null
633 TESTS += test-null-extents.sh
635 test_null_SOURCES = test-null.c
636 test_null_CFLAGS = $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS)
637 test_null_LDADD = $(LIBNBD_LIBS)
639 # random plugin test.
640 LIBNBD_TESTS += test-random
642 test_random_SOURCES = test-random.c
643 test_random_CPPFLAGS = -I $(top_srcdir)/common/include
644 test_random_CFLAGS = $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS)
645 test_random_LDADD = $(LIBNBD_LIBS)
647 # split files plugin test.
648 check_DATA += split1 split2 split3
649 CLEANFILES += split1 split2 split3
652 dd if=$< of=$@-t bs=1 count=100
656 dd if=$< of=$@-t bs=1 count=100 skip=100
660 dd if=$< of=$@-t bs=1 skip=200
662 LIBNBD_TESTS += test-split
664 test_split_SOURCES = test-split.c
665 test_split_CFLAGS = $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS)
666 test_split_LDADD = $(LIBNBD_LIBS)
670 # Uses ‘disk’ so we have to make it conditional on guestfish.
674 ssh/ssh_host_rsa_key ssh/ssh_host_rsa_key.pub \
675 ssh/authorized_keys \
677 SSH_RANDOM_PORT := $(shell bash -c 'echo $$(( 10000 + $$RANDOM ))')
681 ssh/authorized_keys \
684 ssh/ssh_host_rsa_key ssh/ssh_host_rsa_key.pub \
685 ssh/id_rsa ssh/id_rsa.pub \
686 stamp-ssh-host-key stamp-ssh-user-key \
689 ssh/sshd_config: ssh/sshd_config.in Makefile
692 -e 's,__abs_builddir__,$(abs_builddir),g' \
693 -e 's,__RANDOM_PORT__,$(SSH_RANDOM_PORT),g' \
697 ssh/ssh_host_rsa_key ssh/ssh_host_rsa_key.pub: stamp-ssh-host-key
700 rm -f ssh/ssh_host_rsa_key
701 rm -f ssh/ssh_host_rsa_key.pub
702 ssh-keygen -t rsa -f ssh/ssh_host_rsa_key -N ''
705 ssh/authorized_keys: ssh/id_rsa.pub
710 ssh/id_rsa ssh/id_rsa.pub: stamp-ssh-user-key
715 ssh-keygen -t rsa -f ssh/id_rsa -N ''
719 # streaming plugin test.
721 LIBNBD_TESTS += test-streaming
723 test_streaming_SOURCES = test-streaming.c
724 test_streaming_CFLAGS = $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS)
725 test_streaming_LDADD = $(LIBNBD_LIBS)
729 # This only tests that the plugin can be loaded against a
730 # dummy VDDK library, it is not a detailed test.
732 # check_LTLIBRARIES won't build a shared library (see automake manual).
733 # So we have to do this and add a dependency.
734 noinst_LTLIBRARIES += libvixDiskLib.la
740 libvixDiskLib_la_SOURCES = \
743 libvixDiskLib_la_CPPFLAGS = \
744 -I$(top_srcdir)/plugins/vddk \
746 libvixDiskLib_la_CXXFLAGS = $(WARNINGS_CFLAGS)
747 # For use of the -rpath option, see:
748 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
749 libvixDiskLib_la_LDFLAGS = \
750 -shared -version-number 6:0:0 -rpath /nowhere \
755 TESTS += test-zero.sh
757 # -D nbdkit.backend.* settings.
758 TESTS += test-nbdkit-backend-debug.sh
760 #----------------------------------------------------------------------
761 # Tests of language plugins.
766 LIBGUESTFS_TESTS += test-ocaml
768 # This is somewhat different from the other tests because we have
769 # to build an actual plugin here.
770 test_ocaml_SOURCES = test-ocaml.c test.h
771 test_ocaml_CFLAGS = \
773 $(LIBGUESTFS_CFLAGS) \
775 test_ocaml_LDADD = libtest.la $(LIBGUESTFS_LIBS)
777 check_SCRIPTS += test-ocaml-plugin.so
778 test-ocaml-plugin.so: test_ocaml_plugin.cmx ../plugins/ocaml/libnbdkitocaml.la ../plugins/ocaml/NBDKit.cmi ../plugins/ocaml/NBDKit.cmx
779 $(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../plugins/ocaml \
780 -output-obj -runtime-variant _pic -o $@ \
782 -cclib -L../plugins/ocaml/.libs -cclib -lnbdkitocaml
783 test_ocaml_plugin.cmx: test_ocaml_plugin.ml ../plugins/ocaml/NBDKit.cmi
784 $(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../plugins/ocaml -c $< -o $@
792 test-dump-plugin-example4.sh \
793 test-shebang-perl.sh \
795 LIBGUESTFS_TESTS += test-perl
797 test_perl_SOURCES = test-lang-plugins.c test.h
799 -DLANG='"perl"' -DSCRIPT='"$(srcdir)/test.pl"' \
801 $(LIBGUESTFS_CFLAGS) \
803 test_perl_LDADD = libtest.la $(LIBGUESTFS_LIBS)
807 # python plugin test.
812 test-python-exception.sh \
813 test-shebang-python.sh \
821 # Ruby tests are disabled. See "WARNING" section in
822 # plugins/ruby/nbdkit-ruby-plugin.pod
824 #LIBGUESTFS_TESTS += \
827 #TESTS += test-shebang-ruby.sh
828 EXTRA_PROGRAMS += test-ruby
830 test_ruby_SOURCES = test-lang-plugins.c test.h
832 -DLANG='"ruby"' -DSCRIPT='"$(srcdir)/test.rb"' \
834 $(LIBGUESTFS_CFLAGS) \
836 test_ruby_LDADD = libtest.la $(LIBGUESTFS_LIBS)
840 # Shell (sh) plugin test.
841 LIBGUESTFS_TESTS += test-shell
842 check_DATA += test-shell.img
843 CLEANFILES += test-shell.img
845 test_shell_SOURCES = test-lang-plugins.c test.h
846 test_shell_CFLAGS = \
847 -DLANG='"sh"' -DSCRIPT='"$(srcdir)/test-shell.sh"' \
849 $(LIBGUESTFS_CFLAGS) \
851 test_shell_LDADD = libtest.la $(LIBGUESTFS_LIBS)
854 truncate -s 1048576 $@
864 LIBGUESTFS_TESTS += test-tcl
866 test_tcl_SOURCES = test-lang-plugins.c test.h
868 -DLANG='"tcl"' -DSCRIPT='"$(srcdir)/test.tcl"' \
870 $(LIBGUESTFS_CFLAGS) \
872 test_tcl_LDADD = libtest.la $(LIBGUESTFS_LIBS)
879 LIBGUESTFS_TESTS += test-lua
881 test_lua_SOURCES = test-lang-plugins.c test.h
883 -DLANG='"lua"' -DSCRIPT='"$(srcdir)/test.lua"' \
885 $(LIBGUESTFS_CFLAGS) \
887 test_lua_LDADD = libtest.la $(LIBGUESTFS_LIBS)
891 #----------------------------------------------------------------------
894 # Generic test of filter layers.
895 check_PROGRAMS += test-layers
896 TESTS += test-layers.sh test-layers
898 test_layers_SOURCES = \
901 test_layers_CPPFLAGS = \
902 -I$(top_srcdir)/common/include \
903 -I$(top_srcdir)/common/protocol \
904 -I$(top_srcdir)/common/utils \
905 -I$(top_srcdir)/server \
907 test_layers_CFLAGS = \
911 test_layers_LDFLAGS = \
914 test_layers_LDADD = \
915 $(top_builddir)/common/utils/libutils.la \
917 test_layers_DEPENDENCIES = \
918 test-layers-plugin.la \
919 test-layers-filter1.la \
920 test-layers-filter2.la \
921 test-layers-filter3.la \
924 # check_LTLIBRARIES won't build a shared library (see automake manual).
925 # So we have to do this and add a dependency.
926 noinst_LTLIBRARIES += \
927 test-layers-plugin.la \
928 test-layers-filter1.la \
929 test-layers-filter2.la \
930 test-layers-filter3.la \
933 test_layers_plugin_la_SOURCES = \
934 test-layers-plugin.c \
935 $(top_srcdir)/include/nbdkit-plugin.h \
937 test_layers_plugin_la_CPPFLAGS = -I$(top_srcdir)/include
938 test_layers_plugin_la_CFLAGS = $(WARNINGS_CFLAGS)
939 # For use of the -rpath option, see:
940 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
941 test_layers_plugin_la_LDFLAGS = \
942 -module -avoid-version -shared -rpath /nowhere \
945 test_layers_filter1_la_SOURCES = \
946 test-layers-filter.c \
947 $(top_srcdir)/include/nbdkit-filter.h \
949 test_layers_filter1_la_CPPFLAGS = -I$(top_srcdir)/include
950 test_layers_filter1_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter1"'
951 # For use of the -rpath option, see:
952 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
953 test_layers_filter1_la_LDFLAGS = \
954 -module -avoid-version -shared -rpath /nowhere \
957 test_layers_filter2_la_SOURCES = \
958 test-layers-filter.c \
959 $(top_srcdir)/include/nbdkit-filter.h \
961 test_layers_filter2_la_CPPFLAGS = -I$(top_srcdir)/include
962 test_layers_filter2_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter2"'
963 # For use of the -rpath option, see:
964 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
965 test_layers_filter2_la_LDFLAGS = \
966 -module -avoid-version -shared -rpath /nowhere \
969 test_layers_filter3_la_SOURCES = \
970 test-layers-filter.c \
971 $(top_srcdir)/include/nbdkit-filter.h \
973 test_layers_filter3_la_CPPFLAGS = -I$(top_srcdir)/include
974 test_layers_filter3_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter3"'
975 # For use of the -rpath option, see:
976 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
977 test_layers_filter3_la_LDFLAGS = \
978 -module -avoid-version -shared -rpath /nowhere \
981 # blocksize filter test.
982 TESTS += test-blocksize.sh
987 test-cache-on-read.sh \
989 TESTS += test-cache-max-size.sh
991 # cacheextents filter test.
992 TESTS += test-cacheextents.sh
1000 # delay filter tests.
1001 TESTS += test-shutdown.sh
1002 LIBNBD_TESTS += test-delay
1004 test_delay_SOURCES = test-delay.c
1005 test_delay_CFLAGS = $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS)
1006 test_delay_LDADD = $(LIBNBD_LIBS)
1008 # error filter test.
1013 test-error-triggered.sh \
1017 TESTS += test-fua.sh
1020 TESTS += test-ip-filter.sh
1023 TESTS += test-log.sh
1026 TESTS += test-nofilter.sh
1029 # nozero filter test.
1030 TESTS += test-nozero.sh
1031 endif HAVE_NBD_PLUGIN
1033 # offset filter test.
1034 LIBGUESTFS_TESTS += test-offset
1036 test_offset_SOURCES = test-offset.c test.h
1037 test_offset_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1038 test_offset_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1042 test-offset-extents.sh \
1045 # partition filter test.
1046 TESTS += test-partition1.sh
1047 TESTS += test-partition2.sh
1052 test-rate-dynamic.sh \
1055 # readahead filter test.
1058 test-readahead-copy.sh \
1061 # retry filter test.
1064 test-retry-readonly.sh \
1065 test-retry-extents.sh \
1066 test-retry-size.sh \
1067 test-retry-reopen-fail.sh \
1068 test-retry-zero-flags.sh \
1071 # truncate filter tests.
1077 test-truncate-extents.sh \
1082 LIBGUESTFS_TESTS += test-xz
1083 check_DATA += disk.xz
1084 CLEANFILES += disk.xz
1086 test_xz_SOURCES = test-xz.c test.h
1087 test_xz_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1088 test_xz_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1092 # We choose a very small block size here only for testing. Normally
1093 # you should choose a 16M block size.
1094 xz --best --block-size=32768 -c disk > $@
1098 LIBGUESTFS_TESTS += test-xz-curl
1100 test_xz_curl_SOURCES = \
1106 test_xz_curl_CPPFLAGS = \
1107 -I$(top_srcdir)/common/utils
1108 test_xz_curl_CFLAGS = \
1109 $(WARNINGS_CFLAGS) \
1110 $(LIBGUESTFS_CFLAGS) \
1113 test_xz_curl_LDFLAGS = \
1114 $(top_builddir)/common/utils/libutils.la \
1117 test_xz_curl_LDADD = \
1119 $(LIBGUESTFS_LIBS) \
1127 #----------------------------------------------------------------------
1130 check_PROGRAMS += $(LIBNBD_TESTS)
1131 TESTS += $(LIBNBD_TESTS)
1135 check_PROGRAMS += $(LIBGUESTFS_TESTS)
1136 TESTS += $(LIBGUESTFS_TESTS)
1137 endif HAVE_LIBGUESTFS