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 \
55 test-data-extents.sh \
61 test-dump-plugin-example4.sh \
66 test-file-extents.sh \
77 test-linuxdisk-copy-out.sh \
80 test-memory-largest.sh \
81 test-memory-largest-for-qemu.sh \
83 test-null-extents.sh \
84 test_ocaml_plugin.ml \
87 test-offset-extents.sh \
88 test-parallel-file.sh \
89 test-parallel-nbd.sh \
92 test-partitioning1.sh \
93 test-partitioning2.sh \
94 test-partitioning3.sh \
95 test-partitioning4.sh \
96 test-partitioning5.sh \
97 test-partitioning6.sh \
99 test-pattern-largest.sh \
100 test-pattern-largest-for-qemu.sh \
101 test-python-exception.sh \
105 test-rate-dynamic.sh \
107 test-readahead-copy.sh \
110 test-shebang-perl.sh \
111 test-shebang-python.sh \
112 test-shebang-ruby.sh \
116 test-single-from-file.sh \
118 test-random-sock.sh \
124 test-truncate-extents.sh \
128 test-version-filter.sh \
129 test-version-plugin.sh \
132 # Use 'make check' to run the ordinary tests. To run all the tests
133 # under valgrind, use the following rule:
135 NBDKIT_VALGRIND=1 $(MAKE) check
137 # To run only tests which require root, use:
139 $(MAKE) check TESTS="test-file-block"
141 # Run a basic check against a real copy of VDDK. You must set
142 # vddkdir to point to the library location, eg:
144 # make check-vddk vddkdir=vmware-vix-disklib-distrib
146 $(MAKE) check TESTS=test-vddk-real.sh
148 #----------------------------------------------------------------------
149 # Basic server command line and start-up tests.
157 # Ensure we're testing the local copy by running everything through
158 # the nbdkit helper script in the top build directory.
159 TESTS_ENVIRONMENT = PATH=$(abs_top_builddir):$(PATH) SRCDIR=$(srcdir)
169 test-help-plugin.sh \
170 test-version-plugin.sh \
171 test-version-filter.sh \
172 test-dump-plugin.sh \
175 test-single-from-file.sh \
177 test-random-sock.sh \
181 test-socket-activation \
186 test-socket-activation
188 test_socket_activation_SOURCES = test-socket-activation.c
189 test_socket_activation_CFLAGS = $(WARNINGS_CFLAGS)
193 # Test the header files can be included on their own.
195 test-just-plugin-header \
196 test-just-filter-header
198 test-just-plugin-header \
199 test-just-filter-header
201 test_just_plugin_header_SOURCES = \
202 test-just-plugin-header.c
203 test_just_plugin_header_CPPFLAGS = \
204 -I$(top_srcdir)/include
205 test_just_plugin_header_CFLAGS = \
208 test_just_filter_header_SOURCES = \
209 test-just-filter-header.c
210 test_just_filter_header_CPPFLAGS = \
211 -I$(top_srcdir)/include
212 test_just_filter_header_CFLAGS = \
216 # This builds a plugin using an ANSI (ISO C90) compiler to ensure that
217 # the header file is compatible. The plugin does nothing very
218 # interesting, it's mainly a compile test.
221 # check_LTLIBRARIES won't build a shared library (see automake manual).
222 # So we have to do this and add a dependency.
223 noinst_LTLIBRARIES += test-ansi-c-plugin.la
224 test-ansi-c.sh: test-ansi-c-plugin.la
226 test_ansi_c_plugin_la_SOURCES = \
227 test-ansi-c-plugin.c \
228 $(top_srcdir)/include/nbdkit-plugin.h
229 test_ansi_c_plugin_la_CPPFLAGS = \
231 -I$(top_srcdir)/include
232 test_ansi_c_plugin_la_CFLAGS = \
234 # For use of the -rpath option, see:
235 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
236 test_ansi_c_plugin_la_LDFLAGS = \
237 -module -avoid-version -shared -rpath /nowhere
238 endif CAN_TEST_ANSI_C
241 # This builds a plugin and a filter using the C++ compiler. They
242 # don't do anything interesting when run.
245 # check_LTLIBRARIES won't build a shared library (see automake manual).
246 # So we have to do this and add a dependency.
247 noinst_LTLIBRARIES += test-cxx-plugin.la test-cxx-filter.la
248 test-cxx.sh: test-cxx-plugin.la test-cxx-filter.la
250 test_cxx_plugin_la_SOURCES = \
251 test-cxx-plugin.cpp \
252 $(top_srcdir)/include/nbdkit-plugin.h
253 test_cxx_plugin_la_CPPFLAGS = \
254 -I$(top_srcdir)/include
255 test_cxx_plugin_la_CXXFLAGS = \
257 # For use of the -rpath option, see:
258 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
259 test_cxx_plugin_la_LDFLAGS = \
260 -module -avoid-version -shared -rpath /nowhere
262 test_cxx_filter_la_SOURCES = \
263 test-cxx-filter.cpp \
264 $(top_srcdir)/include/nbdkit-filter.h
265 test_cxx_filter_la_CPPFLAGS = \
266 -I$(top_srcdir)/include
267 test_cxx_filter_la_CXXFLAGS = \
269 # For use of the -rpath option, see:
270 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
271 test_cxx_filter_la_LDFLAGS = \
272 -module -avoid-version -shared -rpath /nowhere
275 # Exit with parent test.
276 check_PROGRAMS += test-exit-with-parent
277 TESTS += test-exit-with-parent
279 test_exit_with_parent_SOURCES = \
280 test-exit-with-parent.c test.h
281 test_exit_with_parent_CPPFLAGS = \
282 -I$(top_srcdir)/common/include
283 test_exit_with_parent_CFLAGS = \
284 $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
286 # PKI files for the TLS tests.
287 check_DATA += pki/.stamp
288 pki/.stamp: $(srcdir)/make-pki.sh
289 SRCDIR=$(srcdir) $(srcdir)/make-pki.sh
291 # PSK keys for the TLS-PSK tests.
292 check_DATA += keys.psk
293 keys.psk: $(srcdir)/make-psk.sh
294 SRCDIR=$(srcdir) $(srcdir)/make-psk.sh
296 # Keys are expensive to recreate so only delete them when we do
297 # ‘make distclean’.
298 DISTCLEANFILES = keys.psk
299 distclean-local: distclean-local-tls
303 #----------------------------------------------------------------------
304 # Tests of C plugins or tests which require plugins.
308 # Common data shared by multiple tests
309 check_DATA += file-data
310 CLEANFILES += file-data
311 file-data: generate-file-data.sh
312 $(srcdir)/generate-file-data.sh $@
314 # While most tests need libguestfs, testing parallel I/O is easier when
315 # using qemu-io to kick off asynchronous requests.
317 test-parallel-file.sh \
320 # Most in-depth tests need libguestfs, since that is a convenient way to
325 check_PROGRAMS += $(LIBGUESTFS_TESTS)
326 TESTS += $(LIBGUESTFS_TESTS)
328 # Use the 'direct' backend, and ensure maximum libguestfs debugging is
329 # written to the *.log files in case there is a problem.
330 TESTS_ENVIRONMENT += \
331 LIBGUESTFS_ATTACH_METHOD=appliance \
334 LD_LIBRARY_PATH=../plugins/ocaml/.libs:$(LD_LIBRARY_PATH) \
335 LIBRARY_PATH=../plugins/ocaml/.libs:$(LIBRARY_PATH)
337 # Common test library.
338 check_LTLIBRARIES += libtest.la
339 libtest_la_SOURCES = test.c test.h
340 libtest_la_CFLAGS = $(WARNINGS_CFLAGS)
342 # Basic connection test.
343 LIBGUESTFS_TESTS += test-connect
345 test_connect_SOURCES = test-connect.c test.h
346 test_connect_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
347 test_connect_LDADD = libtest.la $(LIBGUESTFS_LIBS)
349 # newstyle protocol test.
350 LIBGUESTFS_TESTS += test-newstyle
352 test_newstyle_SOURCES = test-newstyle.c test.h
353 test_newstyle_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
354 test_newstyle_LDADD = libtest.la $(LIBGUESTFS_LIBS)
356 # oldstyle protocol test.
357 LIBGUESTFS_TESTS += test-oldstyle
359 test_oldstyle_SOURCES = test-oldstyle.c test.h
360 test_oldstyle_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
361 test_oldstyle_LDADD = libtest.la $(LIBGUESTFS_LIBS)
363 endif HAVE_LIBGUESTFS
366 TESTS += test-eflags.sh
368 # common disk image shared with several tests
375 guestfish -N $@-t=fs:ext4:100M -m /dev/sda1 \
376 write /hello.txt "hello,world"
387 LIBGUESTFS_TESTS += test-curl
389 test_curl_SOURCES = \
396 $(LIBGUESTFS_CFLAGS) \
398 test_curl_LDFLAGS = \
408 LIBGUESTFS_TESTS += test-data
411 test-data-base64.sh \
412 test-data-extents.sh \
416 test_data_SOURCES = test-data.c test.h
417 test_data_CPPFLAGS = -I$(top_srcdir)/common/include
418 test_data_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
419 test_data_LDADD = libtest.la $(LIBGUESTFS_LIBS)
425 LIBGUESTFS_TESTS += test-ext2
426 check_DATA += ext2.img
427 CLEANFILES += ext2.img
434 mkfs ext4 /dev/sda : \
437 upload $< /disks/disk.img
440 test_ext2_SOURCES = test-ext2.c test.h
441 test_ext2_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
442 test_ext2_LDADD = libtest.la $(LIBGUESTFS_LIBS)
448 LIBGUESTFS_TESTS += test-file test-file-block
450 test_file_SOURCES = test-file.c test.h
451 test_file_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
452 test_file_LDADD = libtest.la $(LIBGUESTFS_LIBS)
454 test_file_block_SOURCES = test-file-block.c test.h
455 test_file_block_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
456 test_file_block_LDADD = libtest.la $(LIBGUESTFS_LIBS)
459 TESTS += test-file-extents.sh
462 # floppy plugin test.
464 TESTS += test-floppy.sh
468 TESTS += test-full.sh
474 LIBGUESTFS_TESTS += test-gzip
475 check_DATA += disk.gz
476 CLEANFILES += disk.gz
478 test_gzip_SOURCES = test-gzip.c test.h
479 test_gzip_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
480 test_gzip_LDADD = libtest.la $(LIBGUESTFS_LIBS)
498 # linuxdisk plugin test.
502 test-linuxdisk-copy-out.sh
505 # memory plugin test.
506 LIBGUESTFS_TESTS += test-memory
507 TESTS += test-memory-largest.sh test-memory-largest-for-qemu.sh
509 test_memory_SOURCES = test-memory.c test.h
510 test_memory_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
511 test_memory_LDADD = libtest.la $(LIBGUESTFS_LIBS)
513 # partitioning plugin test.
515 test-partitioning1.sh \
516 test-partitioning4.sh \
517 test-partitioning6.sh
520 test-partitioning2.sh \
521 test-partitioning3.sh \
522 test-partitioning5.sh
525 # pattern plugin test.
528 test-pattern-largest.sh \
529 test-pattern-largest-for-qemu.sh
532 LIBGUESTFS_TESTS += test-nbd
534 test_nbd_SOURCES = test-nbd.c test.h
535 test_nbd_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
536 test_nbd_LDADD = libtest.la $(LIBGUESTFS_LIBS)
539 LIBGUESTFS_TESTS += test-null
540 TESTS += test-null-extents.sh
542 test_null_SOURCES = test-null.c test.h
543 test_null_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
544 test_null_LDADD = libtest.la $(LIBGUESTFS_LIBS)
546 # random plugin test.
547 LIBGUESTFS_TESTS += test-random
549 test_random_SOURCES = test-random.c test.h
550 test_random_CPPFLAGS = -I $(top_srcdir)/common/include
551 test_random_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
552 test_random_LDADD = libtest.la $(LIBGUESTFS_LIBS)
554 # split files plugin test.
555 check_DATA += split1 split2 split3
556 CLEANFILES += split1 split2 split3
559 dd if=$< of=$@-t bs=1 count=100
563 dd if=$< of=$@-t bs=1 count=100 skip=100
567 dd if=$< of=$@-t bs=1 skip=200
569 LIBGUESTFS_TESTS += test-split
571 test_split_SOURCES = test-split.c test.h
572 test_split_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
573 test_split_LDADD = libtest.la $(LIBGUESTFS_LIBS)
577 # Uses ‘disk’ so we have to make it conditional on guestfish.
583 ssh/ssh_host_rsa_key ssh/ssh_host_rsa_key.pub \
585 SSH_RANDOM_PORT := $(shell bash -c 'echo $$(( 10000 + $$RANDOM ))')
591 ssh/ssh_host_rsa_key ssh/ssh_host_rsa_key.pub \
592 ssh/id_rsa ssh/id_rsa.pub \
593 stamp-ssh-host-key stamp-ssh-user-key
595 ssh/sshd_config: ssh/sshd_config.in Makefile
598 -e 's,__abs_builddir__,$(abs_builddir),g' \
599 -e 's,__RANDOM_PORT__,$(SSH_RANDOM_PORT),g' \
603 ssh/ssh_host_rsa_key ssh/ssh_host_rsa_key.pub: stamp-ssh-host-key
606 rm -f ssh/ssh_host_rsa_key
607 rm -f ssh/ssh_host_rsa_key.pub
608 ssh-keygen -t rsa -f ssh/ssh_host_rsa_key -N ''
611 ssh/authorized_keys: ssh/id_rsa.pub
616 ssh/id_rsa ssh/id_rsa.pub: stamp-ssh-user-key
621 ssh-keygen -t rsa -f ssh/id_rsa -N ''
625 # streaming plugin test.
627 #LIBGUESTFS_TESTS += test-streaming
628 EXTRA_PROGRAMS += test-streaming
630 test_streaming_SOURCES = test-streaming.c test.h
631 test_streaming_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
632 test_streaming_LDADD = libtest.la $(LIBGUESTFS_LIBS)
635 # This only tests that the plugin can be loaded against a
636 # dummy VDDK library, it is not a detailed test.
638 # check_LTLIBRARIES won't build a shared library (see automake manual).
639 # So we have to do this and add a dependency.
640 noinst_LTLIBRARIES += libvixDiskLib.la
645 libvixDiskLib_la_SOURCES = \
647 libvixDiskLib_la_CPPFLAGS = \
648 -I$(top_srcdir)/plugins/vddk
649 libvixDiskLib_la_CXXFLAGS = \
651 # For use of the -rpath option, see:
652 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
653 libvixDiskLib_la_LDFLAGS = \
654 -shared -version-number 6:0:0 -rpath /nowhere
657 TESTS += test-zero.sh
659 #----------------------------------------------------------------------
660 # Tests of language plugins.
665 LIBGUESTFS_TESTS += test-ocaml
667 # This is somewhat different from the other tests because we have
668 # to build an actual plugin here.
669 test_ocaml_SOURCES = test-ocaml.c test.h
670 test_ocaml_CFLAGS = \
671 $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
672 test_ocaml_LDADD = libtest.la $(LIBGUESTFS_LIBS)
674 check_SCRIPTS += test-ocaml-plugin.so
675 test-ocaml-plugin.so: test_ocaml_plugin.cmx ../plugins/ocaml/libnbdkitocaml.la ../plugins/ocaml/NBDKit.cmi ../plugins/ocaml/NBDKit.cmx
676 $(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../plugins/ocaml \
677 -output-obj -runtime-variant _pic -o $@ \
679 -cclib -L../plugins/ocaml/.libs -cclib -lnbdkitocaml
680 test_ocaml_plugin.cmx: test_ocaml_plugin.ml ../plugins/ocaml/NBDKit.cmi
681 $(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../plugins/ocaml -c $< -o $@
689 test-dump-plugin-example4.sh \
691 LIBGUESTFS_TESTS += test-perl
693 test_perl_SOURCES = test-lang-plugins.c test.h
695 -DLANG='"perl"' -DSCRIPT='"$(srcdir)/test.pl"' \
696 $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
697 test_perl_LDADD = libtest.la $(LIBGUESTFS_LIBS)
701 # python plugin test.
705 test-python-exception.sh \
706 test-shebang-python.sh
707 LIBGUESTFS_TESTS += test-python
709 test_python_SOURCES = test-lang-plugins.c test.h
710 test_python_CFLAGS = \
711 -DLANG='"python"' -DSCRIPT='"$(srcdir)/test.py"' \
712 $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
713 test_python_LDADD = libtest.la $(LIBGUESTFS_LIBS)
720 # Ruby tests are disabled. See "WARNING" section in
721 # plugins/ruby/nbdkit-ruby-plugin.pod
723 #LIBGUESTFS_TESTS += \
725 #TESTS += test-shebang-ruby.sh
726 EXTRA_PROGRAMS += test-ruby
728 test_ruby_SOURCES = test-lang-plugins.c test.h
730 -DLANG='"ruby"' -DSCRIPT='"$(srcdir)/test.rb"' \
731 $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
732 test_ruby_LDADD = libtest.la $(LIBGUESTFS_LIBS)
736 # Shell (sh) plugin test.
737 LIBGUESTFS_TESTS += test-shell
738 check_DATA += test-shell.img
739 CLEANFILES += test-shell.img
741 test_shell_SOURCES = test-lang-plugins.c test.h
742 test_shell_CFLAGS = \
743 -DLANG='"sh"' -DSCRIPT='"$(srcdir)/test-shell.sh"' \
744 $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
745 test_shell_LDADD = libtest.la $(LIBGUESTFS_LIBS)
748 truncate -s 1048576 $@
750 TESTS += test-sh-extents.sh
755 LIBGUESTFS_TESTS += test-tcl
757 test_tcl_SOURCES = test-lang-plugins.c test.h
759 -DLANG='"tcl"' -DSCRIPT='"$(srcdir)/test.tcl"' \
760 $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
761 test_tcl_LDADD = libtest.la $(LIBGUESTFS_LIBS)
768 LIBGUESTFS_TESTS += test-lua
770 test_lua_SOURCES = test-lang-plugins.c test.h
772 -DLANG='"lua"' -DSCRIPT='"$(srcdir)/test.lua"' \
773 $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
774 test_lua_LDADD = libtest.la $(LIBGUESTFS_LIBS)
778 #----------------------------------------------------------------------
781 # Generic test of filter layers.
782 check_PROGRAMS += test-layers
783 TESTS += test-layers.sh test-layers
785 test_layers_SOURCES = \
787 test_layers_CPPFLAGS = \
788 -I$(top_srcdir)/common/include \
789 -I$(top_srcdir)/common/protocol \
790 -I$(top_srcdir)/server
791 test_layers_CFLAGS = \
794 test_layers_LDFLAGS = \
796 test_layers_DEPENDENCIES = \
797 test-layers-plugin.la \
798 test-layers-filter1.la \
799 test-layers-filter2.la \
800 test-layers-filter3.la
802 # check_LTLIBRARIES won't build a shared library (see automake manual).
803 # So we have to do this and add a dependency.
804 noinst_LTLIBRARIES += \
805 test-layers-plugin.la \
806 test-layers-filter1.la \
807 test-layers-filter2.la \
808 test-layers-filter3.la
810 test_layers_plugin_la_SOURCES = \
811 test-layers-plugin.c \
812 $(top_srcdir)/include/nbdkit-plugin.h
813 test_layers_plugin_la_CPPFLAGS = -I$(top_srcdir)/include
814 test_layers_plugin_la_CFLAGS = $(WARNINGS_CFLAGS)
815 # For use of the -rpath option, see:
816 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
817 test_layers_plugin_la_LDFLAGS = \
818 -module -avoid-version -shared -rpath /nowhere
820 test_layers_filter1_la_SOURCES = \
821 test-layers-filter.c \
822 $(top_srcdir)/include/nbdkit-filter.h
823 test_layers_filter1_la_CPPFLAGS = -I$(top_srcdir)/include
824 test_layers_filter1_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter1"'
825 # For use of the -rpath option, see:
826 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
827 test_layers_filter1_la_LDFLAGS = \
828 -module -avoid-version -shared -rpath /nowhere
830 test_layers_filter2_la_SOURCES = \
831 test-layers-filter.c \
832 $(top_srcdir)/include/nbdkit-filter.h
833 test_layers_filter2_la_CPPFLAGS = -I$(top_srcdir)/include
834 test_layers_filter2_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter2"'
835 # For use of the -rpath option, see:
836 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
837 test_layers_filter2_la_LDFLAGS = \
838 -module -avoid-version -shared -rpath /nowhere
840 test_layers_filter3_la_SOURCES = \
841 test-layers-filter.c \
842 $(top_srcdir)/include/nbdkit-filter.h
843 test_layers_filter3_la_CPPFLAGS = -I$(top_srcdir)/include
844 test_layers_filter3_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter3"'
845 # For use of the -rpath option, see:
846 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
847 test_layers_filter3_la_LDFLAGS = \
848 -module -avoid-version -shared -rpath /nowhere
850 # blocksize filter test.
851 TESTS += test-blocksize.sh
857 test-cache-on-read.sh
859 TESTS += test-cache-max-size.sh
867 LIBGUESTFS_TESTS += test-delay
869 test_delay_SOURCES = test-delay.c test.h
870 test_delay_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
871 test_delay_LDADD = libtest.la $(LIBGUESTFS_LIBS)
874 LIBGUESTFS_TESTS += test-error
876 test_error_SOURCES = test-error.c test.h
877 test_error_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
878 test_error_LDADD = libtest.la $(LIBGUESTFS_LIBS)
891 # nozero filter test.
892 TESTS += test-nozero.sh
894 # offset filter test.
895 check_DATA += offset-data
896 CLEANFILES += offset-data
897 LIBGUESTFS_TESTS += test-offset
899 offset-data: generate-offset-data.sh
900 $(srcdir)/generate-offset-data.sh $@
902 test_offset_SOURCES = test-offset.c test.h
903 test_offset_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
904 test_offset_LDADD = libtest.la $(LIBGUESTFS_LIBS)
908 test-offset-extents.sh
910 # partition filter test.
911 TESTS += test-partition1.sh
913 TESTS += test-partition2.sh
921 # readahead filter test.
922 LIBGUESTFS_TESTS += test-readahead
923 TESTS += test-readahead-copy.sh
925 test_readahead_SOURCES = test-readahead.c test.h
926 test_readahead_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
927 test_readahead_LDADD = libtest.la $(LIBGUESTFS_LIBS)
929 # truncate filter tests.
934 test-truncate-extents.sh
940 LIBGUESTFS_TESTS += test-xz
941 check_DATA += disk.xz
942 CLEANFILES += disk.xz
944 test_xz_SOURCES = test-xz.c test.h
945 test_xz_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
946 test_xz_LDADD = libtest.la $(LIBGUESTFS_LIBS)
950 # We choose a very small block size here only for testing. Normally
951 # you should choose a 16M block size.
952 xz --best --block-size=32768 -c disk > $@
957 LIBGUESTFS_TESTS += test-xz-curl
959 test_xz_curl_SOURCES = \
964 test_xz_curl_CFLAGS = \
966 $(LIBGUESTFS_CFLAGS) \
968 test_xz_curl_LDFLAGS = \
970 test_xz_curl_LDADD = \