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-error-triggered.sh \
70 test-file-extents.sh \
77 test-info-address.sh \
82 test-info-conntime.sh \
88 test-linuxdisk-copy-out.sh \
92 test-memory-largest.sh \
93 test-memory-largest-for-qemu.sh \
98 test-null-extents.sh \
99 test_ocaml_plugin.ml \
102 test-offset-extents.sh \
103 test-parallel-file.sh \
104 test-parallel-nbd.sh \
105 test-parallel-sh.sh \
108 test-partitioning1.sh \
109 test-partitioning2.sh \
110 test-partitioning3.sh \
111 test-partitioning4.sh \
112 test-partitioning5.sh \
113 test-partitioning6.sh \
115 test-pattern-largest.sh \
116 test-pattern-largest-for-qemu.sh \
117 test-python-exception.sh \
121 test-rate-dynamic.sh \
123 test-readahead-copy.sh \
125 test-retry-extents.sh \
127 test-retry-readonly.sh \
128 test-retry-reopen-fail.sh \
129 test-retry-zero-flags.sh \
134 test-shebang-perl.sh \
135 test-shebang-python.sh \
136 test-shebang-ruby.sh \
141 test-single-from-file.sh \
143 test-random-sock.sh \
150 test-truncate-extents.sh \
154 test-version-filter.sh \
155 test-version-plugin.sh \
159 # Use 'make check' to run the ordinary tests. To run all the tests
160 # under valgrind, use the following rule:
162 NBDKIT_VALGRIND=1 $(MAKE) check
164 # To run only tests which require root, use:
166 $(MAKE) check TESTS="test-file-block test-swap.sh"
169 # Run a basic check against a real copy of VDDK. You must set
170 # vddkdir to point to the library location, eg:
172 # make check-vddk vddkdir=vmware-vix-disklib-distrib
174 $(MAKE) check TESTS=test-vddk-real.sh
177 #----------------------------------------------------------------------
178 # Basic test variables.
180 # TESTS: Tests that don't have any special requirements.
182 # LIBNBD_TESTS: Tests that link to the libnbd C library should be
183 # added to this variable.
185 # LIBGUESTFS_TESTS: Tests that link to libguestfs C library should be
186 # added to this variable.
188 # check_*, noinst_*, EXTRA_PROGRAMS: Usual automake variables.
189 # Consult the automake manual for the meaning of these.
202 # Ensure we're testing the local copy by running everything through
203 # the nbdkit helper script in the top build directory.
205 # Use the 'direct' backend, and ensure maximum libguestfs debugging.
207 # Enable libnbd debugging.
208 TESTS_ENVIRONMENT = \
209 PATH=$(abs_top_builddir):$(PATH) \
211 LIBGUESTFS_ATTACH_METHOD=appliance \
217 #----------------------------------------------------------------------
218 # Basic server command line and start-up tests.
223 test-dump-config.sh \
229 test-help-plugin.sh \
230 test-version-plugin.sh \
231 test-version-filter.sh \
232 test-dump-plugin.sh \
235 test-single-from-file.sh \
237 test-random-sock.sh \
241 test-socket-activation \
243 test-debug-flags.sh \
249 test-socket-activation \
252 test_socket_activation_SOURCES = test-socket-activation.c
253 test_socket_activation_CPPFLAGS = \
254 -I$(top_srcdir)/common/include \
255 -I$(top_srcdir)/common/protocol \
257 test_socket_activation_CFLAGS = $(WARNINGS_CFLAGS)
261 # Test the header files can be included on their own.
263 test-just-plugin-header \
264 test-just-filter-header
267 test-just-plugin-header \
268 test-just-filter-header
271 test_just_plugin_header_SOURCES = \
272 test-just-plugin-header.c \
274 test_just_plugin_header_CPPFLAGS = \
275 -I$(top_srcdir)/include \
277 test_just_plugin_header_CFLAGS = $(WARNINGS_CFLAGS)
279 test_just_filter_header_SOURCES = \
280 test-just-filter-header.c \
282 test_just_filter_header_CPPFLAGS = \
283 -I$(top_srcdir)/include \
285 test_just_filter_header_CFLAGS = $(WARNINGS_CFLAGS)
288 # This builds a plugin using an ANSI (ISO C90) compiler to ensure that
289 # the header file is compatible. The plugin does nothing very
290 # interesting, it's mainly a compile test.
294 # check_LTLIBRARIES won't build a shared library (see automake manual).
295 # So we have to do this and add a dependency.
296 noinst_LTLIBRARIES += test-ansi-c-plugin.la
297 test-ansi-c.sh: test-ansi-c-plugin.la
299 test_ansi_c_plugin_la_SOURCES = \
300 test-ansi-c-plugin.c \
301 $(top_srcdir)/include/nbdkit-plugin.h \
303 test_ansi_c_plugin_la_CPPFLAGS = \
305 -I$(top_srcdir)/include \
307 test_ansi_c_plugin_la_CFLAGS = $(WARNINGS_CFLAGS)
308 # For use of the -rpath option, see:
309 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
310 test_ansi_c_plugin_la_LDFLAGS = \
311 -module -avoid-version -shared -rpath /nowhere \
313 endif CAN_TEST_ANSI_C
316 # This builds a plugin and a filter using the C++ compiler. They
317 # don't do anything interesting when run.
321 # check_LTLIBRARIES won't build a shared library (see automake manual).
322 # So we have to do this and add a dependency.
323 noinst_LTLIBRARIES += test-cxx-plugin.la test-cxx-filter.la
324 test-cxx.sh: test-cxx-plugin.la test-cxx-filter.la
326 test_cxx_plugin_la_SOURCES = \
327 test-cxx-plugin.cpp \
328 $(top_srcdir)/include/nbdkit-plugin.h \
330 test_cxx_plugin_la_CPPFLAGS = \
331 -I$(top_srcdir)/include \
333 test_cxx_plugin_la_CXXFLAGS = $(WARNINGS_CFLAGS)
334 # For use of the -rpath option, see:
335 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
336 test_cxx_plugin_la_LDFLAGS = \
337 -module -avoid-version -shared -rpath /nowhere \
340 test_cxx_filter_la_SOURCES = \
341 test-cxx-filter.cpp \
342 $(top_srcdir)/include/nbdkit-filter.h \
344 test_cxx_filter_la_CPPFLAGS = \
345 -I$(top_srcdir)/include \
347 test_cxx_filter_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_filter_la_LDFLAGS = \
351 -module -avoid-version -shared -rpath /nowhere \
355 # Exit with parent test.
356 check_PROGRAMS += test-exit-with-parent
357 TESTS += test-exit-with-parent
359 test_exit_with_parent_SOURCES = \
360 test-exit-with-parent.c test.h \
362 test_exit_with_parent_CPPFLAGS = \
363 -I$(top_srcdir)/common/include \
365 test_exit_with_parent_CFLAGS = \
367 $(LIBGUESTFS_CFLAGS) \
370 # PKI files for the TLS tests.
371 check_DATA += pki/.stamp
372 pki/.stamp: $(srcdir)/make-pki.sh
373 SRCDIR=$(srcdir) $(srcdir)/make-pki.sh
375 # PSK keys for the TLS-PSK tests.
376 check_DATA += keys.psk
377 keys.psk: $(srcdir)/make-psk.sh
378 SRCDIR=$(srcdir) $(srcdir)/make-psk.sh
380 # Keys are expensive to recreate so only delete them when we do
381 # ‘make distclean’.
382 DISTCLEANFILES = keys.psk
383 distclean-local: distclean-local-tls
387 #----------------------------------------------------------------------
388 # Tests of C plugins or tests which require plugins.
392 # Common data shared by multiple tests
393 check_DATA += file-data
394 CLEANFILES += file-data
395 file-data: generate-file-data.sh
396 $(srcdir)/generate-file-data.sh $@
398 # While most tests need libguestfs, testing parallel I/O is easier when
399 # using qemu-io to kick off asynchronous requests.
401 test-parallel-file.sh \
402 test-parallel-nbd.sh \
403 test-parallel-sh.sh \
406 # Common test library.
407 check_LTLIBRARIES += libtest.la
408 libtest_la_SOURCES = test.c test.h
409 libtest_la_CFLAGS = $(WARNINGS_CFLAGS)
411 # Basic connection test.
412 LIBNBD_TESTS += test-connect
414 test_connect_SOURCES = test-connect.c
415 test_connect_CFLAGS = $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS)
416 test_connect_LDADD = $(LIBNBD_LIBS)
418 # newstyle protocol test.
419 LIBNBD_TESTS += test-newstyle
421 test_newstyle_SOURCES = test-newstyle.c
422 test_newstyle_CFLAGS = $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS)
423 test_newstyle_LDADD = $(LIBNBD_LIBS)
425 # oldstyle protocol test.
426 LIBNBD_TESTS += test-oldstyle
428 test_oldstyle_SOURCES = test-oldstyle.c
429 test_oldstyle_CFLAGS = $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS)
430 test_oldstyle_LDADD = $(LIBNBD_LIBS)
433 TESTS += test-eflags.sh
436 TESTS += test-export-name.sh
438 # common disk image shared with several tests
443 rm -rf disk.tmp $@ $@-t
445 echo -n "hello,world" > disk.tmp/hello.txt
446 nbdkit -fv -U - linuxdisk disk.tmp size=100M \
447 --run 'qemu-img convert $$nbd $@-t'
453 LIBGUESTFS_TESTS += test-curl
455 test_curl_SOURCES = \
461 test_curl_CPPFLAGS = \
462 -I$(top_srcdir)/common/utils
465 $(LIBGUESTFS_CFLAGS) \
468 test_curl_LDFLAGS = \
469 $(top_builddir)/common/utils/libutils.la \
479 LIBGUESTFS_TESTS += test-data
482 test-data-base64.sh \
483 test-data-extents.sh \
488 test_data_SOURCES = test-data.c test.h
489 test_data_CPPFLAGS = -I$(top_srcdir)/common/include
490 test_data_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
491 test_data_LDADD = libtest.la $(LIBGUESTFS_LIBS)
497 LIBGUESTFS_TESTS += test-ext2
498 check_DATA += ext2.img
499 CLEANFILES += ext2.img
506 mkfs ext4 /dev/sda : \
509 upload $< /disks/disk.img
512 test_ext2_SOURCES = test-ext2.c test.h
513 test_ext2_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
514 test_ext2_LDADD = libtest.la $(LIBGUESTFS_LIBS)
520 LIBNBD_TESTS += test-file
521 LIBGUESTFS_TESTS += test-file-block
523 test_file_SOURCES = test-file.c
524 test_file_CFLAGS = $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS)
525 test_file_LDADD = $(LIBNBD_LIBS)
527 test_file_block_SOURCES = test-file-block.c test.h
528 test_file_block_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
529 test_file_block_LDADD = libtest.la $(LIBGUESTFS_LIBS)
531 TESTS += test-file-extents.sh
533 # floppy plugin test.
534 TESTS += test-floppy.sh
537 TESTS += test-full.sh
541 LIBGUESTFS_TESTS += test-gzip
542 check_DATA += disk.gz
543 CLEANFILES += disk.gz
545 test_gzip_SOURCES = test-gzip.c test.h
546 test_gzip_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
547 test_gzip_LDADD = libtest.la $(LIBGUESTFS_LIBS)
556 test-info-address.sh \
557 test-info-base64.sh \
560 test-info-uptime.sh \
561 test-info-conntime.sh \
569 # linuxdisk plugin test.
572 test-linuxdisk-copy-out.sh \
575 # memory plugin test.
576 LIBGUESTFS_TESTS += test-memory
577 TESTS += test-memory-largest.sh test-memory-largest-for-qemu.sh
579 test_memory_SOURCES = test-memory.c test.h
580 test_memory_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
581 test_memory_LDADD = libtest.la $(LIBGUESTFS_LIBS)
583 # partitioning plugin test.
585 test-partitioning1.sh \
586 test-partitioning2.sh \
587 test-partitioning3.sh \
588 test-partitioning4.sh \
589 test-partitioning5.sh \
590 test-partitioning6.sh \
593 # pattern plugin test.
596 test-pattern-largest.sh \
597 test-pattern-largest-for-qemu.sh \
602 LIBGUESTFS_TESTS += test-nbd
604 test-nbd-extents.sh \
606 test-nbd-tls-psk.sh \
609 test_nbd_SOURCES = test-nbd.c test.h
610 test_nbd_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
611 test_nbd_LDADD = libtest.la $(LIBGUESTFS_LIBS)
612 endif HAVE_NBD_PLUGIN
615 LIBNBD_TESTS += test-null
616 TESTS += test-null-extents.sh
618 test_null_SOURCES = test-null.c
619 test_null_CFLAGS = $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS)
620 test_null_LDADD = $(LIBNBD_LIBS)
622 # random plugin test.
623 LIBNBD_TESTS += test-random
625 test_random_SOURCES = test-random.c
626 test_random_CPPFLAGS = -I $(top_srcdir)/common/include
627 test_random_CFLAGS = $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS)
628 test_random_LDADD = $(LIBNBD_LIBS)
630 # split files plugin test.
631 check_DATA += split1 split2 split3
632 CLEANFILES += split1 split2 split3
635 dd if=$< of=$@-t bs=1 count=100
639 dd if=$< of=$@-t bs=1 count=100 skip=100
643 dd if=$< of=$@-t bs=1 skip=200
645 LIBNBD_TESTS += test-split
647 test_split_SOURCES = test-split.c
648 test_split_CFLAGS = $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS)
649 test_split_LDADD = $(LIBNBD_LIBS)
653 # Uses ‘disk’ so we have to make it conditional on guestfish.
657 ssh/ssh_host_rsa_key ssh/ssh_host_rsa_key.pub \
658 ssh/authorized_keys \
660 SSH_RANDOM_PORT := $(shell bash -c 'echo $$(( 10000 + $$RANDOM ))')
664 ssh/authorized_keys \
667 ssh/ssh_host_rsa_key ssh/ssh_host_rsa_key.pub \
668 ssh/id_rsa ssh/id_rsa.pub \
669 stamp-ssh-host-key stamp-ssh-user-key \
672 ssh/sshd_config: ssh/sshd_config.in Makefile
675 -e 's,__abs_builddir__,$(abs_builddir),g' \
676 -e 's,__RANDOM_PORT__,$(SSH_RANDOM_PORT),g' \
680 ssh/ssh_host_rsa_key ssh/ssh_host_rsa_key.pub: stamp-ssh-host-key
683 rm -f ssh/ssh_host_rsa_key
684 rm -f ssh/ssh_host_rsa_key.pub
685 ssh-keygen -t rsa -f ssh/ssh_host_rsa_key -N ''
688 ssh/authorized_keys: ssh/id_rsa.pub
693 ssh/id_rsa ssh/id_rsa.pub: stamp-ssh-user-key
698 ssh-keygen -t rsa -f ssh/id_rsa -N ''
702 # streaming plugin test.
704 LIBNBD_TESTS += test-streaming
706 test_streaming_SOURCES = test-streaming.c
707 test_streaming_CFLAGS = $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS)
708 test_streaming_LDADD = $(LIBNBD_LIBS)
712 # This only tests that the plugin can be loaded against a
713 # dummy VDDK library, it is not a detailed test.
715 # check_LTLIBRARIES won't build a shared library (see automake manual).
716 # So we have to do this and add a dependency.
717 noinst_LTLIBRARIES += libvixDiskLib.la
723 libvixDiskLib_la_SOURCES = \
726 libvixDiskLib_la_CPPFLAGS = \
727 -I$(top_srcdir)/plugins/vddk \
729 libvixDiskLib_la_CXXFLAGS = $(WARNINGS_CFLAGS)
730 # For use of the -rpath option, see:
731 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
732 libvixDiskLib_la_LDFLAGS = \
733 -shared -version-number 6:0:0 -rpath /nowhere \
738 TESTS += test-zero.sh
740 #----------------------------------------------------------------------
741 # Tests of language plugins.
746 LIBGUESTFS_TESTS += test-ocaml
748 # This is somewhat different from the other tests because we have
749 # to build an actual plugin here.
750 test_ocaml_SOURCES = test-ocaml.c test.h
751 test_ocaml_CFLAGS = \
753 $(LIBGUESTFS_CFLAGS) \
755 test_ocaml_LDADD = libtest.la $(LIBGUESTFS_LIBS)
757 check_SCRIPTS += test-ocaml-plugin.so
758 test-ocaml-plugin.so: test_ocaml_plugin.cmx ../plugins/ocaml/libnbdkitocaml.la ../plugins/ocaml/NBDKit.cmi ../plugins/ocaml/NBDKit.cmx
759 $(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../plugins/ocaml \
760 -output-obj -runtime-variant _pic -o $@ \
762 -cclib -L../plugins/ocaml/.libs -cclib -lnbdkitocaml
763 test_ocaml_plugin.cmx: test_ocaml_plugin.ml ../plugins/ocaml/NBDKit.cmi
764 $(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../plugins/ocaml -c $< -o $@
772 test-dump-plugin-example4.sh \
773 test-shebang-perl.sh \
775 LIBGUESTFS_TESTS += test-perl
777 test_perl_SOURCES = test-lang-plugins.c test.h
779 -DLANG='"perl"' -DSCRIPT='"$(srcdir)/test.pl"' \
781 $(LIBGUESTFS_CFLAGS) \
783 test_perl_LDADD = libtest.la $(LIBGUESTFS_LIBS)
787 # python plugin test.
791 test-python-exception.sh \
792 test-shebang-python.sh \
794 LIBGUESTFS_TESTS += test-python
796 test_python_SOURCES = test-lang-plugins.c test.h
797 test_python_CFLAGS = \
798 -DLANG='"python"' -DSCRIPT='"$(srcdir)/test.py"' \
800 $(LIBGUESTFS_CFLAGS) \
802 test_python_LDADD = libtest.la $(LIBGUESTFS_LIBS)
809 # Ruby tests are disabled. See "WARNING" section in
810 # plugins/ruby/nbdkit-ruby-plugin.pod
812 #LIBGUESTFS_TESTS += \
815 #TESTS += test-shebang-ruby.sh
816 EXTRA_PROGRAMS += test-ruby
818 test_ruby_SOURCES = test-lang-plugins.c test.h
820 -DLANG='"ruby"' -DSCRIPT='"$(srcdir)/test.rb"' \
822 $(LIBGUESTFS_CFLAGS) \
824 test_ruby_LDADD = libtest.la $(LIBGUESTFS_LIBS)
828 # Shell (sh) plugin test.
829 LIBGUESTFS_TESTS += test-shell
830 check_DATA += test-shell.img
831 CLEANFILES += test-shell.img
833 test_shell_SOURCES = test-lang-plugins.c test.h
834 test_shell_CFLAGS = \
835 -DLANG='"sh"' -DSCRIPT='"$(srcdir)/test-shell.sh"' \
837 $(LIBGUESTFS_CFLAGS) \
839 test_shell_LDADD = libtest.la $(LIBGUESTFS_LIBS)
842 truncate -s 1048576 $@
852 LIBGUESTFS_TESTS += test-tcl
854 test_tcl_SOURCES = test-lang-plugins.c test.h
856 -DLANG='"tcl"' -DSCRIPT='"$(srcdir)/test.tcl"' \
858 $(LIBGUESTFS_CFLAGS) \
860 test_tcl_LDADD = libtest.la $(LIBGUESTFS_LIBS)
867 LIBGUESTFS_TESTS += test-lua
869 test_lua_SOURCES = test-lang-plugins.c test.h
871 -DLANG='"lua"' -DSCRIPT='"$(srcdir)/test.lua"' \
873 $(LIBGUESTFS_CFLAGS) \
875 test_lua_LDADD = libtest.la $(LIBGUESTFS_LIBS)
879 #----------------------------------------------------------------------
882 # Generic test of filter layers.
883 check_PROGRAMS += test-layers
884 TESTS += test-layers.sh test-layers
886 test_layers_SOURCES = \
889 test_layers_CPPFLAGS = \
890 -I$(top_srcdir)/common/include \
891 -I$(top_srcdir)/common/protocol \
892 -I$(top_srcdir)/common/utils \
893 -I$(top_srcdir)/server \
895 test_layers_CFLAGS = \
899 test_layers_LDFLAGS = \
902 test_layers_LDADD = \
903 $(top_builddir)/common/utils/libutils.la \
905 test_layers_DEPENDENCIES = \
906 test-layers-plugin.la \
907 test-layers-filter1.la \
908 test-layers-filter2.la \
909 test-layers-filter3.la \
912 # check_LTLIBRARIES won't build a shared library (see automake manual).
913 # So we have to do this and add a dependency.
914 noinst_LTLIBRARIES += \
915 test-layers-plugin.la \
916 test-layers-filter1.la \
917 test-layers-filter2.la \
918 test-layers-filter3.la \
921 test_layers_plugin_la_SOURCES = \
922 test-layers-plugin.c \
923 $(top_srcdir)/include/nbdkit-plugin.h \
925 test_layers_plugin_la_CPPFLAGS = -I$(top_srcdir)/include
926 test_layers_plugin_la_CFLAGS = $(WARNINGS_CFLAGS)
927 # For use of the -rpath option, see:
928 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
929 test_layers_plugin_la_LDFLAGS = \
930 -module -avoid-version -shared -rpath /nowhere \
933 test_layers_filter1_la_SOURCES = \
934 test-layers-filter.c \
935 $(top_srcdir)/include/nbdkit-filter.h \
937 test_layers_filter1_la_CPPFLAGS = -I$(top_srcdir)/include
938 test_layers_filter1_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter1"'
939 # For use of the -rpath option, see:
940 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
941 test_layers_filter1_la_LDFLAGS = \
942 -module -avoid-version -shared -rpath /nowhere \
945 test_layers_filter2_la_SOURCES = \
946 test-layers-filter.c \
947 $(top_srcdir)/include/nbdkit-filter.h \
949 test_layers_filter2_la_CPPFLAGS = -I$(top_srcdir)/include
950 test_layers_filter2_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter2"'
951 # For use of the -rpath option, see:
952 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
953 test_layers_filter2_la_LDFLAGS = \
954 -module -avoid-version -shared -rpath /nowhere \
957 test_layers_filter3_la_SOURCES = \
958 test-layers-filter.c \
959 $(top_srcdir)/include/nbdkit-filter.h \
961 test_layers_filter3_la_CPPFLAGS = -I$(top_srcdir)/include
962 test_layers_filter3_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter3"'
963 # For use of the -rpath option, see:
964 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
965 test_layers_filter3_la_LDFLAGS = \
966 -module -avoid-version -shared -rpath /nowhere \
969 # blocksize filter test.
970 TESTS += test-blocksize.sh
975 test-cache-on-read.sh \
977 TESTS += test-cache-max-size.sh
979 # cacheextents filter test.
980 TESTS += test-cacheextents.sh
988 # delay filter tests.
989 TESTS += test-shutdown.sh
990 LIBNBD_TESTS += test-delay
992 test_delay_SOURCES = test-delay.c
993 test_delay_CFLAGS = $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS)
994 test_delay_LDADD = $(LIBNBD_LIBS)
1001 test-error-triggered.sh \
1005 TESTS += test-fua.sh
1008 TESTS += test-ip-filter.sh
1011 TESTS += test-log.sh
1014 # nozero filter test.
1015 TESTS += test-nozero.sh
1016 endif HAVE_NBD_PLUGIN
1018 # offset filter test.
1019 LIBGUESTFS_TESTS += test-offset
1021 test_offset_SOURCES = test-offset.c test.h
1022 test_offset_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1023 test_offset_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1027 test-offset-extents.sh \
1030 # partition filter test.
1031 TESTS += test-partition1.sh
1032 TESTS += test-partition2.sh
1037 test-rate-dynamic.sh \
1040 # readahead filter test.
1041 LIBGUESTFS_TESTS += test-readahead
1042 TESTS += test-readahead-copy.sh
1044 test_readahead_SOURCES = test-readahead.c test.h
1045 test_readahead_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1046 test_readahead_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1048 # retry filter test.
1051 test-retry-readonly.sh \
1052 test-retry-extents.sh \
1053 test-retry-size.sh \
1054 test-retry-reopen-fail.sh \
1055 test-retry-zero-flags.sh \
1058 # truncate filter tests.
1064 test-truncate-extents.sh \
1069 LIBGUESTFS_TESTS += test-xz
1070 check_DATA += disk.xz
1071 CLEANFILES += disk.xz
1073 test_xz_SOURCES = test-xz.c test.h
1074 test_xz_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1075 test_xz_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1079 # We choose a very small block size here only for testing. Normally
1080 # you should choose a 16M block size.
1081 xz --best --block-size=32768 -c disk > $@
1085 LIBGUESTFS_TESTS += test-xz-curl
1087 test_xz_curl_SOURCES = \
1093 test_xz_curl_CPPFLAGS = \
1094 -I$(top_srcdir)/common/utils
1095 test_xz_curl_CFLAGS = \
1096 $(WARNINGS_CFLAGS) \
1097 $(LIBGUESTFS_CFLAGS) \
1100 test_xz_curl_LDFLAGS = \
1101 $(top_builddir)/common/utils/libutils.la \
1104 test_xz_curl_LDADD = \
1106 $(LIBGUESTFS_LIBS) \
1114 #----------------------------------------------------------------------
1117 check_PROGRAMS += $(LIBNBD_TESTS)
1118 TESTS += $(LIBNBD_TESTS)
1122 check_PROGRAMS += $(LIBGUESTFS_TESTS)
1123 TESTS += $(LIBGUESTFS_TESTS)
1124 endif HAVE_LIBGUESTFS