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