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"
165 # Run a basic check against a real copy of VDDK. You must set
166 # vddkdir to point to the library location, eg:
168 # make check-vddk vddkdir=vmware-vix-disklib-distrib
170 $(MAKE) check TESTS=test-vddk-real.sh
172 #----------------------------------------------------------------------
173 # Basic server command line and start-up tests.
181 # Ensure we're testing the local copy by running everything through
182 # the nbdkit helper script in the top build directory.
183 TESTS_ENVIRONMENT = PATH=$(abs_top_builddir):$(PATH) SRCDIR=$(srcdir)
188 test-dump-config.sh \
194 test-help-plugin.sh \
195 test-version-plugin.sh \
196 test-version-filter.sh \
197 test-dump-plugin.sh \
200 test-single-from-file.sh \
202 test-random-sock.sh \
206 test-socket-activation \
208 test-debug-flags.sh \
213 test-socket-activation \
216 test_socket_activation_SOURCES = test-socket-activation.c
217 test_socket_activation_CPPFLAGS = \
218 -I$(top_srcdir)/common/protocol \
220 test_socket_activation_CFLAGS = $(WARNINGS_CFLAGS)
224 # Test the header files can be included on their own.
226 test-just-plugin-header \
227 test-just-filter-header
230 test-just-plugin-header \
231 test-just-filter-header
234 test_just_plugin_header_SOURCES = \
235 test-just-plugin-header.c \
237 test_just_plugin_header_CPPFLAGS = \
238 -I$(top_srcdir)/include \
240 test_just_plugin_header_CFLAGS = $(WARNINGS_CFLAGS)
242 test_just_filter_header_SOURCES = \
243 test-just-filter-header.c \
245 test_just_filter_header_CPPFLAGS = \
246 -I$(top_srcdir)/include \
248 test_just_filter_header_CFLAGS = $(WARNINGS_CFLAGS)
251 # This builds a plugin using an ANSI (ISO C90) compiler to ensure that
252 # the header file is compatible. The plugin does nothing very
253 # interesting, it's mainly a compile test.
257 # check_LTLIBRARIES won't build a shared library (see automake manual).
258 # So we have to do this and add a dependency.
259 noinst_LTLIBRARIES += test-ansi-c-plugin.la
260 test-ansi-c.sh: test-ansi-c-plugin.la
262 test_ansi_c_plugin_la_SOURCES = \
263 test-ansi-c-plugin.c \
264 $(top_srcdir)/include/nbdkit-plugin.h \
266 test_ansi_c_plugin_la_CPPFLAGS = \
268 -I$(top_srcdir)/include \
270 test_ansi_c_plugin_la_CFLAGS = $(WARNINGS_CFLAGS)
271 # For use of the -rpath option, see:
272 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
273 test_ansi_c_plugin_la_LDFLAGS = \
274 -module -avoid-version -shared -rpath /nowhere \
276 endif CAN_TEST_ANSI_C
279 # This builds a plugin and a filter using the C++ compiler. They
280 # don't do anything interesting when run.
284 # check_LTLIBRARIES won't build a shared library (see automake manual).
285 # So we have to do this and add a dependency.
286 noinst_LTLIBRARIES += test-cxx-plugin.la test-cxx-filter.la
287 test-cxx.sh: test-cxx-plugin.la test-cxx-filter.la
289 test_cxx_plugin_la_SOURCES = \
290 test-cxx-plugin.cpp \
291 $(top_srcdir)/include/nbdkit-plugin.h \
293 test_cxx_plugin_la_CPPFLAGS = \
294 -I$(top_srcdir)/include \
296 test_cxx_plugin_la_CXXFLAGS = $(WARNINGS_CFLAGS)
297 # For use of the -rpath option, see:
298 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
299 test_cxx_plugin_la_LDFLAGS = \
300 -module -avoid-version -shared -rpath /nowhere \
303 test_cxx_filter_la_SOURCES = \
304 test-cxx-filter.cpp \
305 $(top_srcdir)/include/nbdkit-filter.h \
307 test_cxx_filter_la_CPPFLAGS = \
308 -I$(top_srcdir)/include \
310 test_cxx_filter_la_CXXFLAGS = $(WARNINGS_CFLAGS)
311 # For use of the -rpath option, see:
312 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
313 test_cxx_filter_la_LDFLAGS = \
314 -module -avoid-version -shared -rpath /nowhere \
318 # Exit with parent test.
319 check_PROGRAMS += test-exit-with-parent
320 TESTS += test-exit-with-parent
322 test_exit_with_parent_SOURCES = \
323 test-exit-with-parent.c test.h \
325 test_exit_with_parent_CPPFLAGS = \
326 -I$(top_srcdir)/common/include \
328 test_exit_with_parent_CFLAGS = \
330 $(LIBGUESTFS_CFLAGS) \
333 # PKI files for the TLS tests.
334 check_DATA += pki/.stamp
335 pki/.stamp: $(srcdir)/make-pki.sh
336 SRCDIR=$(srcdir) $(srcdir)/make-pki.sh
338 # PSK keys for the TLS-PSK tests.
339 check_DATA += keys.psk
340 keys.psk: $(srcdir)/make-psk.sh
341 SRCDIR=$(srcdir) $(srcdir)/make-psk.sh
343 # Keys are expensive to recreate so only delete them when we do
344 # ‘make distclean’.
345 DISTCLEANFILES = keys.psk
346 distclean-local: distclean-local-tls
350 #----------------------------------------------------------------------
351 # Tests of C plugins or tests which require plugins.
355 # Common data shared by multiple tests
356 check_DATA += file-data
357 CLEANFILES += file-data
358 file-data: generate-file-data.sh
359 $(srcdir)/generate-file-data.sh $@
361 # While most tests need libguestfs, testing parallel I/O is easier when
362 # using qemu-io to kick off asynchronous requests.
364 test-parallel-file.sh \
365 test-parallel-nbd.sh \
366 test-parallel-sh.sh \
369 # Most in-depth tests need libguestfs, since that is a convenient way to
374 check_PROGRAMS += $(LIBGUESTFS_TESTS)
375 TESTS += $(LIBGUESTFS_TESTS)
377 # Use the 'direct' backend, and ensure maximum libguestfs and libnbd
378 # debugging is written to the *.log files in case there is a problem.
379 TESTS_ENVIRONMENT += \
380 LIBGUESTFS_ATTACH_METHOD=appliance \
386 # Common test library.
387 check_LTLIBRARIES += libtest.la
388 libtest_la_SOURCES = test.c test.h
389 libtest_la_CFLAGS = $(WARNINGS_CFLAGS)
391 # Basic connection test.
392 LIBGUESTFS_TESTS += test-connect
394 test_connect_SOURCES = test-connect.c test.h
395 test_connect_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
396 test_connect_LDADD = libtest.la $(LIBGUESTFS_LIBS)
398 # newstyle protocol test.
399 LIBGUESTFS_TESTS += test-newstyle
401 test_newstyle_SOURCES = test-newstyle.c test.h
402 test_newstyle_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
403 test_newstyle_LDADD = libtest.la $(LIBGUESTFS_LIBS)
405 # oldstyle protocol test.
406 LIBGUESTFS_TESTS += test-oldstyle
408 test_oldstyle_SOURCES = test-oldstyle.c test.h
409 test_oldstyle_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
410 test_oldstyle_LDADD = libtest.la $(LIBGUESTFS_LIBS)
412 endif HAVE_LIBGUESTFS
415 TESTS += test-eflags.sh
418 TESTS += test-export-name.sh
420 # common disk image shared with several tests
427 guestfish -N $@-t=fs:ext4:100M -m /dev/sda1 \
428 write /hello.txt "hello,world"
439 LIBGUESTFS_TESTS += test-curl
441 test_curl_SOURCES = \
447 test_curl_CPPFLAGS = \
448 -I$(top_srcdir)/common/utils
451 $(LIBGUESTFS_CFLAGS) \
454 test_curl_LDFLAGS = \
455 $(top_builddir)/common/utils/libutils.la \
467 LIBGUESTFS_TESTS += test-data
470 test-data-base64.sh \
471 test-data-extents.sh \
476 test_data_SOURCES = test-data.c test.h
477 test_data_CPPFLAGS = -I$(top_srcdir)/common/include
478 test_data_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
479 test_data_LDADD = libtest.la $(LIBGUESTFS_LIBS)
485 LIBGUESTFS_TESTS += test-ext2
486 check_DATA += ext2.img
487 CLEANFILES += ext2.img
494 mkfs ext4 /dev/sda : \
497 upload $< /disks/disk.img
500 test_ext2_SOURCES = test-ext2.c test.h
501 test_ext2_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
502 test_ext2_LDADD = libtest.la $(LIBGUESTFS_LIBS)
508 LIBGUESTFS_TESTS += test-file test-file-block
510 test_file_SOURCES = test-file.c test.h
511 test_file_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
512 test_file_LDADD = libtest.la $(LIBGUESTFS_LIBS)
514 test_file_block_SOURCES = test-file-block.c test.h
515 test_file_block_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
516 test_file_block_LDADD = libtest.la $(LIBGUESTFS_LIBS)
519 TESTS += test-file-extents.sh
522 # floppy plugin test.
524 TESTS += test-floppy.sh
528 TESTS += test-full.sh
534 LIBGUESTFS_TESTS += test-gzip
535 check_DATA += disk.gz
536 CLEANFILES += disk.gz
538 test_gzip_SOURCES = test-gzip.c test.h
539 test_gzip_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
540 test_gzip_LDADD = libtest.la $(LIBGUESTFS_LIBS)
551 test-info-address.sh \
552 test-info-base64.sh \
555 test-info-uptime.sh \
556 test-info-conntime.sh \
568 # linuxdisk plugin test.
572 test-linuxdisk-copy-out.sh \
576 # memory plugin test.
577 LIBGUESTFS_TESTS += test-memory
578 TESTS += test-memory-largest.sh test-memory-largest-for-qemu.sh
580 test_memory_SOURCES = test-memory.c test.h
581 test_memory_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
582 test_memory_LDADD = libtest.la $(LIBGUESTFS_LIBS)
584 # partitioning plugin test.
586 test-partitioning1.sh \
587 test-partitioning4.sh \
588 test-partitioning6.sh \
592 test-partitioning2.sh \
593 test-partitioning3.sh \
594 test-partitioning5.sh \
598 # pattern plugin test.
601 test-pattern-largest.sh \
602 test-pattern-largest-for-qemu.sh \
606 LIBGUESTFS_TESTS += test-nbd
608 test-nbd-extents.sh \
610 test-nbd-tls-psk.sh \
613 test_nbd_SOURCES = test-nbd.c test.h
614 test_nbd_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
615 test_nbd_LDADD = libtest.la $(LIBGUESTFS_LIBS)
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)
717 # This only tests that the plugin can be loaded against a
718 # dummy VDDK library, it is not a detailed test.
720 # check_LTLIBRARIES won't build a shared library (see automake manual).
721 # So we have to do this and add a dependency.
722 noinst_LTLIBRARIES += libvixDiskLib.la
728 libvixDiskLib_la_SOURCES = \
731 libvixDiskLib_la_CPPFLAGS = \
732 -I$(top_srcdir)/plugins/vddk \
734 libvixDiskLib_la_CXXFLAGS = $(WARNINGS_CFLAGS)
735 # For use of the -rpath option, see:
736 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
737 libvixDiskLib_la_LDFLAGS = \
738 -shared -version-number 6:0:0 -rpath /nowhere \
742 TESTS += test-zero.sh
744 #----------------------------------------------------------------------
745 # Tests of language plugins.
750 LIBGUESTFS_TESTS += test-ocaml
752 # This is somewhat different from the other tests because we have
753 # to build an actual plugin here.
754 test_ocaml_SOURCES = test-ocaml.c test.h
755 test_ocaml_CFLAGS = \
757 $(LIBGUESTFS_CFLAGS) \
759 test_ocaml_LDADD = libtest.la $(LIBGUESTFS_LIBS)
761 check_SCRIPTS += test-ocaml-plugin.so
762 test-ocaml-plugin.so: test_ocaml_plugin.cmx ../plugins/ocaml/libnbdkitocaml.la ../plugins/ocaml/NBDKit.cmi ../plugins/ocaml/NBDKit.cmx
763 $(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../plugins/ocaml \
764 -output-obj -runtime-variant _pic -o $@ \
766 -cclib -L../plugins/ocaml/.libs -cclib -lnbdkitocaml
767 test_ocaml_plugin.cmx: test_ocaml_plugin.ml ../plugins/ocaml/NBDKit.cmi
768 $(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../plugins/ocaml -c $< -o $@
776 test-dump-plugin-example4.sh \
777 test-shebang-perl.sh \
779 LIBGUESTFS_TESTS += test-perl
781 test_perl_SOURCES = test-lang-plugins.c test.h
783 -DLANG='"perl"' -DSCRIPT='"$(srcdir)/test.pl"' \
785 $(LIBGUESTFS_CFLAGS) \
787 test_perl_LDADD = libtest.la $(LIBGUESTFS_LIBS)
791 # python plugin test.
795 test-python-exception.sh \
796 test-shebang-python.sh \
798 LIBGUESTFS_TESTS += test-python
800 test_python_SOURCES = test-lang-plugins.c test.h
801 test_python_CFLAGS = \
802 -DLANG='"python"' -DSCRIPT='"$(srcdir)/test.py"' \
804 $(LIBGUESTFS_CFLAGS) \
806 test_python_LDADD = libtest.la $(LIBGUESTFS_LIBS)
813 # Ruby tests are disabled. See "WARNING" section in
814 # plugins/ruby/nbdkit-ruby-plugin.pod
816 #LIBGUESTFS_TESTS += \
819 #TESTS += test-shebang-ruby.sh
820 EXTRA_PROGRAMS += test-ruby
822 test_ruby_SOURCES = test-lang-plugins.c test.h
824 -DLANG='"ruby"' -DSCRIPT='"$(srcdir)/test.rb"' \
826 $(LIBGUESTFS_CFLAGS) \
828 test_ruby_LDADD = libtest.la $(LIBGUESTFS_LIBS)
832 # Shell (sh) plugin test.
833 LIBGUESTFS_TESTS += test-shell
834 check_DATA += test-shell.img
835 CLEANFILES += test-shell.img
837 test_shell_SOURCES = test-lang-plugins.c test.h
838 test_shell_CFLAGS = \
839 -DLANG='"sh"' -DSCRIPT='"$(srcdir)/test-shell.sh"' \
841 $(LIBGUESTFS_CFLAGS) \
843 test_shell_LDADD = libtest.la $(LIBGUESTFS_LIBS)
846 truncate -s 1048576 $@
856 LIBGUESTFS_TESTS += test-tcl
858 test_tcl_SOURCES = test-lang-plugins.c test.h
860 -DLANG='"tcl"' -DSCRIPT='"$(srcdir)/test.tcl"' \
862 $(LIBGUESTFS_CFLAGS) \
864 test_tcl_LDADD = libtest.la $(LIBGUESTFS_LIBS)
871 LIBGUESTFS_TESTS += test-lua
873 test_lua_SOURCES = test-lang-plugins.c test.h
875 -DLANG='"lua"' -DSCRIPT='"$(srcdir)/test.lua"' \
877 $(LIBGUESTFS_CFLAGS) \
879 test_lua_LDADD = libtest.la $(LIBGUESTFS_LIBS)
883 #----------------------------------------------------------------------
886 # Generic test of filter layers.
887 check_PROGRAMS += test-layers
888 TESTS += test-layers.sh test-layers
890 test_layers_SOURCES = \
893 test_layers_CPPFLAGS = \
894 -I$(top_srcdir)/common/include \
895 -I$(top_srcdir)/common/protocol \
896 -I$(top_srcdir)/common/utils \
897 -I$(top_srcdir)/server \
899 test_layers_CFLAGS = \
903 test_layers_LDFLAGS = \
906 test_layers_LDADD = \
907 $(top_builddir)/common/utils/libutils.la \
909 test_layers_DEPENDENCIES = \
910 test-layers-plugin.la \
911 test-layers-filter1.la \
912 test-layers-filter2.la \
913 test-layers-filter3.la \
916 # check_LTLIBRARIES won't build a shared library (see automake manual).
917 # So we have to do this and add a dependency.
918 noinst_LTLIBRARIES += \
919 test-layers-plugin.la \
920 test-layers-filter1.la \
921 test-layers-filter2.la \
922 test-layers-filter3.la \
925 test_layers_plugin_la_SOURCES = \
926 test-layers-plugin.c \
927 $(top_srcdir)/include/nbdkit-plugin.h \
929 test_layers_plugin_la_CPPFLAGS = -I$(top_srcdir)/include
930 test_layers_plugin_la_CFLAGS = $(WARNINGS_CFLAGS)
931 # For use of the -rpath option, see:
932 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
933 test_layers_plugin_la_LDFLAGS = \
934 -module -avoid-version -shared -rpath /nowhere \
937 test_layers_filter1_la_SOURCES = \
938 test-layers-filter.c \
939 $(top_srcdir)/include/nbdkit-filter.h \
941 test_layers_filter1_la_CPPFLAGS = -I$(top_srcdir)/include
942 test_layers_filter1_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter1"'
943 # For use of the -rpath option, see:
944 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
945 test_layers_filter1_la_LDFLAGS = \
946 -module -avoid-version -shared -rpath /nowhere \
949 test_layers_filter2_la_SOURCES = \
950 test-layers-filter.c \
951 $(top_srcdir)/include/nbdkit-filter.h \
953 test_layers_filter2_la_CPPFLAGS = -I$(top_srcdir)/include
954 test_layers_filter2_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter2"'
955 # For use of the -rpath option, see:
956 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
957 test_layers_filter2_la_LDFLAGS = \
958 -module -avoid-version -shared -rpath /nowhere \
961 test_layers_filter3_la_SOURCES = \
962 test-layers-filter.c \
963 $(top_srcdir)/include/nbdkit-filter.h \
965 test_layers_filter3_la_CPPFLAGS = -I$(top_srcdir)/include
966 test_layers_filter3_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter3"'
967 # For use of the -rpath option, see:
968 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
969 test_layers_filter3_la_LDFLAGS = \
970 -module -avoid-version -shared -rpath /nowhere \
973 # blocksize filter test.
974 TESTS += test-blocksize.sh
980 test-cache-on-read.sh \
983 TESTS += test-cache-max-size.sh
985 # cacheextents filter test.
986 TESTS += test-cacheextents.sh
992 TESTS += test-cow-null.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
1021 # nozero filter test.
1022 TESTS += test-nozero.sh
1024 # offset filter test.
1025 check_DATA += offset-data
1026 CLEANFILES += offset-data
1027 LIBGUESTFS_TESTS += test-offset
1029 offset-data: generate-offset-data.sh
1030 $(srcdir)/generate-offset-data.sh $@
1032 test_offset_SOURCES = test-offset.c test.h
1033 test_offset_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1034 test_offset_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1038 test-offset-extents.sh \
1041 # partition filter test.
1042 TESTS += test-partition1.sh
1044 TESTS += test-partition2.sh
1045 endif HAVE_GUESTFISH
1050 test-rate-dynamic.sh \
1053 # readahead filter test.
1054 LIBGUESTFS_TESTS += test-readahead
1055 TESTS += test-readahead-copy.sh
1057 test_readahead_SOURCES = test-readahead.c test.h
1058 test_readahead_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1059 test_readahead_LDADD = libtest.la $(LIBGUESTFS_LIBS)
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 \
1084 LIBGUESTFS_TESTS += test-xz
1085 check_DATA += disk.xz
1086 CLEANFILES += disk.xz
1088 test_xz_SOURCES = test-xz.c test.h
1089 test_xz_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1090 test_xz_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1094 # We choose a very small block size here only for testing. Normally
1095 # you should choose a 16M block size.
1096 xz --best --block-size=32768 -c disk > $@
1101 LIBGUESTFS_TESTS += test-xz-curl
1103 test_xz_curl_SOURCES = \
1109 test_xz_curl_CPPFLAGS = \
1110 -I$(top_srcdir)/common/utils
1111 test_xz_curl_CFLAGS = \
1112 $(WARNINGS_CFLAGS) \
1113 $(LIBGUESTFS_CFLAGS) \
1116 test_xz_curl_LDFLAGS = \
1117 $(top_builddir)/common/utils/libutils.la \
1120 test_xz_curl_LDADD = \
1122 $(LIBGUESTFS_LIBS) \
1127 endif HAVE_GUESTFISH