1908f7eac3110e2326b536314e9b3b7c51b1b0b2
[samba.git] / source4 / torture / wscript_build
1 #!/usr/bin/env python
2
3 provision = bld.pyembed_libname('PROVISION')
4 samba_net = bld.pyembed_libname('samba-net')
5
6 bld.SAMBA_SUBSYSTEM('TORTURE_UTIL',
7         source='util_smb.c',
8         public_deps='torture popt POPT_CREDENTIALS',
9         deps='smbclient-raw'
10         )
11
12
13 bld.SAMBA_MODULE('TORTURE_BASIC',
14         source='basic/base.c basic/misc.c basic/scanner.c basic/utable.c basic/charset.c basic/mangle_test.c basic/denytest.c basic/aliases.c basic/locking.c basic/secleak.c basic/rename.c basic/dir.c basic/delete.c basic/unlink.c basic/disconnect.c basic/delaywrite.c basic/attr.c basic/properties.c',
15         subsystem='smbtorture',
16         deps='LIBCLI_SMB popt POPT_CREDENTIALS TORTURE_UTIL smbclient-raw TORTURE_RAW',
17         internal_module=True,
18         autoproto='basic/proto.h',
19         init_function='torture_base_init',
20         enabled=bld.PYTHON_BUILD_IS_ENABLED()
21         )
22
23
24 bld.SAMBA_MODULE('TORTURE_RAW',
25         source='raw/qfsinfo.c raw/qfileinfo.c raw/setfileinfo.c raw/search.c raw/close.c raw/open.c raw/mkdir.c raw/oplock.c raw/notify.c raw/mux.c raw/ioctl.c raw/chkpath.c raw/unlink.c raw/read.c raw/context.c raw/session.c raw/write.c raw/lock.c raw/pingpong.c raw/lockbench.c raw/lookuprate.c raw/tconrate.c raw/openbench.c raw/rename.c raw/eas.c raw/streams.c raw/acls.c raw/seek.c raw/samba3hide.c raw/samba3misc.c raw/composite.c raw/raw.c raw/offline.c',
26         autoproto='raw/proto.h',
27         subsystem='smbtorture',
28         init_function='torture_raw_init',
29         deps='LIBCLI_SMB LIBCLI_LSA LIBCLI_SMB_COMPOSITE popt POPT_CREDENTIALS TORTURE_UTIL',
30         internal_module=True,
31         enabled=bld.PYTHON_BUILD_IS_ENABLED()
32         )
33
34 bld.RECURSE('smb2')
35 bld.RECURSE('winbind')
36 bld.RECURSE('libnetapi')
37 bld.RECURSE('libsmbclient')
38 bld.RECURSE('gpo')
39
40 ntvfs_specific = dict(source='', deps='')
41
42 # Yes, the spoolss_notify test uses the NTVFS file server to run the SMB server expected
43 # to handle the RPC callback!
44 if bld.CONFIG_SET('WITH_NTVFS_FILESERVER'):
45         ntvfs_specific['source'] += ' rpc/spoolss_notify.c'
46         ntvfs_specific['deps'] += ' SMB_SERVER dcerpc_server ntvfs'
47
48 bld.SAMBA_SUBSYSTEM('TORTURE_NDR',
49         source='''ndr/ndr.c
50                   ndr/winreg.c
51                   ndr/atsvc.c
52                   ndr/lsa.c
53                   ndr/epmap.c
54                   ndr/dfs.c
55                   ndr/netlogon.c
56                   ndr/drsuapi.c
57                   ndr/spoolss.c
58                   ndr/ntprinting.c
59                   ndr/samr.c
60                   ndr/dfsblob.c
61                   ndr/drsblobs.c
62                   ndr/dnsp.c
63                   ndr/nbt.c
64                   ndr/ntlmssp.c
65                   ndr/string.c
66                   ndr/backupkey.c
67                   ndr/witness.c
68                   ndr/clusapi.c
69                   ndr/negoex.c
70                   ndr/krb5pac.c
71                   ndr/winspool.c
72                   ndr/cabinet.c
73                   ndr/charset.c
74                   ''',
75         autoproto='ndr/proto.h',
76         deps='torture krb5samba',
77         enabled=bld.PYTHON_BUILD_IS_ENABLED()
78         )
79
80 bld.SAMBA_SUBSYSTEM('IREMOTEWINSPOOL_COMMON',
81                     source='rpc/iremotewinspool_common.c',
82                     deps='talloc',
83                     enabled=bld.PYTHON_BUILD_IS_ENABLED())
84
85 torture_rpc_backupkey = ''
86 if bld.AD_DC_BUILD_IS_ENABLED():
87     if (bld.CONFIG_SET('HAVE_GNUTLS_PRIVKEY_EXPORT_X509') and
88         bld.CONFIG_SET('HAVE_GNUTLS_X509_CRT_SET_SUBJECT_UNIQUE_ID')):
89         torture_rpc_backupkey = 'rpc/backupkey.c'
90     else:
91         torture_rpc_backupkey = 'rpc/backupkey_heimdal.c'
92 bld.SAMBA_MODULE('torture_rpc',
93                  source='''
94                         rpc/join.c
95                         rpc/lsa.c
96                         rpc/forest_trust.c
97                         rpc/lsa_lookup.c
98                         rpc/session_key.c
99                         rpc/echo.c
100                         rpc/dfs.c
101                         rpc/drsuapi.c
102                         rpc/drsuapi_w2k8.c
103                         rpc/drsuapi_cracknames.c
104                         rpc/dsgetinfo.c
105                         rpc/spoolss.c
106                         rpc/spoolss_win.c
107                         rpc/spoolss_access.c
108                         rpc/unixinfo.c
109                         rpc/samr.c
110                         rpc/samr_accessmask.c
111                         rpc/samr_priv.c
112                         rpc/wkssvc.c
113                         rpc/srvsvc.c
114                         rpc/svcctl.c
115                         rpc/atsvc.c
116                         rpc/eventlog.c
117                         rpc/epmapper.c
118                         rpc/winreg.c
119                         rpc/initshutdown.c
120                         rpc/oxidresolve.c
121                         rpc/remact.c
122                         rpc/mgmt.c
123                         rpc/scanner.c
124                         rpc/countcalls.c
125                         rpc/testjoin.c
126                         rpc/schannel.c
127                         rpc/netlogon.c
128                         rpc/remote_pac.c
129                         rpc/samlogon.c
130                         rpc/samsync.c
131                         rpc/dssetup.c
132                         rpc/alter_context.c
133                         rpc/bench.c
134                         rpc/samba3rpc.c
135                         rpc/rpc.c
136                         rpc/async_bind.c
137                         rpc/handles.c
138                         rpc/frsapi.c
139                         rpc/object_uuid.c
140                         rpc/ntsvcs.c
141                         rpc/browser.c
142                         rpc/bind.c
143                         rpc/fsrvp.c
144                         rpc/clusapi.c
145                         rpc/witness.c
146                         rpc/iremotewinspool.c
147                         rpc/iremotewinspool_driver.c
148                         rpc/mdssvc.c
149                         ''' + torture_rpc_backupkey + ntvfs_specific['source'],
150                  autoproto='rpc/proto.h',
151                  subsystem='smbtorture',
152                  init_function='torture_rpc_init',
153                  deps='''
154                       ndr-table
155                       RPC_NDR_UNIXINFO
156                       dcerpc-samr
157                       RPC_NDR_WINREG
158                       RPC_NDR_INITSHUTDOWN
159                       RPC_NDR_OXIDRESOLVER
160                       RPC_NDR_EVENTLOG
161                       RPC_NDR_ECHO
162                       RPC_NDR_SVCCTL
163                       RPC_NDR_NETLOGON
164                       RPC_NDR_ATSVC
165                       RPC_NDR_DRSUAPI
166                       RPC_NDR_LSA
167                       RPC_NDR_EPMAPPER
168                       RPC_NDR_DFS
169                       RPC_NDR_FRSAPI
170                       RPC_NDR_SPOOLSS
171                       RPC_NDR_SRVSVC
172                       RPC_NDR_WKSSVC
173                       RPC_NDR_ROT
174                       RPC_NDR_DSSETUP
175                       RPC_NDR_REMACT
176                       RPC_NDR_OXIDRESOLVER
177                       RPC_NDR_NTSVCS
178                       %s
179                       LIBCLI_AUTH
180                       popt
181                       POPT_CREDENTIALS
182                       TORTURE_LDAP
183                       TORTURE_UTIL
184                       TORTURE_RAP
185                       service
186                       process_model
187                       RPC_NDR_BROWSER
188                       LIBCLI_DRSUAPI
189                       TORTURE_DFS
190                       RPC_NDR_FSRVP
191                       RPC_NDR_CLUSAPI
192                       RPC_NDR_WITNESS
193                       RPC_NDR_BACKUPKEY
194                       RPC_NDR_WINSPOOL
195                       IREMOTEWINSPOOL_COMMON
196                       printer_driver
197                       RPC_NDR_MDSSVC
198                       mdssvc
199                       ''' % samba_net + ntvfs_specific['deps'],
200                  internal_module=True,
201                  enabled=bld.PYTHON_BUILD_IS_ENABLED())
202
203 bld.RECURSE('drs')
204 bld.RECURSE('dns')
205
206 bld.SAMBA_MODULE('TORTURE_RAP',
207         source='rap/rap.c rap/rpc.c rap/printing.c rap/sam.c',
208         autoproto='rap/proto.h',
209         subsystem='smbtorture',
210         init_function='torture_rap_init',
211         deps='TORTURE_UTIL LIBCLI_SMB NDR_RAP LIBCLI_RAP',
212         internal_module=True,
213         enabled=bld.PYTHON_BUILD_IS_ENABLED()
214         )
215
216 bld.SAMBA_MODULE('TORTURE_DFS',
217         source='dfs/domaindfs.c dfs/common.c',
218         autoproto='dfs/proto.h',
219         subsystem='smbtorture',
220         init_function='torture_dfs_init',
221         deps='TORTURE_UTIL LIBCLI_SMB',
222         internal_module=True
223         )
224
225
226 bld.SAMBA_MODULE('TORTURE_AUTH',
227         source='auth/ntlmssp.c auth/pac.c auth/smbencrypt.c',
228         autoproto='auth/proto.h',
229         subsystem='smbtorture',
230         deps='LIBCLI_SMB gensec auth4 authkrb5 popt POPT_CREDENTIALS smbpasswdparser torture com_err gensec_ntlmssp',
231         internal_module=True
232         )
233
234 bld.RECURSE('local')
235 bld.RECURSE('krb5')
236
237 bld.SAMBA_MODULE('TORTURE_NBENCH',
238         source='nbench/nbio.c nbench/nbench.c',
239         autoproto='nbench/proto.h',
240         subsystem='smbtorture',
241         init_function='torture_nbench_init',
242         deps='TORTURE_UTIL',
243         internal_module=True
244         )
245
246
247 bld.SAMBA_MODULE('TORTURE_UNIX',
248         source='unix/unix.c unix/whoami.c unix/unix_info2.c',
249         autoproto='unix/proto.h',
250         subsystem='smbtorture',
251         init_function='torture_unix_init',
252         deps='TORTURE_UTIL',
253         internal_module=True
254         )
255
256
257 bld.SAMBA_MODULE('TORTURE_LDAP',
258         source='ldap/common.c ldap/basic.c ldap/schema.c ldap/uptodatevector.c ldap/cldap.c ldap/netlogon.c ldap/cldapbench.c ldap/ldap_sort.c ldap/nested_search.c',
259         subsystem='smbtorture',
260         deps='cli-ldap cli_cldap samdb popt POPT_CREDENTIALS torture ldbsamba',
261         internal_module=True,
262         autoproto='ldap/proto.h',
263         init_function='torture_ldap_init'
264         )
265
266
267 bld.SAMBA_MODULE('TORTURE_NBT',
268         source='nbt/query.c nbt/register.c nbt/wins.c nbt/winsbench.c nbt/winsreplication.c nbt/dgram.c nbt/nbt.c',
269         autoproto='nbt/proto.h',
270         subsystem='smbtorture',
271         init_function='torture_nbt_init',
272         deps='LIBCLI_SMB cli-nbt LIBCLI_DGRAM LIBCLI_WREPL torture_rpc',
273         internal_module=True,
274         enabled=bld.PYTHON_BUILD_IS_ENABLED()
275         )
276
277
278 bld.SAMBA_MODULE('TORTURE_NET',
279         source='libnet/libnet.c libnet/utils.c libnet/userinfo.c libnet/userman.c libnet/groupinfo.c libnet/groupman.c libnet/domain.c libnet/libnet_lookup.c libnet/libnet_user.c libnet/libnet_group.c libnet/libnet_share.c libnet/libnet_rpc.c libnet/libnet_domain.c libnet/libnet_BecomeDC.c',
280         autoproto='libnet/proto.h',
281         subsystem='smbtorture',
282         init_function='torture_net_init',
283         deps='%s popt POPT_CREDENTIALS torture_rpc %s' % (provision, samba_net),
284         internal_module=True,
285         enabled=bld.PYTHON_BUILD_IS_ENABLED()
286         )
287
288
289 bld.SAMBA_MODULE('TORTURE_NTP',
290         source='ntp/ntp_signd.c',
291         autoproto='ntp/proto.h',
292         subsystem='smbtorture',
293         init_function='torture_ntp_init',
294         deps='popt POPT_CREDENTIALS torture_rpc',
295         internal_module=True,
296         enabled=bld.PYTHON_BUILD_IS_ENABLED()
297         )
298
299 bld.SAMBA_MODULE('TORTURE_VFS',
300         source='vfs/vfs.c vfs/fruit.c vfs/acl_xattr.c',
301         subsystem='smbtorture',
302         deps='LIBCLI_SMB POPT_CREDENTIALS TORTURE_UTIL smbclient-raw TORTURE_RAW',
303         internal_module=True,
304         autoproto='vfs/proto.h',
305         init_function='torture_vfs_init'
306         )
307
308 TORTURE_MODULES = 'TORTURE_BASIC TORTURE_RAW torture_rpc TORTURE_RAP TORTURE_AUTH TORTURE_NBENCH TORTURE_UNIX TORTURE_LDAP TORTURE_NBT TORTURE_NET TORTURE_NTP torture_registry TORTURE_VFS'
309
310 bld.SAMBA_SUBSYSTEM('torturemain',
311                     source='smbtorture.c torture.c shell.c',
312                     subsystem_name='smbtorture',
313                     deps='torture popt POPT_SAMBA POPT_CREDENTIALS dcerpc LIBCLI_SMB SMBREADLINE ' + TORTURE_MODULES,
314                     enabled=bld.PYTHON_BUILD_IS_ENABLED()
315                     )
316
317 bld.SAMBA_BINARY('smbtorture',
318                  source=[],
319                  manpages='man/smbtorture.1',
320                  private_headers='smbtorture.h',
321                  deps='torturemain torture popt POPT_SAMBA POPT_CREDENTIALS dcerpc LIBCLI_SMB SMBREADLINE ' + TORTURE_MODULES,
322                  pyembed=True,
323                  enabled=bld.PYTHON_BUILD_IS_ENABLED()
324                  )
325
326 bld.SAMBA_BINARY('gentest',
327         source='gentest.c',
328         manpages='man/gentest.1',
329         deps='samba-hostconfig samba-util popt POPT_SAMBA POPT_CREDENTIALS LIBCLI_SMB smbclient-raw param_options'
330         )
331
332
333 bld.SAMBA_BINARY('masktest',
334         source='masktest.c',
335         manpages='man/masktest.1',
336         deps='samba-hostconfig samba-util popt POPT_SAMBA POPT_CREDENTIALS LIBCLI_SMB param_options'
337         )
338
339
340 bld.SAMBA_BINARY('locktest',
341         source='locktest.c',
342         # COV_TARGET='test',
343         #ldflags='--coverage',
344         #cflags='--coverage',
345         # GCOV='1',
346         manpages='man/locktest.1',
347         deps='popt POPT_SAMBA POPT_CREDENTIALS samba-util LIBCLI_SMB samba-hostconfig param_options',
348         )
349
350 bld.SAMBA_MODULE('TORTURE_DSDB',
351         source="../../source4/dsdb/common/tests/dsdb.c",
352         autoproto='dsdb_proto.h',
353         subsystem='smbtorture',
354         init_function='torture_dsdb_init',
355         deps="TORTURE_UTIL samba-util",
356         internal_module=True,
357         enabled=bld.PYTHON_BUILD_IS_ENABLED()
358         )