PY3: use pyembed_libname for library names (otherwise missing deps)
[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/nbt.c
63                   ndr/ntlmssp.c
64                   ndr/string.c
65                   ndr/backupkey.c
66                   ndr/witness.c
67                   ndr/clusapi.c
68                   ndr/negoex.c
69                   ndr/krb5pac.c
70                   ndr/winspool.c
71                   ndr/cabinet.c
72                   ndr/charset.c
73                   ''',
74         autoproto='ndr/proto.h',
75         deps='torture krb5samba',
76         enabled=bld.PYTHON_BUILD_IS_ENABLED()
77         )
78
79 torture_rpc_backupkey = ''
80 if bld.AD_DC_BUILD_IS_ENABLED():
81     if bld.CONFIG_SET('HAVE_GNUTLS_3_4_7'):
82         torture_rpc_backupkey = 'rpc/backupkey.c'
83     else:
84         torture_rpc_backupkey = 'rpc/backupkey_heimdal.c'
85 bld.SAMBA_MODULE('torture_rpc',
86                  source='''
87                         rpc/join.c
88                         rpc/lsa.c
89                         rpc/forest_trust.c
90                         rpc/lsa_lookup.c
91                         rpc/session_key.c
92                         rpc/echo.c
93                         rpc/dfs.c
94                         rpc/drsuapi.c
95                         rpc/drsuapi_w2k8.c
96                         rpc/drsuapi_cracknames.c
97                         rpc/dsgetinfo.c
98                         rpc/spoolss.c
99                         rpc/spoolss_win.c
100                         rpc/spoolss_access.c
101                         rpc/unixinfo.c
102                         rpc/samr.c
103                         rpc/samr_accessmask.c
104                         rpc/samr_priv.c
105                         rpc/wkssvc.c
106                         rpc/srvsvc.c
107                         rpc/svcctl.c
108                         rpc/atsvc.c
109                         rpc/eventlog.c
110                         rpc/epmapper.c
111                         rpc/winreg.c
112                         rpc/initshutdown.c
113                         rpc/oxidresolve.c
114                         rpc/remact.c
115                         rpc/mgmt.c
116                         rpc/scanner.c
117                         rpc/autoidl.c
118                         rpc/countcalls.c
119                         rpc/testjoin.c
120                         rpc/schannel.c
121                         rpc/netlogon.c
122                         rpc/remote_pac.c
123                         rpc/samlogon.c
124                         rpc/samsync.c
125                         rpc/dssetup.c
126                         rpc/alter_context.c
127                         rpc/bench.c
128                         rpc/samba3rpc.c
129                         rpc/rpc.c
130                         rpc/async_bind.c
131                         rpc/handles.c
132                         rpc/frsapi.c
133                         rpc/object_uuid.c
134                         rpc/ntsvcs.c
135                         rpc/browser.c
136                         rpc/bind.c
137                         rpc/fsrvp.c
138                         rpc/clusapi.c
139                         rpc/witness.c
140                         rpc/iremotewinspool.c
141                         ''' + torture_rpc_backupkey + ntvfs_specific['source'],
142                  autoproto='rpc/proto.h',
143                  subsystem='smbtorture',
144                  init_function='torture_rpc_init',
145                  deps='''
146                       ndr-table
147                       RPC_NDR_UNIXINFO
148                       dcerpc-samr
149                       RPC_NDR_WINREG
150                       RPC_NDR_INITSHUTDOWN
151                       RPC_NDR_OXIDRESOLVER
152                       RPC_NDR_EVENTLOG
153                       RPC_NDR_ECHO
154                       RPC_NDR_SVCCTL
155                       RPC_NDR_NETLOGON
156                       RPC_NDR_ATSVC
157                       RPC_NDR_DRSUAPI
158                       RPC_NDR_LSA
159                       RPC_NDR_EPMAPPER
160                       RPC_NDR_DFS
161                       RPC_NDR_FRSAPI
162                       RPC_NDR_SPOOLSS
163                       RPC_NDR_SRVSVC
164                       RPC_NDR_WKSSVC
165                       RPC_NDR_ROT
166                       RPC_NDR_DSSETUP
167                       RPC_NDR_REMACT
168                       RPC_NDR_OXIDRESOLVER
169                       RPC_NDR_NTSVCS
170                       WB_HELPER
171                       %s
172                       LIBCLI_AUTH
173                       popt
174                       POPT_CREDENTIALS
175                       TORTURE_LDAP
176                       TORTURE_UTIL
177                       TORTURE_RAP
178                       service
179                       process_model
180                       RPC_NDR_BROWSER
181                       LIBCLI_DRSUAPI
182                       TORTURE_DFS
183                       RPC_NDR_FSRVP
184                       RPC_NDR_CLUSAPI
185                       RPC_NDR_WITNESS
186                       RPC_NDR_BACKUPKEY
187                       RPC_NDR_WINSPOOL
188                       ''' % samba_net + ntvfs_specific['deps'],
189                  internal_module=True,
190                  enabled=bld.PYTHON_BUILD_IS_ENABLED())
191
192 bld.RECURSE('drs')
193 bld.RECURSE('dns')
194
195 bld.SAMBA_MODULE('TORTURE_RAP',
196         source='rap/rap.c rap/rpc.c rap/printing.c rap/sam.c',
197         autoproto='rap/proto.h',
198         subsystem='smbtorture',
199         init_function='torture_rap_init',
200         deps='TORTURE_UTIL LIBCLI_SMB NDR_RAP LIBCLI_RAP',
201         internal_module=True,
202         enabled=bld.PYTHON_BUILD_IS_ENABLED()
203         )
204
205 bld.SAMBA_MODULE('TORTURE_DFS',
206         source='dfs/domaindfs.c dfs/common.c',
207         autoproto='dfs/proto.h',
208         subsystem='smbtorture',
209         init_function='torture_dfs_init',
210         deps='TORTURE_UTIL LIBCLI_SMB',
211         internal_module=True
212         )
213
214
215 bld.SAMBA_MODULE('TORTURE_AUTH',
216         source='auth/ntlmssp.c auth/pac.c auth/smbencrypt.c',
217         autoproto='auth/proto.h',
218         subsystem='smbtorture',
219         deps='LIBCLI_SMB gensec auth4 authkrb5 popt POPT_CREDENTIALS smbpasswdparser torture com_err gensec_ntlmssp',
220         internal_module=True
221         )
222
223 bld.RECURSE('local')
224 bld.RECURSE('krb5')
225
226 bld.SAMBA_MODULE('TORTURE_NBENCH',
227         source='nbench/nbio.c nbench/nbench.c',
228         autoproto='nbench/proto.h',
229         subsystem='smbtorture',
230         init_function='torture_nbench_init',
231         deps='TORTURE_UTIL',
232         internal_module=True
233         )
234
235
236 bld.SAMBA_MODULE('TORTURE_UNIX',
237         source='unix/unix.c unix/whoami.c unix/unix_info2.c',
238         autoproto='unix/proto.h',
239         subsystem='smbtorture',
240         init_function='torture_unix_init',
241         deps='TORTURE_UTIL',
242         internal_module=True
243         )
244
245
246 bld.SAMBA_MODULE('TORTURE_LDAP',
247         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',
248         subsystem='smbtorture',
249         deps='cli-ldap cli_cldap samdb popt POPT_CREDENTIALS torture ldbsamba',
250         internal_module=True,
251         autoproto='ldap/proto.h',
252         init_function='torture_ldap_init'
253         )
254
255
256 bld.SAMBA_MODULE('TORTURE_NBT',
257         source='nbt/query.c nbt/register.c nbt/wins.c nbt/winsbench.c nbt/winsreplication.c nbt/dgram.c nbt/nbt.c',
258         autoproto='nbt/proto.h',
259         subsystem='smbtorture',
260         init_function='torture_nbt_init',
261         deps='LIBCLI_SMB cli-nbt LIBCLI_DGRAM LIBCLI_WREPL torture_rpc',
262         internal_module=True,
263         enabled=bld.PYTHON_BUILD_IS_ENABLED()
264         )
265
266
267 bld.SAMBA_MODULE('TORTURE_NET',
268         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',
269         autoproto='libnet/proto.h',
270         subsystem='smbtorture',
271         init_function='torture_net_init',
272         deps='%s popt POPT_CREDENTIALS torture_rpc %s' % (provision, samba_net),
273         internal_module=True,
274         enabled=bld.PYTHON_BUILD_IS_ENABLED()
275         )
276
277
278 bld.SAMBA_MODULE('TORTURE_NTP',
279         source='ntp/ntp_signd.c',
280         autoproto='ntp/proto.h',
281         subsystem='smbtorture',
282         init_function='torture_ntp_init',
283         deps='popt POPT_CREDENTIALS torture_rpc',
284         internal_module=True,
285         enabled=bld.PYTHON_BUILD_IS_ENABLED()
286         )
287
288 bld.SAMBA_MODULE('TORTURE_VFS',
289         source='vfs/vfs.c vfs/fruit.c vfs/acl_xattr.c',
290         subsystem='smbtorture',
291         deps='LIBCLI_SMB POPT_CREDENTIALS TORTURE_UTIL smbclient-raw TORTURE_RAW',
292         internal_module=True,
293         autoproto='vfs/proto.h',
294         init_function='torture_vfs_init'
295         )
296
297 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'
298
299 bld.SAMBA_SUBSYSTEM('torturemain',
300                     source='smbtorture.c torture.c shell.c',
301                     subsystem_name='smbtorture',
302                     deps='torture popt POPT_SAMBA POPT_CREDENTIALS dcerpc LIBCLI_SMB SMBREADLINE ' + TORTURE_MODULES,
303                     enabled=bld.PYTHON_BUILD_IS_ENABLED()
304                     )
305
306 bld.SAMBA_BINARY('smbtorture',
307                  source=[],
308                  manpages='man/smbtorture.1',
309                  private_headers='smbtorture.h',
310                  deps='torturemain torture popt POPT_SAMBA POPT_CREDENTIALS dcerpc LIBCLI_SMB SMBREADLINE ' + TORTURE_MODULES,
311                  pyembed=True,
312                  enabled=bld.PYTHON_BUILD_IS_ENABLED()
313                  )
314
315 bld.SAMBA_BINARY('gentest',
316         source='gentest.c',
317         manpages='man/gentest.1',
318         deps='samba-hostconfig samba-util popt POPT_SAMBA POPT_CREDENTIALS LIBCLI_SMB smbclient-raw param_options'
319         )
320
321
322 bld.SAMBA_BINARY('masktest',
323         source='masktest.c',
324         manpages='man/masktest.1',
325         deps='samba-hostconfig samba-util popt POPT_SAMBA POPT_CREDENTIALS LIBCLI_SMB param_options'
326         )
327
328
329 bld.SAMBA_BINARY('locktest',
330         source='locktest.c',
331         # COV_TARGET='test',
332         #ldflags='--coverage',
333         #cflags='--coverage',
334         # GCOV='1',
335         manpages='man/locktest.1',
336         deps='popt POPT_SAMBA POPT_CREDENTIALS samba-util LIBCLI_SMB samba-hostconfig param_options',
337         )
338