Imported Upstream version 3.3.0
[debian/amanda] / installcheck / Makefile.am
1 include $(top_srcdir)/config/automake/vars.am
2 include $(top_srcdir)/config/automake/scripts.am
3 all_tests =
4
5 common_tests = \
6         Amanda_Archive \
7         Amanda_Config \
8         Amanda_Config_FoldingHash \
9         Amanda_ClientService \
10         Amanda_Debug \
11         Amanda_Feature \
12         Amanda_IPC_Binary \
13         Amanda_IPC_LineProtocol \
14         Amanda_MainLoop \
15         Amanda_Header \
16         Amanda_Util \
17         Amanda_Xfer \
18         amarchiver \
19         gnutar
20 all_tests += $(common_tests)
21
22 client_tests = \
23         noop \
24         amgtar \
25         ampgsql \
26         amraw
27 all_tests += $(client_tests)
28
29 server_tests = \
30         Amanda_Changer \
31         Amanda_Changer_compat \
32         Amanda_Changer_disk \
33         Amanda_Changer_multi \
34         Amanda_Changer_null \
35         Amanda_Changer_rait \
36         Amanda_Changer_robot \
37         Amanda_Changer_single \
38         Amanda_Cmdline \
39         Amanda_Curinfo \
40         Amanda_Disklist \
41         Amanda_DB_Catalog \
42         Amanda_Device \
43         Amanda_Holding \
44         Amanda_Logfile \
45         Amanda_Process \
46         Amanda_Recovery_Clerk \
47         Amanda_Recovery_Planner \
48         Amanda_Recovery_Scan \
49         Amanda_Report \
50         Amanda_Tapelist \
51         Amanda_Taper_Scan \
52         Amanda_Taper_Scan_lexical \
53         Amanda_Taper_Scan_oldest \
54         Amanda_Taper_Scan_traditional \
55         Amanda_Taper_Scribe \
56         bigint \
57         taper \
58         amcheck-device \
59         amgetconf \
60         amtape \
61         amlabel \
62         amtapetype \
63         chunker
64 all_tests += $(server_tests)
65
66 full_tests = \
67         =setupcache \
68         amadmin \
69         amcheck \
70         amcheckdump \
71         amdevcheck \
72         amdump \
73         amdump_client \
74         amflush \
75         amoverview \
76         amreport \
77         amrmtape \
78         amserverconfig \
79         amservice \
80         amstatus \
81         amvault \
82         example \
83         pp-scripts
84 all_tests += $(full_tests)
85
86 restore_tests = \
87         amfetchdump \
88         amidxtaped \
89         amrestore
90 all_tests += $(restore_tests)
91
92 restore_tests_no_check_userid = \
93         amrecover
94 all_tests += $(restore_tests_no_check_userid)
95
96 ndmp_tests = \
97         Amanda_Changer_ndmp \
98         Amanda_NDMP
99 all_tests += $(ndmp_tests)
100
101 mock_tests = \
102         mock_mtx
103 all_tests += $(mock_tests)
104
105 # mock scripts
106 mocks = \
107         mock/mail \
108         mock/mtx \
109         mock/lpr
110
111 # data for test scripts
112 test_data = \
113         data/aws-bundle.crt
114 EXTRA_DIST += $(test_data)
115
116 tests =
117
118 # tests requiring neither client nor server
119 tests += $(common_tests)
120 tests += $(mock_tests)
121
122 # tests requiring server
123 if WANT_SERVER
124 tests += $(server_tests)
125 endif
126
127 # tests requiring client
128 if WANT_CLIENT
129 tests += $(client_tests)
130 endif
131
132 # tests requiring a client and a server AND restore facilities (any tests that run amdump)
133 if WANT_SERVER
134 if WANT_CLIENT
135 # tests requiring a client and a server (any tests that run amdump)
136 tests += $(full_tests)
137
138 # tests requiring a client, a server, *and* restore code
139 if WANT_RESTORE
140 tests += $(restore_tests)
141
142 # and tests requiring all that *and* requiring CHECK_USERID is not set
143 if !CHECK_USERID
144 tests += $(restore_tests_no_check_userid)
145 endif
146 endif
147 endif
148 endif
149
150 # tests that need a server with NDMP support
151 if WANT_NDMP
152 if WANT_SERVER
153 tests += $(ndmp_tests)
154 endif
155 endif
156
157 # Add any common files (that should not be run as tests, and that do not
158 # require configure-variable substitution) here:
159 test_utils = \
160         Installcheck.pm \
161         Installcheck/Catalogs.pm \
162         Installcheck/Config.pm \
163         Installcheck/ClientService.pm \
164         Installcheck/Mock.pm \
165         Installcheck/Run.pm \
166         Installcheck/Dumpcache.pm \
167         Installcheck/Application.pm \
168         Installcheck/Changer.pm
169 EXTRA_DIST += $(test_utils)
170
171 # the catalogs themselves
172 catalogs = \
173         catalogs/amflush.cat \
174         catalogs/bigdb.cat \
175         catalogs/bigestimate.cat \
176         catalogs/chunker-partial.cat \
177         catalogs/doublefailure.cat \
178         catalogs/fatal.cat \
179         catalogs/filesystemstaped.cat \
180         catalogs/flush-noorigsize.cat \
181         catalogs/flush-origsize.cat \
182         catalogs/longstrange.cat \
183         catalogs/multi-taper.cat \
184         catalogs/normal.cat \
185         catalogs/plannerfail.cat \
186         catalogs/quoted.cat \
187         catalogs/resultsmissing.cat \
188         catalogs/retried.cat \
189         catalogs/retried-nofinish.cat \
190         catalogs/retried-strange.cat \
191         catalogs/shortstrange.cat \
192         catalogs/skipped.cat \
193         catalogs/spanned.cat \
194         catalogs/strontium.cat \
195         catalogs/taperr.cat
196 EXTRA_DIST += $(catalogs)
197
198
199 # and finally some development utilities
200 noinst_SCRIPTS = \
201         run-ndmp
202
203 CHECK_PERL_FLAGS=-I$(top_srcdir)/installcheck
204
205 SCRIPTS_PERL = $(tests) $(mocks) $(noinst_SCRIPTS)
206 SCRIPTS_EXTRA_DIST = $(all_tests)
207
208 # skip syntax checks on these files, since we're about to run all of them
209 SKIP_CHECKS = yes
210
211 .PHONY: clobber_my_config_is_ok
212 clobber_my_config_is_ok:
213         @if test "$(CONFIG_CLOBBER_MY_CONFIG)" != "OK" -a \
214                  "$(CLOBBER_MY_CONFIG)" != "OK"; then \
215                 echo ""; \
216                 echo "'make installcheck' is a dangerous tool.  It will overwrite your"; \
217                 echo "amanda-client.conf and amandates, and (if it triggers an as-yet undetected"; \
218                 echo "bug) may do other unexpected things.  You are strongly encouraged"; \
219                 echo "  - not to run installchecks on a production install"; \
220                 echo "  - not to run installchecks as root"; \
221                 echo "See http://wiki.zmanda.com/index.php/Testing for instructions on setting up a"; \
222                 echo "test environment in which potential damage is limited by your filesystem's"; \
223                 echo "permissions.  To actually run the installchecks, invoke make as follows:"; \
224                 echo "  $(MAKE) CLOBBER_MY_CONFIG=OK installcheck"; \
225                 exit 1; \
226         fi
227
228 # newer Test::Harness (v3.18-3.21) implementations get confused by executable
229 # test scripts, so this rule chmod a-x's them first
230 installcheck-local: clobber_my_config_is_ok $(SCRIPTS_PERL)
231         rm -rf "$(AMANDA_TMPDIR)/installchecks"
232         $(mkdir_p) "$(AMANDA_TMPDIR)/installchecks"
233         @if test -f "$(CONFIG_DIR)/amanda-client.conf" -a ! -f "$(CONFIG_DIR)/amanda-client.conf.install-backup"; then \
234             cp "$(CONFIG_DIR)/amanda-client.conf" "$(CONFIG_DIR)/amanda-client.conf.install-backup"; \
235         fi 
236         for f in $(tests); do chmod a-x $$f; done
237         srcdir="$(srcdir)" $(PERL) -I$(srcdir) -I. -e 'use Test::Harness qw(&runtests); runtests(sort @ARGV);' $(tests)
238         rm -rf "$(CONFIG_DIR)/TESTCONF"
239         @if test -f "$(CONFIG_DIR)/amanda-client.conf.install-backup"; then \
240             mv -f "$(CONFIG_DIR)/amanda-client.conf.install-backup" "$(CONFIG_DIR)/amanda-client.conf"; \
241         fi
242         rm -rf "$(AMANDA_TMPDIR)/installchecks"