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 \
124 test-retry-readonly.sh \
125 test-retry-reopen-fail.sh \
129 test-shebang-perl.sh \
130 test-shebang-python.sh \
131 test-shebang-ruby.sh \
136 test-single-from-file.sh \
138 test-random-sock.sh \
145 test-truncate-extents.sh \
149 test-version-filter.sh \
150 test-version-plugin.sh \
154 # Use 'make check' to run the ordinary tests. To run all the tests
155 # under valgrind, use the following rule:
157 NBDKIT_VALGRIND=1 $(MAKE) check
159 # To run only tests which require root, use:
161 $(MAKE) check TESTS="test-file-block"
163 # Run a basic check against a real copy of VDDK. You must set
164 # vddkdir to point to the library location, eg:
166 # make check-vddk vddkdir=vmware-vix-disklib-distrib
168 $(MAKE) check TESTS=test-vddk-real.sh
170 #----------------------------------------------------------------------
171 # Basic server command line and start-up tests.
179 # Ensure we're testing the local copy by running everything through
180 # the nbdkit helper script in the top build directory.
181 TESTS_ENVIRONMENT = PATH=$(abs_top_builddir):$(PATH) SRCDIR=$(srcdir)
186 test-dump-config.sh \
192 test-help-plugin.sh \
193 test-version-plugin.sh \
194 test-version-filter.sh \
195 test-dump-plugin.sh \
198 test-single-from-file.sh \
200 test-random-sock.sh \
204 test-socket-activation \
206 test-debug-flags.sh \
211 test-socket-activation \
214 test_socket_activation_SOURCES = test-socket-activation.c
215 test_socket_activation_CPPFLAGS = \
216 -I$(top_srcdir)/common/protocol \
218 test_socket_activation_CFLAGS = $(WARNINGS_CFLAGS)
222 # Test the header files can be included on their own.
224 test-just-plugin-header \
225 test-just-filter-header
228 test-just-plugin-header \
229 test-just-filter-header
232 test_just_plugin_header_SOURCES = \
233 test-just-plugin-header.c \
235 test_just_plugin_header_CPPFLAGS = \
236 -I$(top_srcdir)/include \
238 test_just_plugin_header_CFLAGS = $(WARNINGS_CFLAGS)
240 test_just_filter_header_SOURCES = \
241 test-just-filter-header.c \
243 test_just_filter_header_CPPFLAGS = \
244 -I$(top_srcdir)/include \
246 test_just_filter_header_CFLAGS = $(WARNINGS_CFLAGS)
249 # This builds a plugin using an ANSI (ISO C90) compiler to ensure that
250 # the header file is compatible. The plugin does nothing very
251 # interesting, it's mainly a compile test.
255 # check_LTLIBRARIES won't build a shared library (see automake manual).
256 # So we have to do this and add a dependency.
257 noinst_LTLIBRARIES += test-ansi-c-plugin.la
258 test-ansi-c.sh: test-ansi-c-plugin.la
260 test_ansi_c_plugin_la_SOURCES = \
261 test-ansi-c-plugin.c \
262 $(top_srcdir)/include/nbdkit-plugin.h \
264 test_ansi_c_plugin_la_CPPFLAGS = \
266 -I$(top_srcdir)/include \
268 test_ansi_c_plugin_la_CFLAGS = $(WARNINGS_CFLAGS)
269 # For use of the -rpath option, see:
270 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
271 test_ansi_c_plugin_la_LDFLAGS = \
272 -module -avoid-version -shared -rpath /nowhere \
274 endif CAN_TEST_ANSI_C
277 # This builds a plugin and a filter using the C++ compiler. They
278 # don't do anything interesting when run.
282 # check_LTLIBRARIES won't build a shared library (see automake manual).
283 # So we have to do this and add a dependency.
284 noinst_LTLIBRARIES += test-cxx-plugin.la test-cxx-filter.la
285 test-cxx.sh: test-cxx-plugin.la test-cxx-filter.la
287 test_cxx_plugin_la_SOURCES = \
288 test-cxx-plugin.cpp \
289 $(top_srcdir)/include/nbdkit-plugin.h \
291 test_cxx_plugin_la_CPPFLAGS = \
292 -I$(top_srcdir)/include \
294 test_cxx_plugin_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_plugin_la_LDFLAGS = \
298 -module -avoid-version -shared -rpath /nowhere \
301 test_cxx_filter_la_SOURCES = \
302 test-cxx-filter.cpp \
303 $(top_srcdir)/include/nbdkit-filter.h \
305 test_cxx_filter_la_CPPFLAGS = \
306 -I$(top_srcdir)/include \
308 test_cxx_filter_la_CXXFLAGS = $(WARNINGS_CFLAGS)
309 # For use of the -rpath option, see:
310 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
311 test_cxx_filter_la_LDFLAGS = \
312 -module -avoid-version -shared -rpath /nowhere \
316 # Exit with parent test.
317 check_PROGRAMS += test-exit-with-parent
318 TESTS += test-exit-with-parent
320 test_exit_with_parent_SOURCES = \
321 test-exit-with-parent.c test.h \
323 test_exit_with_parent_CPPFLAGS = \
324 -I$(top_srcdir)/common/include \
326 test_exit_with_parent_CFLAGS = \
328 $(LIBGUESTFS_CFLAGS) \
331 # PKI files for the TLS tests.
332 check_DATA += pki/.stamp
333 pki/.stamp: $(srcdir)/make-pki.sh
334 SRCDIR=$(srcdir) $(srcdir)/make-pki.sh
336 # PSK keys for the TLS-PSK tests.
337 check_DATA += keys.psk
338 keys.psk: $(srcdir)/make-psk.sh
339 SRCDIR=$(srcdir) $(srcdir)/make-psk.sh
341 # Keys are expensive to recreate so only delete them when we do
342 # ‘make distclean’.
343 DISTCLEANFILES = keys.psk
344 distclean-local: distclean-local-tls
348 #----------------------------------------------------------------------
349 # Tests of C plugins or tests which require plugins.
353 # Common data shared by multiple tests
354 check_DATA += file-data
355 CLEANFILES += file-data
356 file-data: generate-file-data.sh
357 $(srcdir)/generate-file-data.sh $@
359 # While most tests need libguestfs, testing parallel I/O is easier when
360 # using qemu-io to kick off asynchronous requests.
362 test-parallel-file.sh \
363 test-parallel-nbd.sh \
364 test-parallel-sh.sh \
367 # Most in-depth tests need libguestfs, since that is a convenient way to
372 check_PROGRAMS += $(LIBGUESTFS_TESTS)
373 TESTS += $(LIBGUESTFS_TESTS)
375 # Use the 'direct' backend, and ensure maximum libguestfs and libnbd
376 # debugging is written to the *.log files in case there is a problem.
377 TESTS_ENVIRONMENT += \
378 LIBGUESTFS_ATTACH_METHOD=appliance \
384 # Common test library.
385 check_LTLIBRARIES += libtest.la
386 libtest_la_SOURCES = test.c test.h
387 libtest_la_CFLAGS = $(WARNINGS_CFLAGS)
389 # Basic connection test.
390 LIBGUESTFS_TESTS += test-connect
392 test_connect_SOURCES = test-connect.c test.h
393 test_connect_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
394 test_connect_LDADD = libtest.la $(LIBGUESTFS_LIBS)
396 # newstyle protocol test.
397 LIBGUESTFS_TESTS += test-newstyle
399 test_newstyle_SOURCES = test-newstyle.c test.h
400 test_newstyle_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
401 test_newstyle_LDADD = libtest.la $(LIBGUESTFS_LIBS)
403 # oldstyle protocol test.
404 LIBGUESTFS_TESTS += test-oldstyle
406 test_oldstyle_SOURCES = test-oldstyle.c test.h
407 test_oldstyle_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
408 test_oldstyle_LDADD = libtest.la $(LIBGUESTFS_LIBS)
410 endif HAVE_LIBGUESTFS
413 TESTS += test-eflags.sh
416 TESTS += test-export-name.sh
418 # common disk image shared with several tests
425 guestfish -N $@-t=fs:ext4:100M -m /dev/sda1 \
426 write /hello.txt "hello,world"
437 LIBGUESTFS_TESTS += test-curl
439 test_curl_SOURCES = \
445 test_curl_CPPFLAGS = \
446 -I$(top_srcdir)/common/utils
449 $(LIBGUESTFS_CFLAGS) \
452 test_curl_LDFLAGS = \
453 $(top_builddir)/common/utils/libutils.la \
465 LIBGUESTFS_TESTS += test-data
468 test-data-base64.sh \
469 test-data-extents.sh \
474 test_data_SOURCES = test-data.c test.h
475 test_data_CPPFLAGS = -I$(top_srcdir)/common/include
476 test_data_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
477 test_data_LDADD = libtest.la $(LIBGUESTFS_LIBS)
483 LIBGUESTFS_TESTS += test-ext2
484 check_DATA += ext2.img
485 CLEANFILES += ext2.img
492 mkfs ext4 /dev/sda : \
495 upload $< /disks/disk.img
498 test_ext2_SOURCES = test-ext2.c test.h
499 test_ext2_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
500 test_ext2_LDADD = libtest.la $(LIBGUESTFS_LIBS)
506 LIBGUESTFS_TESTS += test-file test-file-block
508 test_file_SOURCES = test-file.c test.h
509 test_file_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
510 test_file_LDADD = libtest.la $(LIBGUESTFS_LIBS)
512 test_file_block_SOURCES = test-file-block.c test.h
513 test_file_block_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
514 test_file_block_LDADD = libtest.la $(LIBGUESTFS_LIBS)
517 TESTS += test-file-extents.sh
520 # floppy plugin test.
522 TESTS += test-floppy.sh
526 TESTS += test-full.sh
532 LIBGUESTFS_TESTS += test-gzip
533 check_DATA += disk.gz
534 CLEANFILES += disk.gz
536 test_gzip_SOURCES = test-gzip.c test.h
537 test_gzip_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
538 test_gzip_LDADD = libtest.la $(LIBGUESTFS_LIBS)
549 test-info-address.sh \
550 test-info-base64.sh \
553 test-info-uptime.sh \
554 test-info-conntime.sh \
566 # linuxdisk plugin test.
570 test-linuxdisk-copy-out.sh \
574 # memory plugin test.
575 LIBGUESTFS_TESTS += test-memory
576 TESTS += test-memory-largest.sh test-memory-largest-for-qemu.sh
578 test_memory_SOURCES = test-memory.c test.h
579 test_memory_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
580 test_memory_LDADD = libtest.la $(LIBGUESTFS_LIBS)
582 # partitioning plugin test.
584 test-partitioning1.sh \
585 test-partitioning4.sh \
586 test-partitioning6.sh \
590 test-partitioning2.sh \
591 test-partitioning3.sh \
592 test-partitioning5.sh \
596 # pattern plugin test.
599 test-pattern-largest.sh \
600 test-pattern-largest-for-qemu.sh \
604 LIBGUESTFS_TESTS += test-nbd
606 test-nbd-extents.sh \
608 test-nbd-tls-psk.sh \
611 test_nbd_SOURCES = test-nbd.c test.h
612 test_nbd_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
613 test_nbd_LDADD = libtest.la $(LIBGUESTFS_LIBS)
616 LIBGUESTFS_TESTS += test-null
617 TESTS += test-null-extents.sh
619 test_null_SOURCES = test-null.c test.h
620 test_null_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
621 test_null_LDADD = libtest.la $(LIBGUESTFS_LIBS)
623 # random plugin test.
624 LIBGUESTFS_TESTS += test-random
626 test_random_SOURCES = test-random.c test.h
627 test_random_CPPFLAGS = -I $(top_srcdir)/common/include
628 test_random_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
629 test_random_LDADD = libtest.la $(LIBGUESTFS_LIBS)
631 # split files plugin test.
632 check_DATA += split1 split2 split3
633 CLEANFILES += split1 split2 split3
636 dd if=$< of=$@-t bs=1 count=100
640 dd if=$< of=$@-t bs=1 count=100 skip=100
644 dd if=$< of=$@-t bs=1 skip=200
646 LIBGUESTFS_TESTS += test-split
648 test_split_SOURCES = test-split.c test.h
649 test_split_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
650 test_split_LDADD = libtest.la $(LIBGUESTFS_LIBS)
654 # Uses ‘disk’ so we have to make it conditional on guestfish.
660 ssh/ssh_host_rsa_key ssh/ssh_host_rsa_key.pub \
661 ssh/authorized_keys \
663 SSH_RANDOM_PORT := $(shell bash -c 'echo $$(( 10000 + $$RANDOM ))')
667 ssh/authorized_keys \
670 ssh/ssh_host_rsa_key ssh/ssh_host_rsa_key.pub \
671 ssh/id_rsa ssh/id_rsa.pub \
672 stamp-ssh-host-key stamp-ssh-user-key \
675 ssh/sshd_config: ssh/sshd_config.in Makefile
678 -e 's,__abs_builddir__,$(abs_builddir),g' \
679 -e 's,__RANDOM_PORT__,$(SSH_RANDOM_PORT),g' \
683 ssh/ssh_host_rsa_key ssh/ssh_host_rsa_key.pub: stamp-ssh-host-key
686 rm -f ssh/ssh_host_rsa_key
687 rm -f ssh/ssh_host_rsa_key.pub
688 ssh-keygen -t rsa -f ssh/ssh_host_rsa_key -N ''
691 ssh/authorized_keys: ssh/id_rsa.pub
696 ssh/id_rsa ssh/id_rsa.pub: stamp-ssh-user-key
701 ssh-keygen -t rsa -f ssh/id_rsa -N ''
705 # streaming plugin test.
707 #LIBGUESTFS_TESTS += test-streaming
708 EXTRA_PROGRAMS += test-streaming
710 test_streaming_SOURCES = test-streaming.c test.h
711 test_streaming_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
712 test_streaming_LDADD = libtest.la $(LIBGUESTFS_LIBS)
715 # This only tests that the plugin can be loaded against a
716 # dummy VDDK library, it is not a detailed test.
718 # check_LTLIBRARIES won't build a shared library (see automake manual).
719 # So we have to do this and add a dependency.
720 noinst_LTLIBRARIES += libvixDiskLib.la
726 libvixDiskLib_la_SOURCES = \
729 libvixDiskLib_la_CPPFLAGS = \
730 -I$(top_srcdir)/plugins/vddk \
732 libvixDiskLib_la_CXXFLAGS = $(WARNINGS_CFLAGS)
733 # For use of the -rpath option, see:
734 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
735 libvixDiskLib_la_LDFLAGS = \
736 -shared -version-number 6:0:0 -rpath /nowhere \
740 TESTS += test-zero.sh
742 #----------------------------------------------------------------------
743 # Tests of language plugins.
748 LIBGUESTFS_TESTS += test-ocaml
750 # This is somewhat different from the other tests because we have
751 # to build an actual plugin here.
752 test_ocaml_SOURCES = test-ocaml.c test.h
753 test_ocaml_CFLAGS = \
755 $(LIBGUESTFS_CFLAGS) \
757 test_ocaml_LDADD = libtest.la $(LIBGUESTFS_LIBS)
759 check_SCRIPTS += test-ocaml-plugin.so
760 test-ocaml-plugin.so: test_ocaml_plugin.cmx ../plugins/ocaml/libnbdkitocaml.la ../plugins/ocaml/NBDKit.cmi ../plugins/ocaml/NBDKit.cmx
761 $(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../plugins/ocaml \
762 -output-obj -runtime-variant _pic -o $@ \
764 -cclib -L../plugins/ocaml/.libs -cclib -lnbdkitocaml
765 test_ocaml_plugin.cmx: test_ocaml_plugin.ml ../plugins/ocaml/NBDKit.cmi
766 $(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../plugins/ocaml -c $< -o $@
774 test-dump-plugin-example4.sh \
775 test-shebang-perl.sh \
777 LIBGUESTFS_TESTS += test-perl
779 test_perl_SOURCES = test-lang-plugins.c test.h
781 -DLANG='"perl"' -DSCRIPT='"$(srcdir)/test.pl"' \
783 $(LIBGUESTFS_CFLAGS) \
785 test_perl_LDADD = libtest.la $(LIBGUESTFS_LIBS)
789 # python plugin test.
793 test-python-exception.sh \
794 test-shebang-python.sh \
796 LIBGUESTFS_TESTS += test-python
798 test_python_SOURCES = test-lang-plugins.c test.h
799 test_python_CFLAGS = \
800 -DLANG='"python"' -DSCRIPT='"$(srcdir)/test.py"' \
802 $(LIBGUESTFS_CFLAGS) \
804 test_python_LDADD = libtest.la $(LIBGUESTFS_LIBS)
811 # Ruby tests are disabled. See "WARNING" section in
812 # plugins/ruby/nbdkit-ruby-plugin.pod
814 #LIBGUESTFS_TESTS += \
817 #TESTS += test-shebang-ruby.sh
818 EXTRA_PROGRAMS += test-ruby
820 test_ruby_SOURCES = test-lang-plugins.c test.h
822 -DLANG='"ruby"' -DSCRIPT='"$(srcdir)/test.rb"' \
824 $(LIBGUESTFS_CFLAGS) \
826 test_ruby_LDADD = libtest.la $(LIBGUESTFS_LIBS)
830 # Shell (sh) plugin test.
831 LIBGUESTFS_TESTS += test-shell
832 check_DATA += test-shell.img
833 CLEANFILES += test-shell.img
835 test_shell_SOURCES = test-lang-plugins.c test.h
836 test_shell_CFLAGS = \
837 -DLANG='"sh"' -DSCRIPT='"$(srcdir)/test-shell.sh"' \
839 $(LIBGUESTFS_CFLAGS) \
841 test_shell_LDADD = libtest.la $(LIBGUESTFS_LIBS)
844 truncate -s 1048576 $@
854 LIBGUESTFS_TESTS += test-tcl
856 test_tcl_SOURCES = test-lang-plugins.c test.h
858 -DLANG='"tcl"' -DSCRIPT='"$(srcdir)/test.tcl"' \
860 $(LIBGUESTFS_CFLAGS) \
862 test_tcl_LDADD = libtest.la $(LIBGUESTFS_LIBS)
869 LIBGUESTFS_TESTS += test-lua
871 test_lua_SOURCES = test-lang-plugins.c test.h
873 -DLANG='"lua"' -DSCRIPT='"$(srcdir)/test.lua"' \
875 $(LIBGUESTFS_CFLAGS) \
877 test_lua_LDADD = libtest.la $(LIBGUESTFS_LIBS)
881 #----------------------------------------------------------------------
884 # Generic test of filter layers.
885 check_PROGRAMS += test-layers
886 TESTS += test-layers.sh test-layers
888 test_layers_SOURCES = \
891 test_layers_CPPFLAGS = \
892 -I$(top_srcdir)/common/include \
893 -I$(top_srcdir)/common/protocol \
894 -I$(top_srcdir)/common/utils \
895 -I$(top_srcdir)/server \
897 test_layers_CFLAGS = \
901 test_layers_LDFLAGS = \
904 test_layers_LDADD = \
905 $(top_builddir)/common/utils/libutils.la \
907 test_layers_DEPENDENCIES = \
908 test-layers-plugin.la \
909 test-layers-filter1.la \
910 test-layers-filter2.la \
911 test-layers-filter3.la \
914 # check_LTLIBRARIES won't build a shared library (see automake manual).
915 # So we have to do this and add a dependency.
916 noinst_LTLIBRARIES += \
917 test-layers-plugin.la \
918 test-layers-filter1.la \
919 test-layers-filter2.la \
920 test-layers-filter3.la \
923 test_layers_plugin_la_SOURCES = \
924 test-layers-plugin.c \
925 $(top_srcdir)/include/nbdkit-plugin.h \
927 test_layers_plugin_la_CPPFLAGS = -I$(top_srcdir)/include
928 test_layers_plugin_la_CFLAGS = $(WARNINGS_CFLAGS)
929 # For use of the -rpath option, see:
930 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
931 test_layers_plugin_la_LDFLAGS = \
932 -module -avoid-version -shared -rpath /nowhere \
935 test_layers_filter1_la_SOURCES = \
936 test-layers-filter.c \
937 $(top_srcdir)/include/nbdkit-filter.h \
939 test_layers_filter1_la_CPPFLAGS = -I$(top_srcdir)/include
940 test_layers_filter1_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter1"'
941 # For use of the -rpath option, see:
942 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
943 test_layers_filter1_la_LDFLAGS = \
944 -module -avoid-version -shared -rpath /nowhere \
947 test_layers_filter2_la_SOURCES = \
948 test-layers-filter.c \
949 $(top_srcdir)/include/nbdkit-filter.h \
951 test_layers_filter2_la_CPPFLAGS = -I$(top_srcdir)/include
952 test_layers_filter2_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter2"'
953 # For use of the -rpath option, see:
954 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
955 test_layers_filter2_la_LDFLAGS = \
956 -module -avoid-version -shared -rpath /nowhere \
959 test_layers_filter3_la_SOURCES = \
960 test-layers-filter.c \
961 $(top_srcdir)/include/nbdkit-filter.h \
963 test_layers_filter3_la_CPPFLAGS = -I$(top_srcdir)/include
964 test_layers_filter3_la_CFLAGS = $(WARNINGS_CFLAGS) -Dlayer='"filter3"'
965 # For use of the -rpath option, see:
966 # https://lists.gnu.org/archive/html/libtool/2007-07/msg00067.html
967 test_layers_filter3_la_LDFLAGS = \
968 -module -avoid-version -shared -rpath /nowhere \
971 # blocksize filter test.
972 TESTS += test-blocksize.sh
978 test-cache-on-read.sh \
981 TESTS += test-cache-max-size.sh
983 # cacheextents filter test.
984 TESTS += test-cacheextents.sh
990 TESTS += test-cow-null.sh
992 # delay filter tests.
993 TESTS += test-shutdown.sh
994 LIBGUESTFS_TESTS += test-delay
996 test_delay_SOURCES = test-delay.c test.h
997 test_delay_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
998 test_delay_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1000 # error filter test.
1001 LIBGUESTFS_TESTS += test-error
1003 test_error_SOURCES = test-error.c test.h
1004 test_error_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1005 test_error_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1014 TESTS += test-fua.sh
1017 TESTS += test-log.sh
1019 # nozero filter test.
1020 TESTS += test-nozero.sh
1022 # offset filter test.
1023 check_DATA += offset-data
1024 CLEANFILES += offset-data
1025 LIBGUESTFS_TESTS += test-offset
1027 offset-data: generate-offset-data.sh
1028 $(srcdir)/generate-offset-data.sh $@
1030 test_offset_SOURCES = test-offset.c test.h
1031 test_offset_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1032 test_offset_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1036 test-offset-extents.sh \
1039 # partition filter test.
1040 TESTS += test-partition1.sh
1042 TESTS += test-partition2.sh
1043 endif HAVE_GUESTFISH
1048 test-rate-dynamic.sh \
1051 # readahead filter test.
1052 LIBGUESTFS_TESTS += test-readahead
1053 TESTS += test-readahead-copy.sh
1055 test_readahead_SOURCES = test-readahead.c test.h
1056 test_readahead_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1057 test_readahead_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1059 # retry filter test.
1062 test-retry-readonly.sh \
1063 test-retry-extents.sh \
1064 test-retry-reopen-fail.sh \
1067 # truncate filter tests.
1073 test-truncate-extents.sh \
1080 LIBGUESTFS_TESTS += test-xz
1081 check_DATA += disk.xz
1082 CLEANFILES += disk.xz
1084 test_xz_SOURCES = test-xz.c test.h
1085 test_xz_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
1086 test_xz_LDADD = libtest.la $(LIBGUESTFS_LIBS)
1090 # We choose a very small block size here only for testing. Normally
1091 # you should choose a 16M block size.
1092 xz --best --block-size=32768 -c disk > $@
1097 LIBGUESTFS_TESTS += test-xz-curl
1099 test_xz_curl_SOURCES = \
1105 test_xz_curl_CPPFLAGS = \
1106 -I$(top_srcdir)/common/utils
1107 test_xz_curl_CFLAGS = \
1108 $(WARNINGS_CFLAGS) \
1109 $(LIBGUESTFS_CFLAGS) \
1112 test_xz_curl_LDFLAGS = \
1113 $(top_builddir)/common/utils/libutils.la \
1116 test_xz_curl_LDADD = \
1118 $(LIBGUESTFS_LIBS) \
1123 endif HAVE_GUESTFISH