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 \
69 test-file-extents.sh \
76 test-info-address.sh \
81 test-info-conntime.sh \
86 test-linuxdisk-copy-out.sh \
90 test-memory-largest.sh \
91 test-memory-largest-for-qemu.sh \
96 test-null-extents.sh \
97 test_ocaml_plugin.ml \
100 test-offset-extents.sh \
101 test-parallel-file.sh \
102 test-parallel-nbd.sh \
103 test-parallel-sh.sh \
106 test-partitioning1.sh \
107 test-partitioning2.sh \
108 test-partitioning3.sh \
109 test-partitioning4.sh \
110 test-partitioning5.sh \
111 test-partitioning6.sh \
113 test-pattern-largest.sh \
114 test-pattern-largest-for-qemu.sh \
115 test-python-exception.sh \
119 test-rate-dynamic.sh \
121 test-readahead-copy.sh \
123 test-retry-extents.sh \
125 test-retry-readonly.sh \
126 test-retry-reopen-fail.sh \
127 test-retry-zero-flags.sh \
131 test-shebang-perl.sh \
132 test-shebang-python.sh \
133 test-shebang-ruby.sh \
138 test-single-from-file.sh \
140 test-random-sock.sh \
147 test-truncate-extents.sh \
151 test-version-filter.sh \
152 test-version-plugin.sh \
156 # Use 'make check' to run the ordinary tests. To run all the tests
157 # under valgrind, use the following rule:
159 NBDKIT_VALGRIND=1 $(MAKE) check
161 # To run only tests which require root, use:
163 $(MAKE) check TESTS="test-file-block"
166 # Run a basic check against a real copy of VDDK. You must set
167 # vddkdir to point to the library location, eg:
169 # make check-vddk vddkdir=vmware-vix-disklib-distrib
171 $(MAKE) check TESTS=test-vddk-real.sh
174 #----------------------------------------------------------------------
175 # Basic test variables.
177 # TESTS: Tests that don't have any special requirements.
179 # LIBGUESTFS_TESTS: Tests that link to libguestfs C library should be
180 # added to this variable.
182 # check_*, noinst_*, EXTRA_PROGRAMS: Usual automake variables.
183 # Consult the automake manual for the meaning of these.
195 # Ensure we're testing the local copy by running everything through
196 # the nbdkit helper script in the top build directory.
198 # Use the 'direct' backend, and ensure maximum libguestfs debugging.
200 # Enable libnbd debugging.
201 TESTS_ENVIRONMENT = \
202 PATH=$(abs_top_builddir):$(PATH) \
204 LIBGUESTFS_ATTACH_METHOD=appliance \
210 #----------------------------------------------------------------------
211 # Basic server command line and start-up tests.
216 test-dump-config.sh \
222 test-help-plugin.sh \
223 test-version-plugin.sh \
224 test-version-filter.sh \
225 test-dump-plugin.sh \
228 test-single-from-file.sh \
230 test-random-sock.sh \
234 test-socket-activation \
236 test-debug-flags.sh \
241 test-socket-activation \
244 test_socket_activation_SOURCES = test-socket-activation.c
245 test_socket_activation_CPPFLAGS = \
246 -I$(top_srcdir)/common/include \
247 -I$(top_srcdir)/common/protocol \
249 test_socket_activation_CFLAGS = $(WARNINGS_CFLAGS)
253 # Test the header files can be included on their own.
255 test-just-plugin-header \
256 test-just-filter-header
259 test-just-plugin-header \
260 test-just-filter-header
263 test_just_plugin_header_SOURCES = \
264 test-just-plugin-header.c \
266 test_just_plugin_header_CPPFLAGS = \
267 -I$(top_srcdir)/include \
269 test_just_plugin_header_CFLAGS = $(WARNINGS_CFLAGS)
271 test_just_filter_header_SOURCES = \
272 test-just-filter-header.c \
274 test_just_filter_header_CPPFLAGS = \
275 -I$(top_srcdir)/include \
277 test_just_filter_header_CFLAGS = $(WARNINGS_CFLAGS)
280 # This builds a plugin using an ANSI (ISO C90) compiler to ensure that
281 # the header file is compatible. The plugin does nothing very
282 # interesting, it's mainly a compile test.
286 # check_LTLIBRARIES won't build a shared library (see automake manual).
287 # So we have to do this and add a dependency.
288 noinst_LTLIBRARIES += test-ansi-c-plugin.la
289 test-ansi-c.sh: test-ansi-c-plugin.la
291 test_ansi_c_plugin_la_SOURCES = \
292 test-ansi-c-plugin.c \
293 $(top_srcdir)/include/nbdkit-plugin.h \
295 test_ansi_c_plugin_la_CPPFLAGS = \
297 -I$(top_srcdir)/include \
299 test_ansi_c_plugin_la_CFLAGS = $(WARNINGS_CFLAGS)
300 # For use of the -rpath option, see:
301 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
302 test_ansi_c_plugin_la_LDFLAGS = \
303 -module -avoid-version -shared -rpath /nowhere \
305 endif CAN_TEST_ANSI_C
308 # This builds a plugin and a filter using the C++ compiler. They
309 # don't do anything interesting when run.
313 # check_LTLIBRARIES won't build a shared library (see automake manual).
314 # So we have to do this and add a dependency.
315 noinst_LTLIBRARIES += test-cxx-plugin.la test-cxx-filter.la
316 test-cxx.sh: test-cxx-plugin.la test-cxx-filter.la
318 test_cxx_plugin_la_SOURCES = \
319 test-cxx-plugin.cpp \
320 $(top_srcdir)/include/nbdkit-plugin.h \
322 test_cxx_plugin_la_CPPFLAGS = \
323 -I$(top_srcdir)/include \
325 test_cxx_plugin_la_CXXFLAGS = $(WARNINGS_CFLAGS)
326 # For use of the -rpath option, see:
327 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
328 test_cxx_plugin_la_LDFLAGS = \
329 -module -avoid-version -shared -rpath /nowhere \
332 test_cxx_filter_la_SOURCES = \
333 test-cxx-filter.cpp \
334 $(top_srcdir)/include/nbdkit-filter.h \
336 test_cxx_filter_la_CPPFLAGS = \
337 -I$(top_srcdir)/include \
339 test_cxx_filter_la_CXXFLAGS = $(WARNINGS_CFLAGS)
340 # For use of the -rpath option, see:
341 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
342 test_cxx_filter_la_LDFLAGS = \
343 -module -avoid-version -shared -rpath /nowhere \
347 # Exit with parent test.
348 check_PROGRAMS += test-exit-with-parent
349 TESTS += test-exit-with-parent
351 test_exit_with_parent_SOURCES = \
352 test-exit-with-parent.c test.h \
354 test_exit_with_parent_CPPFLAGS = \
355 -I$(top_srcdir)/common/include \
357 test_exit_with_parent_CFLAGS = \
359 $(LIBGUESTFS_CFLAGS) \
362 # PKI files for the TLS tests.
363 check_DATA += pki/.stamp
364 pki/.stamp: $(srcdir)/make-pki.sh
365 SRCDIR=$(srcdir) $(srcdir)/make-pki.sh
367 # PSK keys for the TLS-PSK tests.
368 check_DATA += keys.psk
369 keys.psk: $(srcdir)/make-psk.sh
370 SRCDIR=$(srcdir) $(srcdir)/make-psk.sh
372 # Keys are expensive to recreate so only delete them when we do
373 # ‘make distclean’.
374 DISTCLEANFILES = keys.psk
375 distclean-local: distclean-local-tls
379 #----------------------------------------------------------------------
380 # Tests of C plugins or tests which require plugins.
384 # Common data shared by multiple tests
385 check_DATA += file-data
386 CLEANFILES += file-data
387 file-data: generate-file-data.sh
388 $(srcdir)/generate-file-data.sh $@
390 # While most tests need libguestfs, testing parallel I/O is easier when
391 # using qemu-io to kick off asynchronous requests.
393 test-parallel-file.sh \
394 test-parallel-nbd.sh \
395 test-parallel-sh.sh \
398 # Common test library.
399 check_LTLIBRARIES += libtest.la
400 libtest_la_SOURCES = test.c test.h
401 libtest_la_CFLAGS = $(WARNINGS_CFLAGS)
403 # Basic connection test.
404 LIBGUESTFS_TESTS += test-connect
406 test_connect_SOURCES = test-connect.c test.h
407 test_connect_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
408 test_connect_LDADD = libtest.la $(LIBGUESTFS_LIBS)
410 # newstyle protocol test.
411 LIBGUESTFS_TESTS += test-newstyle
413 test_newstyle_SOURCES = test-newstyle.c test.h
414 test_newstyle_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
415 test_newstyle_LDADD = libtest.la $(LIBGUESTFS_LIBS)
417 # oldstyle protocol test.
418 LIBGUESTFS_TESTS += test-oldstyle
420 test_oldstyle_SOURCES = test-oldstyle.c test.h
421 test_oldstyle_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
422 test_oldstyle_LDADD = libtest.la $(LIBGUESTFS_LIBS)
425 TESTS += test-eflags.sh
428 TESTS += test-export-name.sh
430 # common disk image shared with several tests
437 guestfish -N $@-t=fs:ext4:100M -m /dev/sda1 \
438 write /hello.txt "hello,world"
449 LIBGUESTFS_TESTS += test-curl
451 test_curl_SOURCES = \
457 test_curl_CPPFLAGS = \
458 -I$(top_srcdir)/common/utils
461 $(LIBGUESTFS_CFLAGS) \
464 test_curl_LDFLAGS = \
465 $(top_builddir)/common/utils/libutils.la \
477 LIBGUESTFS_TESTS += test-data
480 test-data-base64.sh \
481 test-data-extents.sh \
486 test_data_SOURCES = test-data.c test.h
487 test_data_CPPFLAGS = -I$(top_srcdir)/common/include
488 test_data_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
489 test_data_LDADD = libtest.la $(LIBGUESTFS_LIBS)
495 LIBGUESTFS_TESTS += test-ext2
496 check_DATA += ext2.img
497 CLEANFILES += ext2.img
504 mkfs ext4 /dev/sda : \
507 upload $< /disks/disk.img
510 test_ext2_SOURCES = test-ext2.c test.h
511 test_ext2_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
512 test_ext2_LDADD = libtest.la $(LIBGUESTFS_LIBS)
518 LIBGUESTFS_TESTS += test-file test-file-block
520 test_file_SOURCES = test-file.c test.h
521 test_file_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
522 test_file_LDADD = libtest.la $(LIBGUESTFS_LIBS)
524 test_file_block_SOURCES = test-file-block.c test.h
525 test_file_block_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
526 test_file_block_LDADD = libtest.la $(LIBGUESTFS_LIBS)
529 TESTS += test-file-extents.sh
532 # floppy plugin test.
533 TESTS += test-floppy.sh
536 TESTS += test-full.sh
542 LIBGUESTFS_TESTS += test-gzip
543 check_DATA += disk.gz
544 CLEANFILES += disk.gz
546 test_gzip_SOURCES = test-gzip.c test.h
547 test_gzip_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
548 test_gzip_LDADD = libtest.la $(LIBGUESTFS_LIBS)
559 test-info-address.sh \
560 test-info-base64.sh \
563 test-info-uptime.sh \
564 test-info-conntime.sh \
572 # linuxdisk plugin test.
575 test-linuxdisk-copy-out.sh \
578 # memory plugin test.
579 LIBGUESTFS_TESTS += test-memory
580 TESTS += test-memory-largest.sh test-memory-largest-for-qemu.sh
582 test_memory_SOURCES = test-memory.c test.h
583 test_memory_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
584 test_memory_LDADD = libtest.la $(LIBGUESTFS_LIBS)
586 # partitioning plugin test.
588 test-partitioning1.sh \
589 test-partitioning2.sh \
590 test-partitioning3.sh \
591 test-partitioning4.sh \
592 test-partitioning5.sh \
593 test-partitioning6.sh \
596 # pattern plugin test.
599 test-pattern-largest.sh \
600 test-pattern-largest-for-qemu.sh \
605 LIBGUESTFS_TESTS += test-nbd
607 test-nbd-extents.sh \
609 test-nbd-tls-psk.sh \
612 test_nbd_SOURCES = test-nbd.c test.h
613 test_nbd_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
614 test_nbd_LDADD = libtest.la $(LIBGUESTFS_LIBS)
615 endif HAVE_NBD_PLUGIN
618 LIBGUESTFS_TESTS += test-null
619 TESTS += test-null-extents.sh
621 test_null_SOURCES = test-null.c test.h
622 test_null_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
623 test_null_LDADD = libtest.la $(LIBGUESTFS_LIBS)
625 # random plugin test.
626 LIBGUESTFS_TESTS += test-random
628 test_random_SOURCES = test-random.c test.h
629 test_random_CPPFLAGS = -I $(top_srcdir)/common/include
630 test_random_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
631 test_random_LDADD = libtest.la $(LIBGUESTFS_LIBS)
633 # split files plugin test.
634 check_DATA += split1 split2 split3
635 CLEANFILES += split1 split2 split3
638 dd if=$< of=$@-t bs=1 count=100
642 dd if=$< of=$@-t bs=1 count=100 skip=100
646 dd if=$< of=$@-t bs=1 skip=200
648 LIBGUESTFS_TESTS += test-split
650 test_split_SOURCES = test-split.c test.h
651 test_split_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
652 test_split_LDADD = libtest.la $(LIBGUESTFS_LIBS)
656 # Uses ‘disk’ so we have to make it conditional on guestfish.
662 ssh/ssh_host_rsa_key ssh/ssh_host_rsa_key.pub \
663 ssh/authorized_keys \
665 SSH_RANDOM_PORT := $(shell bash -c 'echo $$(( 10000 + $$RANDOM ))')
669 ssh/authorized_keys \
672 ssh/ssh_host_rsa_key ssh/ssh_host_rsa_key.pub \
673 ssh/id_rsa ssh/id_rsa.pub \
674 stamp-ssh-host-key stamp-ssh-user-key \
677 ssh/sshd_config: ssh/sshd_config.in Makefile
680 -e 's,__abs_builddir__,$(abs_builddir),g' \
681 -e 's,__RANDOM_PORT__,$(SSH_RANDOM_PORT),g' \
685 ssh/ssh_host_rsa_key ssh/ssh_host_rsa_key.pub: stamp-ssh-host-key
688 rm -f ssh/ssh_host_rsa_key
689 rm -f ssh/ssh_host_rsa_key.pub
690 ssh-keygen -t rsa -f ssh/ssh_host_rsa_key -N ''
693 ssh/authorized_keys: ssh/id_rsa.pub
698 ssh/id_rsa ssh/id_rsa.pub: stamp-ssh-user-key
703 ssh-keygen -t rsa -f ssh/id_rsa -N ''
707 # streaming plugin test.
709 #LIBGUESTFS_TESTS += test-streaming
710 EXTRA_PROGRAMS += test-streaming
712 test_streaming_SOURCES = test-streaming.c test.h
713 test_streaming_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
714 test_streaming_LDADD = libtest.la $(LIBGUESTFS_LIBS)
718 # This only tests that the plugin can be loaded against a
719 # dummy VDDK library, it is not a detailed test.
721 # check_LTLIBRARIES won't build a shared library (see automake manual).
722 # So we have to do this and add a dependency.
723 noinst_LTLIBRARIES += libvixDiskLib.la
729 libvixDiskLib_la_SOURCES = \
732 libvixDiskLib_la_CPPFLAGS = \
733 -I$(top_srcdir)/plugins/vddk \
735 libvixDiskLib_la_CXXFLAGS = $(WARNINGS_CFLAGS)
736 # For use of the -rpath option, see:
737 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
738 libvixDiskLib_la_LDFLAGS = \
739 -shared -version-number 6:0:0 -rpath /nowhere \
744 TESTS += test-zero.sh
746 #----------------------------------------------------------------------
747 # Tests of language plugins.
752 LIBGUESTFS_TESTS += test-ocaml
754 # This is somewhat different from the other tests because we have
755 # to build an actual plugin here.
756 test_ocaml_SOURCES = test-ocaml.c test.h
757 test_ocaml_CFLAGS = \
759 $(LIBGUESTFS_CFLAGS) \
761 test_ocaml_LDADD = libtest.la $(LIBGUESTFS_LIBS)
763 check_SCRIPTS += test-ocaml-plugin.so
764 test-ocaml-plugin.so: test_ocaml_plugin.cmx ../plugins/ocaml/libnbdkitocaml.la ../plugins/ocaml/NBDKit.cmi ../plugins/ocaml/NBDKit.cmx
765 $(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../plugins/ocaml \
766 -output-obj -runtime-variant _pic -o $@ \
768 -cclib -L../plugins/ocaml/.libs -cclib -lnbdkitocaml
769 test_ocaml_plugin.cmx: test_ocaml_plugin.ml ../plugins/ocaml/NBDKit.cmi
770 $(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../plugins/ocaml -c $< -o $@
778 test-dump-plugin-example4.sh \
779 test-shebang-perl.sh \
781 LIBGUESTFS_TESTS += test-perl
783 test_perl_SOURCES = test-lang-plugins.c test.h
785 -DLANG='"perl"' -DSCRIPT='"$(srcdir)/test.pl"' \
787 $(LIBGUESTFS_CFLAGS) \
789 test_perl_LDADD = libtest.la $(LIBGUESTFS_LIBS)
793 # python plugin test.
797 test-python-exception.sh \
798 test-shebang-python.sh \
800 LIBGUESTFS_TESTS += test-python
802 test_python_SOURCES = test-lang-plugins.c test.h
803 test_python_CFLAGS = \
804 -DLANG='"python"' -DSCRIPT='"$(srcdir)/test.py"' \
806 $(LIBGUESTFS_CFLAGS) \
808 test_python_LDADD = libtest.la $(LIBGUESTFS_LIBS)
815 # Ruby tests are disabled. See "WARNING" section in
816 # plugins/ruby/nbdkit-ruby-plugin.pod
818 #LIBGUESTFS_TESTS += \
821 #TESTS += test-shebang-ruby.sh
822 EXTRA_PROGRAMS += test-ruby
824 test_ruby_SOURCES = test-lang-plugins.c test.h
826 -DLANG='"ruby"' -DSCRIPT='"$(srcdir)/test.rb"' \
828 $(LIBGUESTFS_CFLAGS) \
830 test_ruby_LDADD = libtest.la $(LIBGUESTFS_LIBS)
834 # Shell (sh) plugin test.
835 LIBGUESTFS_TESTS += test-shell
836 check_DATA += test-shell.img
837 CLEANFILES += test-shell.img
839 test_shell_SOURCES = test-lang-plugins.c test.h
840 test_shell_CFLAGS = \
841 -DLANG='"sh"' -DSCRIPT='"$(srcdir)/test-shell.sh"' \
843 $(LIBGUESTFS_CFLAGS) \
845 test_shell_LDADD = libtest.la $(LIBGUESTFS_LIBS)
848 truncate -s 1048576 $@
858 LIBGUESTFS_TESTS += test-tcl
860 test_tcl_SOURCES = test-lang-plugins.c test.h
862 -DLANG='"tcl"' -DSCRIPT='"$(srcdir)/test.tcl"' \
864 $(LIBGUESTFS_CFLAGS) \
866 test_tcl_LDADD = libtest.la $(LIBGUESTFS_LIBS)
873 LIBGUESTFS_TESTS += test-lua
875 test_lua_SOURCES = test-lang-plugins.c test.h
877 -DLANG='"lua"' -DSCRIPT='"$(srcdir)/test.lua"' \
879 $(LIBGUESTFS_CFLAGS) \
881 test_lua_LDADD = libtest.la $(LIBGUESTFS_LIBS)
885 #----------------------------------------------------------------------
888 # Generic test of filter layers.
889 check_PROGRAMS += test-layers
890 TESTS += test-layers.sh test-layers
892 test_layers_SOURCES = \
895 test_layers_CPPFLAGS = \
896 -I$(top_srcdir)/common/include \
897 -I$(top_srcdir)/common/protocol \
898 -I$(top_srcdir)/common/utils \
899 -I$(top_srcdir)/server \
901 test_layers_CFLAGS = \
905 test_layers_LDFLAGS = \
908 test_layers_LDADD = \
909 $(top_builddir)/common/utils/libutils.la \
911 test_layers_DEPENDENCIES = \
912 test-layers-plugin.la \
913 test-layers-filter1.la \
914 test-layers-filter2.la \
915 test-layers-filter3.la \
918 # check_LTLIBRARIES won't build a shared library (see automake manual).
919 # So we have to do this and add a dependency.
920 noinst_LTLIBRARIES += \
921 test-layers-plugin.la \
922 test-layers-filter1.la \
923 test-layers-filter2.la \
924 test-layers-filter3.la \
927 test_layers_plugin_la_SOURCES = \
928 test-layers-plugin.c \
929 $(top_srcdir)/include/nbdkit-plugin.h \
931 test_layers_plugin_la_CPPFLAGS = -I$(top_srcdir)/include
932 test_layers_plugin_la_CFLAGS = $(WARNINGS_CFLAGS)
933 # For use of the -rpath option, see:
934 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
935 test_layers_plugin_la_LDFLAGS = \
936 -module -avoid-version -shared -rpath /nowhere \
939 test_layers_filter1_la_SOURCES = \
940 test-layers-filter.c \
941 $(top_srcdir)/include/nbdkit-filter.h \
943 test_layers_filter1_la_CPPFLAGS = -I$(top_srcdir)/include
944 test_layers_filter1_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter1"'
945 # For use of the -rpath option, see:
946 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
947 test_layers_filter1_la_LDFLAGS = \
948 -module -avoid-version -shared -rpath /nowhere \
951 test_layers_filter2_la_SOURCES = \
952 test-layers-filter.c \
953 $(top_srcdir)/include/nbdkit-filter.h \
955 test_layers_filter2_la_CPPFLAGS = -I$(top_srcdir)/include
956 test_layers_filter2_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter2"'
957 # For use of the -rpath option, see:
958 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
959 test_layers_filter2_la_LDFLAGS = \
960 -module -avoid-version -shared -rpath /nowhere \
963 test_layers_filter3_la_SOURCES = \
964 test-layers-filter.c \
965 $(top_srcdir)/include/nbdkit-filter.h \
967 test_layers_filter3_la_CPPFLAGS = -I$(top_srcdir)/include
968 test_layers_filter3_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter3"'
969 # For use of the -rpath option, see:
970 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
971 test_layers_filter3_la_LDFLAGS = \
972 -module -avoid-version -shared -rpath /nowhere \
975 # blocksize filter test.
976 TESTS += test-blocksize.sh
981 test-cache-on-read.sh \
983 TESTS += test-cache-max-size.sh
985 # cacheextents filter test.
986 TESTS += test-cacheextents.sh
994 # delay filter tests.
995 TESTS += test-shutdown.sh
996 LIBGUESTFS_TESTS += test-delay
998 test_delay_SOURCES = test-delay.c test.h
999 test_delay_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1000 test_delay_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1002 # error filter test.
1003 LIBGUESTFS_TESTS += test-error
1005 test_error_SOURCES = test-error.c test.h
1006 test_error_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1007 test_error_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1016 TESTS += test-fua.sh
1019 TESTS += test-log.sh
1022 # nozero filter test.
1023 TESTS += test-nozero.sh
1024 endif HAVE_NBD_PLUGIN
1026 # offset filter test.
1027 check_DATA += offset-data
1028 CLEANFILES += offset-data
1029 LIBGUESTFS_TESTS += test-offset
1031 offset-data: generate-offset-data.sh
1032 $(srcdir)/generate-offset-data.sh $@
1034 test_offset_SOURCES = test-offset.c test.h
1035 test_offset_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1036 test_offset_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1040 test-offset-extents.sh \
1043 # partition filter test.
1044 TESTS += test-partition1.sh
1046 TESTS += test-partition2.sh
1047 endif HAVE_GUESTFISH
1052 test-rate-dynamic.sh \
1055 # readahead filter test.
1056 LIBGUESTFS_TESTS += test-readahead
1057 TESTS += test-readahead-copy.sh
1059 test_readahead_SOURCES = test-readahead.c test.h
1060 test_readahead_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1061 test_readahead_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1063 # retry filter test.
1066 test-retry-readonly.sh \
1067 test-retry-extents.sh \
1068 test-retry-size.sh \
1069 test-retry-reopen-fail.sh \
1070 test-retry-zero-flags.sh \
1073 # truncate filter tests.
1079 test-truncate-extents.sh \
1086 LIBGUESTFS_TESTS += test-xz
1087 check_DATA += disk.xz
1088 CLEANFILES += disk.xz
1090 test_xz_SOURCES = test-xz.c test.h
1091 test_xz_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1092 test_xz_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1096 # We choose a very small block size here only for testing. Normally
1097 # you should choose a 16M block size.
1098 xz --best --block-size=32768 -c disk > $@
1103 LIBGUESTFS_TESTS += test-xz-curl
1105 test_xz_curl_SOURCES = \
1111 test_xz_curl_CPPFLAGS = \
1112 -I$(top_srcdir)/common/utils
1113 test_xz_curl_CFLAGS = \
1114 $(WARNINGS_CFLAGS) \
1115 $(LIBGUESTFS_CFLAGS) \
1118 test_xz_curl_LDFLAGS = \
1119 $(top_builddir)/common/utils/libutils.la \
1122 test_xz_curl_LDADD = \
1124 $(LIBGUESTFS_LIBS) \
1129 endif HAVE_GUESTFISH
1134 #----------------------------------------------------------------------
1137 check_PROGRAMS += $(LIBGUESTFS_TESTS)
1138 TESTS += $(LIBGUESTFS_TESTS)
1139 endif HAVE_LIBGUESTFS