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
35 generate-file-data.sh \
36 generate-offset-data.sh \
48 test-cache-max-size.sh \
49 test-cache-on-read.sh \
50 test-cacheextents.sh \
57 test-data-extents.sh \
63 test-dump-plugin-example4.sh \
68 test-file-extents.sh \
79 test-linuxdisk-copy-out.sh \
82 test-memory-largest.sh \
83 test-memory-largest-for-qemu.sh \
88 test-null-extents.sh \
89 test_ocaml_plugin.ml \
92 test-offset-extents.sh \
93 test-parallel-file.sh \
94 test-parallel-nbd.sh \
98 test-partitioning1.sh \
99 test-partitioning2.sh \
100 test-partitioning3.sh \
101 test-partitioning4.sh \
102 test-partitioning5.sh \
103 test-partitioning6.sh \
105 test-pattern-largest.sh \
106 test-pattern-largest-for-qemu.sh \
107 test-python-exception.sh \
111 test-rate-dynamic.sh \
113 test-readahead-copy.sh \
114 test-reflection-base64.sh \
115 test-reflection-raw.sh \
119 test-shebang-perl.sh \
120 test-shebang-python.sh \
121 test-shebang-ruby.sh \
126 test-single-from-file.sh \
128 test-random-sock.sh \
135 test-truncate-extents.sh \
139 test-version-filter.sh \
140 test-version-plugin.sh \
144 # Use 'make check' to run the ordinary tests. To run all the tests
145 # under valgrind, use the following rule:
147 NBDKIT_VALGRIND=1 $(MAKE) check
149 # To run only tests which require root, use:
151 $(MAKE) check TESTS="test-file-block"
153 # Run a basic check against a real copy of VDDK. You must set
154 # vddkdir to point to the library location, eg:
156 # make check-vddk vddkdir=vmware-vix-disklib-distrib
158 $(MAKE) check TESTS=test-vddk-real.sh
160 #----------------------------------------------------------------------
161 # Basic server command line and start-up tests.
169 # Ensure we're testing the local copy by running everything through
170 # the nbdkit helper script in the top build directory.
171 TESTS_ENVIRONMENT = PATH=$(abs_top_builddir):$(PATH) SRCDIR=$(srcdir)
176 test-dump-config.sh \
182 test-help-plugin.sh \
183 test-version-plugin.sh \
184 test-version-filter.sh \
185 test-dump-plugin.sh \
188 test-single-from-file.sh \
190 test-random-sock.sh \
194 test-socket-activation \
196 test-debug-flags.sh \
200 test-socket-activation \
203 test_socket_activation_SOURCES = test-socket-activation.c
204 test_socket_activation_CFLAGS = $(WARNINGS_CFLAGS)
208 # Test the header files can be included on their own.
210 test-just-plugin-header \
211 test-just-filter-header
214 test-just-plugin-header \
215 test-just-filter-header
218 test_just_plugin_header_SOURCES = \
219 test-just-plugin-header.c \
221 test_just_plugin_header_CPPFLAGS = \
222 -I$(top_srcdir)/include \
224 test_just_plugin_header_CFLAGS = $(WARNINGS_CFLAGS)
226 test_just_filter_header_SOURCES = \
227 test-just-filter-header.c \
229 test_just_filter_header_CPPFLAGS = \
230 -I$(top_srcdir)/include \
232 test_just_filter_header_CFLAGS = $(WARNINGS_CFLAGS)
235 # This builds a plugin using an ANSI (ISO C90) compiler to ensure that
236 # the header file is compatible. The plugin does nothing very
237 # interesting, it's mainly a compile test.
241 # check_LTLIBRARIES won't build a shared library (see automake manual).
242 # So we have to do this and add a dependency.
243 noinst_LTLIBRARIES += test-ansi-c-plugin.la
244 test-ansi-c.sh: test-ansi-c-plugin.la
246 test_ansi_c_plugin_la_SOURCES = \
247 test-ansi-c-plugin.c \
248 $(top_srcdir)/include/nbdkit-plugin.h \
250 test_ansi_c_plugin_la_CPPFLAGS = \
252 -I$(top_srcdir)/include \
254 test_ansi_c_plugin_la_CFLAGS = $(WARNINGS_CFLAGS)
255 # For use of the -rpath option, see:
256 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
257 test_ansi_c_plugin_la_LDFLAGS = \
258 -module -avoid-version -shared -rpath /nowhere \
260 endif CAN_TEST_ANSI_C
263 # This builds a plugin and a filter using the C++ compiler. They
264 # don't do anything interesting when run.
268 # check_LTLIBRARIES won't build a shared library (see automake manual).
269 # So we have to do this and add a dependency.
270 noinst_LTLIBRARIES += test-cxx-plugin.la test-cxx-filter.la
271 test-cxx.sh: test-cxx-plugin.la test-cxx-filter.la
273 test_cxx_plugin_la_SOURCES = \
274 test-cxx-plugin.cpp \
275 $(top_srcdir)/include/nbdkit-plugin.h \
277 test_cxx_plugin_la_CPPFLAGS = \
278 -I$(top_srcdir)/include \
280 test_cxx_plugin_la_CXXFLAGS = $(WARNINGS_CFLAGS)
281 # For use of the -rpath option, see:
282 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
283 test_cxx_plugin_la_LDFLAGS = \
284 -module -avoid-version -shared -rpath /nowhere \
287 test_cxx_filter_la_SOURCES = \
288 test-cxx-filter.cpp \
289 $(top_srcdir)/include/nbdkit-filter.h \
291 test_cxx_filter_la_CPPFLAGS = \
292 -I$(top_srcdir)/include \
294 test_cxx_filter_la_CXXFLAGS = $(WARNINGS_CFLAGS)
295 # For use of the -rpath option, see:
296 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
297 test_cxx_filter_la_LDFLAGS = \
298 -module -avoid-version -shared -rpath /nowhere \
302 # Exit with parent test.
303 check_PROGRAMS += test-exit-with-parent
304 TESTS += test-exit-with-parent
306 test_exit_with_parent_SOURCES = \
307 test-exit-with-parent.c test.h \
309 test_exit_with_parent_CPPFLAGS = \
310 -I$(top_srcdir)/common/include \
312 test_exit_with_parent_CFLAGS = \
314 $(LIBGUESTFS_CFLAGS) \
317 # PKI files for the TLS tests.
318 check_DATA += pki/.stamp
319 pki/.stamp: $(srcdir)/make-pki.sh
320 SRCDIR=$(srcdir) $(srcdir)/make-pki.sh
322 # PSK keys for the TLS-PSK tests.
323 check_DATA += keys.psk
324 keys.psk: $(srcdir)/make-psk.sh
325 SRCDIR=$(srcdir) $(srcdir)/make-psk.sh
327 # Keys are expensive to recreate so only delete them when we do
328 # ‘make distclean’.
329 DISTCLEANFILES = keys.psk
330 distclean-local: distclean-local-tls
334 #----------------------------------------------------------------------
335 # Tests of C plugins or tests which require plugins.
339 # Common data shared by multiple tests
340 check_DATA += file-data
341 CLEANFILES += file-data
342 file-data: generate-file-data.sh
343 $(srcdir)/generate-file-data.sh $@
345 # While most tests need libguestfs, testing parallel I/O is easier when
346 # using qemu-io to kick off asynchronous requests.
348 test-parallel-file.sh \
349 test-parallel-nbd.sh \
350 test-parallel-sh.sh \
353 # Most in-depth tests need libguestfs, since that is a convenient way to
358 check_PROGRAMS += $(LIBGUESTFS_TESTS)
359 TESTS += $(LIBGUESTFS_TESTS)
361 # Use the 'direct' backend, and ensure maximum libguestfs and libnbd
362 # debugging is written to the *.log files in case there is a problem.
363 TESTS_ENVIRONMENT += \
364 LIBGUESTFS_ATTACH_METHOD=appliance \
370 # Common test library.
371 check_LTLIBRARIES += libtest.la
372 libtest_la_SOURCES = test.c test.h
373 libtest_la_CFLAGS = $(WARNINGS_CFLAGS)
375 # Basic connection test.
376 LIBGUESTFS_TESTS += test-connect
378 test_connect_SOURCES = test-connect.c test.h
379 test_connect_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
380 test_connect_LDADD = libtest.la $(LIBGUESTFS_LIBS)
382 # newstyle protocol test.
383 LIBGUESTFS_TESTS += test-newstyle
385 test_newstyle_SOURCES = test-newstyle.c test.h
386 test_newstyle_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
387 test_newstyle_LDADD = libtest.la $(LIBGUESTFS_LIBS)
389 # oldstyle protocol test.
390 LIBGUESTFS_TESTS += test-oldstyle
392 test_oldstyle_SOURCES = test-oldstyle.c test.h
393 test_oldstyle_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
394 test_oldstyle_LDADD = libtest.la $(LIBGUESTFS_LIBS)
396 endif HAVE_LIBGUESTFS
399 TESTS += test-eflags.sh
402 TESTS += test-export-name.sh
404 # common disk image shared with several tests
411 guestfish -N $@-t=fs:ext4:100M -m /dev/sda1 \
412 write /hello.txt "hello,world"
423 LIBGUESTFS_TESTS += test-curl
425 test_curl_SOURCES = \
431 test_curl_CPPFLAGS = \
432 -I$(top_srcdir)/common/utils
435 $(LIBGUESTFS_CFLAGS) \
438 test_curl_LDFLAGS = \
439 $(top_builddir)/common/utils/libutils.la \
451 LIBGUESTFS_TESTS += test-data
454 test-data-base64.sh \
455 test-data-extents.sh \
460 test_data_SOURCES = test-data.c test.h
461 test_data_CPPFLAGS = -I$(top_srcdir)/common/include
462 test_data_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
463 test_data_LDADD = libtest.la $(LIBGUESTFS_LIBS)
469 LIBGUESTFS_TESTS += test-ext2
470 check_DATA += ext2.img
471 CLEANFILES += ext2.img
478 mkfs ext4 /dev/sda : \
481 upload $< /disks/disk.img
484 test_ext2_SOURCES = test-ext2.c test.h
485 test_ext2_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
486 test_ext2_LDADD = libtest.la $(LIBGUESTFS_LIBS)
492 LIBGUESTFS_TESTS += test-file test-file-block
494 test_file_SOURCES = test-file.c test.h
495 test_file_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
496 test_file_LDADD = libtest.la $(LIBGUESTFS_LIBS)
498 test_file_block_SOURCES = test-file-block.c test.h
499 test_file_block_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
500 test_file_block_LDADD = libtest.la $(LIBGUESTFS_LIBS)
503 TESTS += test-file-extents.sh
506 # floppy plugin test.
508 TESTS += test-floppy.sh
512 TESTS += test-full.sh
518 LIBGUESTFS_TESTS += test-gzip
519 check_DATA += disk.gz
520 CLEANFILES += disk.gz
522 test_gzip_SOURCES = test-gzip.c test.h
523 test_gzip_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
524 test_gzip_LDADD = libtest.la $(LIBGUESTFS_LIBS)
542 # linuxdisk plugin test.
546 test-linuxdisk-copy-out.sh \
550 # memory plugin test.
551 LIBGUESTFS_TESTS += test-memory
552 TESTS += test-memory-largest.sh test-memory-largest-for-qemu.sh
554 test_memory_SOURCES = test-memory.c test.h
555 test_memory_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
556 test_memory_LDADD = libtest.la $(LIBGUESTFS_LIBS)
558 # partitioning plugin test.
560 test-partitioning1.sh \
561 test-partitioning4.sh \
562 test-partitioning6.sh \
566 test-partitioning2.sh \
567 test-partitioning3.sh \
568 test-partitioning5.sh \
572 # pattern plugin test.
575 test-pattern-largest.sh \
576 test-pattern-largest-for-qemu.sh \
580 LIBGUESTFS_TESTS += test-nbd
582 test-nbd-extents.sh \
584 test-nbd-tls-psk.sh \
587 test_nbd_SOURCES = test-nbd.c test.h
588 test_nbd_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
589 test_nbd_LDADD = libtest.la $(LIBGUESTFS_LIBS)
592 LIBGUESTFS_TESTS += test-null
593 TESTS += test-null-extents.sh
595 test_null_SOURCES = test-null.c test.h
596 test_null_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
597 test_null_LDADD = libtest.la $(LIBGUESTFS_LIBS)
599 # random plugin test.
600 LIBGUESTFS_TESTS += test-random
602 test_random_SOURCES = test-random.c test.h
603 test_random_CPPFLAGS = -I $(top_srcdir)/common/include
604 test_random_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
605 test_random_LDADD = libtest.la $(LIBGUESTFS_LIBS)
607 # reflection plugin test.
609 test-reflection-base64.sh \
610 test-reflection-raw.sh \
613 # split files plugin test.
614 check_DATA += split1 split2 split3
615 CLEANFILES += split1 split2 split3
618 dd if=$< of=$@-t bs=1 count=100
622 dd if=$< of=$@-t bs=1 count=100 skip=100
626 dd if=$< of=$@-t bs=1 skip=200
628 LIBGUESTFS_TESTS += test-split
630 test_split_SOURCES = test-split.c test.h
631 test_split_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
632 test_split_LDADD = libtest.la $(LIBGUESTFS_LIBS)
636 # Uses ‘disk’ so we have to make it conditional on guestfish.
642 ssh/ssh_host_rsa_key ssh/ssh_host_rsa_key.pub \
643 ssh/authorized_keys \
645 SSH_RANDOM_PORT := $(shell bash -c 'echo $$(( 10000 + $$RANDOM ))')
649 ssh/authorized_keys \
652 ssh/ssh_host_rsa_key ssh/ssh_host_rsa_key.pub \
653 ssh/id_rsa ssh/id_rsa.pub \
654 stamp-ssh-host-key stamp-ssh-user-key \
657 ssh/sshd_config: ssh/sshd_config.in Makefile
660 -e 's,__abs_builddir__,$(abs_builddir),g' \
661 -e 's,__RANDOM_PORT__,$(SSH_RANDOM_PORT),g' \
665 ssh/ssh_host_rsa_key ssh/ssh_host_rsa_key.pub: stamp-ssh-host-key
668 rm -f ssh/ssh_host_rsa_key
669 rm -f ssh/ssh_host_rsa_key.pub
670 ssh-keygen -t rsa -f ssh/ssh_host_rsa_key -N ''
673 ssh/authorized_keys: ssh/id_rsa.pub
678 ssh/id_rsa ssh/id_rsa.pub: stamp-ssh-user-key
683 ssh-keygen -t rsa -f ssh/id_rsa -N ''
687 # streaming plugin test.
689 #LIBGUESTFS_TESTS += test-streaming
690 EXTRA_PROGRAMS += test-streaming
692 test_streaming_SOURCES = test-streaming.c test.h
693 test_streaming_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
694 test_streaming_LDADD = libtest.la $(LIBGUESTFS_LIBS)
697 # This only tests that the plugin can be loaded against a
698 # dummy VDDK library, it is not a detailed test.
700 # check_LTLIBRARIES won't build a shared library (see automake manual).
701 # So we have to do this and add a dependency.
702 noinst_LTLIBRARIES += libvixDiskLib.la
708 libvixDiskLib_la_SOURCES = \
711 libvixDiskLib_la_CPPFLAGS = \
712 -I$(top_srcdir)/plugins/vddk \
714 libvixDiskLib_la_CXXFLAGS = $(WARNINGS_CFLAGS)
715 # For use of the -rpath option, see:
716 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
717 libvixDiskLib_la_LDFLAGS = \
718 -shared -version-number 6:0:0 -rpath /nowhere \
722 TESTS += test-zero.sh
724 #----------------------------------------------------------------------
725 # Tests of language plugins.
730 LIBGUESTFS_TESTS += test-ocaml
732 # This is somewhat different from the other tests because we have
733 # to build an actual plugin here.
734 test_ocaml_SOURCES = test-ocaml.c test.h
735 test_ocaml_CFLAGS = \
737 $(LIBGUESTFS_CFLAGS) \
739 test_ocaml_LDADD = libtest.la $(LIBGUESTFS_LIBS)
741 check_SCRIPTS += test-ocaml-plugin.so
742 test-ocaml-plugin.so: test_ocaml_plugin.cmx ../plugins/ocaml/libnbdkitocaml.la ../plugins/ocaml/NBDKit.cmi ../plugins/ocaml/NBDKit.cmx
743 $(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../plugins/ocaml \
744 -output-obj -runtime-variant _pic -o $@ \
746 -cclib -L../plugins/ocaml/.libs -cclib -lnbdkitocaml
747 test_ocaml_plugin.cmx: test_ocaml_plugin.ml ../plugins/ocaml/NBDKit.cmi
748 $(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../plugins/ocaml -c $< -o $@
756 test-dump-plugin-example4.sh \
757 test-shebang-perl.sh \
759 LIBGUESTFS_TESTS += test-perl
761 test_perl_SOURCES = test-lang-plugins.c test.h
763 -DLANG='"perl"' -DSCRIPT='"$(srcdir)/test.pl"' \
765 $(LIBGUESTFS_CFLAGS) \
767 test_perl_LDADD = libtest.la $(LIBGUESTFS_LIBS)
771 # python plugin test.
775 test-python-exception.sh \
776 test-shebang-python.sh \
778 LIBGUESTFS_TESTS += test-python
780 test_python_SOURCES = test-lang-plugins.c test.h
781 test_python_CFLAGS = \
782 -DLANG='"python"' -DSCRIPT='"$(srcdir)/test.py"' \
784 $(LIBGUESTFS_CFLAGS) \
786 test_python_LDADD = libtest.la $(LIBGUESTFS_LIBS)
793 # Ruby tests are disabled. See "WARNING" section in
794 # plugins/ruby/nbdkit-ruby-plugin.pod
796 #LIBGUESTFS_TESTS += \
799 #TESTS += test-shebang-ruby.sh
800 EXTRA_PROGRAMS += test-ruby
802 test_ruby_SOURCES = test-lang-plugins.c test.h
804 -DLANG='"ruby"' -DSCRIPT='"$(srcdir)/test.rb"' \
806 $(LIBGUESTFS_CFLAGS) \
808 test_ruby_LDADD = libtest.la $(LIBGUESTFS_LIBS)
812 # Shell (sh) plugin test.
813 LIBGUESTFS_TESTS += test-shell
814 check_DATA += test-shell.img
815 CLEANFILES += test-shell.img
817 test_shell_SOURCES = test-lang-plugins.c test.h
818 test_shell_CFLAGS = \
819 -DLANG='"sh"' -DSCRIPT='"$(srcdir)/test-shell.sh"' \
821 $(LIBGUESTFS_CFLAGS) \
823 test_shell_LDADD = libtest.la $(LIBGUESTFS_LIBS)
826 truncate -s 1048576 $@
836 LIBGUESTFS_TESTS += test-tcl
838 test_tcl_SOURCES = test-lang-plugins.c test.h
840 -DLANG='"tcl"' -DSCRIPT='"$(srcdir)/test.tcl"' \
842 $(LIBGUESTFS_CFLAGS) \
844 test_tcl_LDADD = libtest.la $(LIBGUESTFS_LIBS)
851 LIBGUESTFS_TESTS += test-lua
853 test_lua_SOURCES = test-lang-plugins.c test.h
855 -DLANG='"lua"' -DSCRIPT='"$(srcdir)/test.lua"' \
857 $(LIBGUESTFS_CFLAGS) \
859 test_lua_LDADD = libtest.la $(LIBGUESTFS_LIBS)
863 #----------------------------------------------------------------------
866 # Generic test of filter layers.
867 check_PROGRAMS += test-layers
868 TESTS += test-layers.sh test-layers
870 test_layers_SOURCES = \
873 test_layers_CPPFLAGS = \
874 -I$(top_srcdir)/common/include \
875 -I$(top_srcdir)/common/protocol \
876 -I$(top_srcdir)/common/utils \
877 -I$(top_srcdir)/server \
879 test_layers_CFLAGS = \
883 test_layers_LDFLAGS = \
886 test_layers_LDADD = \
887 $(top_builddir)/common/utils/libutils.la \
889 test_layers_DEPENDENCIES = \
890 test-layers-plugin.la \
891 test-layers-filter1.la \
892 test-layers-filter2.la \
893 test-layers-filter3.la \
896 # check_LTLIBRARIES won't build a shared library (see automake manual).
897 # So we have to do this and add a dependency.
898 noinst_LTLIBRARIES += \
899 test-layers-plugin.la \
900 test-layers-filter1.la \
901 test-layers-filter2.la \
902 test-layers-filter3.la \
905 test_layers_plugin_la_SOURCES = \
906 test-layers-plugin.c \
907 $(top_srcdir)/include/nbdkit-plugin.h \
909 test_layers_plugin_la_CPPFLAGS = -I$(top_srcdir)/include
910 test_layers_plugin_la_CFLAGS = $(WARNINGS_CFLAGS)
911 # For use of the -rpath option, see:
912 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
913 test_layers_plugin_la_LDFLAGS = \
914 -module -avoid-version -shared -rpath /nowhere \
917 test_layers_filter1_la_SOURCES = \
918 test-layers-filter.c \
919 $(top_srcdir)/include/nbdkit-filter.h \
921 test_layers_filter1_la_CPPFLAGS = -I$(top_srcdir)/include
922 test_layers_filter1_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter1"'
923 # For use of the -rpath option, see:
924 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
925 test_layers_filter1_la_LDFLAGS = \
926 -module -avoid-version -shared -rpath /nowhere \
929 test_layers_filter2_la_SOURCES = \
930 test-layers-filter.c \
931 $(top_srcdir)/include/nbdkit-filter.h \
933 test_layers_filter2_la_CPPFLAGS = -I$(top_srcdir)/include
934 test_layers_filter2_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter2"'
935 # For use of the -rpath option, see:
936 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
937 test_layers_filter2_la_LDFLAGS = \
938 -module -avoid-version -shared -rpath /nowhere \
941 test_layers_filter3_la_SOURCES = \
942 test-layers-filter.c \
943 $(top_srcdir)/include/nbdkit-filter.h \
945 test_layers_filter3_la_CPPFLAGS = -I$(top_srcdir)/include
946 test_layers_filter3_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter3"'
947 # For use of the -rpath option, see:
948 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
949 test_layers_filter3_la_LDFLAGS = \
950 -module -avoid-version -shared -rpath /nowhere \
953 # blocksize filter test.
954 TESTS += test-blocksize.sh
960 test-cache-on-read.sh \
963 TESTS += test-cache-max-size.sh
965 # cacheextents filter test.
966 TESTS += test-cacheextents.sh
972 TESTS += test-cow-null.sh
974 # delay filter tests.
975 TESTS += test-shutdown.sh
976 LIBGUESTFS_TESTS += test-delay
978 test_delay_SOURCES = test-delay.c test.h
979 test_delay_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
980 test_delay_LDADD = libtest.la $(LIBGUESTFS_LIBS)
983 LIBGUESTFS_TESTS += test-error
985 test_error_SOURCES = test-error.c test.h
986 test_error_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
987 test_error_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1001 # nozero filter test.
1002 TESTS += test-nozero.sh
1004 # offset filter test.
1005 check_DATA += offset-data
1006 CLEANFILES += offset-data
1007 LIBGUESTFS_TESTS += test-offset
1009 offset-data: generate-offset-data.sh
1010 $(srcdir)/generate-offset-data.sh $@
1012 test_offset_SOURCES = test-offset.c test.h
1013 test_offset_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1014 test_offset_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1018 test-offset-extents.sh \
1021 # partition filter test.
1022 TESTS += test-partition1.sh
1024 TESTS += test-partition2.sh
1025 endif HAVE_GUESTFISH
1030 test-rate-dynamic.sh \
1033 # readahead filter test.
1034 LIBGUESTFS_TESTS += test-readahead
1035 TESTS += test-readahead-copy.sh
1037 test_readahead_SOURCES = test-readahead.c test.h
1038 test_readahead_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1039 test_readahead_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1041 # truncate filter tests.
1047 test-truncate-extents.sh \
1054 LIBGUESTFS_TESTS += test-xz
1055 check_DATA += disk.xz
1056 CLEANFILES += disk.xz
1058 test_xz_SOURCES = test-xz.c test.h
1059 test_xz_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1060 test_xz_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1064 # We choose a very small block size here only for testing. Normally
1065 # you should choose a 16M block size.
1066 xz --best --block-size=32768 -c disk > $@
1071 LIBGUESTFS_TESTS += test-xz-curl
1073 test_xz_curl_SOURCES = \
1079 test_xz_curl_CPPFLAGS = \
1080 -I$(top_srcdir)/common/utils
1081 test_xz_curl_CFLAGS = \
1082 $(WARNINGS_CFLAGS) \
1083 $(LIBGUESTFS_CFLAGS) \
1086 test_xz_curl_LDFLAGS = \
1087 $(top_builddir)/common/utils/libutils.la \
1090 test_xz_curl_LDADD = \
1092 $(LIBGUESTFS_LIBS) \
1097 endif HAVE_GUESTFISH