torture: beginning of a mdssvc RPC service test-suite
[samba.git] / source4 / torture / wscript_build
old mode 100755 (executable)
new mode 100644 (file)
index 5f52033..1908f7e
@@ -1,5 +1,7 @@
 #!/usr/bin/env python
 
+provision = bld.pyembed_libname('PROVISION')
+samba_net = bld.pyembed_libname('samba-net')
 
 bld.SAMBA_SUBSYSTEM('TORTURE_UTIL',
        source='util_smb.c',
@@ -14,7 +16,8 @@ bld.SAMBA_MODULE('TORTURE_BASIC',
        deps='LIBCLI_SMB popt POPT_CREDENTIALS TORTURE_UTIL smbclient-raw TORTURE_RAW',
        internal_module=True,
        autoproto='basic/proto.h',
-       init_function='torture_base_init'
+       init_function='torture_base_init',
+       enabled=bld.PYTHON_BUILD_IS_ENABLED()
        )
 
 
@@ -24,28 +27,68 @@ bld.SAMBA_MODULE('TORTURE_RAW',
        subsystem='smbtorture',
        init_function='torture_raw_init',
        deps='LIBCLI_SMB LIBCLI_LSA LIBCLI_SMB_COMPOSITE popt POPT_CREDENTIALS TORTURE_UTIL',
-       internal_module=True
+       internal_module=True,
+       enabled=bld.PYTHON_BUILD_IS_ENABLED()
        )
 
 bld.RECURSE('smb2')
 bld.RECURSE('winbind')
 bld.RECURSE('libnetapi')
 bld.RECURSE('libsmbclient')
+bld.RECURSE('gpo')
 
-heimdal_specific = dict()
-heimdal_specific['ndr'] = ('','')
-heimdal_specific['rpc'] = ('','')
-if bld.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'):
-       heimdal_specific['rpc'] = (' rpc/backupkey.c rpc/spoolss_notify.c',
-                                   ' RPC_NDR_BACKUPKEY SMB_SERVER dcerpc_server ntvfs')
+ntvfs_specific = dict(source='', deps='')
+
+# Yes, the spoolss_notify test uses the NTVFS file server to run the SMB server expected
+# to handle the RPC callback!
+if bld.CONFIG_SET('WITH_NTVFS_FILESERVER'):
+       ntvfs_specific['source'] += ' rpc/spoolss_notify.c'
+       ntvfs_specific['deps'] += ' SMB_SERVER dcerpc_server ntvfs'
 
 bld.SAMBA_SUBSYSTEM('TORTURE_NDR',
-       source='ndr/ndr.c ndr/winreg.c ndr/atsvc.c ndr/lsa.c ndr/epmap.c ndr/dfs.c ndr/netlogon.c ndr/drsuapi.c ndr/spoolss.c ndr/ntprinting.c ndr/samr.c ndr/dfsblob.c ndr/drsblobs.c ndr/nbt.c ndr/ntlmssp.c ndr/string.c ndr/backupkey.c ndr/witness.c',
+        source='''ndr/ndr.c
+                  ndr/winreg.c
+                  ndr/atsvc.c
+                  ndr/lsa.c
+                  ndr/epmap.c
+                  ndr/dfs.c
+                  ndr/netlogon.c
+                  ndr/drsuapi.c
+                  ndr/spoolss.c
+                  ndr/ntprinting.c
+                  ndr/samr.c
+                  ndr/dfsblob.c
+                  ndr/drsblobs.c
+                  ndr/dnsp.c
+                  ndr/nbt.c
+                  ndr/ntlmssp.c
+                  ndr/string.c
+                  ndr/backupkey.c
+                  ndr/witness.c
+                  ndr/clusapi.c
+                  ndr/negoex.c
+                  ndr/krb5pac.c
+                  ndr/winspool.c
+                  ndr/cabinet.c
+                  ndr/charset.c
+                 ''',
        autoproto='ndr/proto.h',
-       deps='torture'
+       deps='torture krb5samba',
+       enabled=bld.PYTHON_BUILD_IS_ENABLED()
        )
 
-
+bld.SAMBA_SUBSYSTEM('IREMOTEWINSPOOL_COMMON',
+                    source='rpc/iremotewinspool_common.c',
+                    deps='talloc',
+                    enabled=bld.PYTHON_BUILD_IS_ENABLED())
+
+torture_rpc_backupkey = ''
+if bld.AD_DC_BUILD_IS_ENABLED():
+    if (bld.CONFIG_SET('HAVE_GNUTLS_PRIVKEY_EXPORT_X509') and
+        bld.CONFIG_SET('HAVE_GNUTLS_X509_CRT_SET_SUBJECT_UNIQUE_ID')):
+        torture_rpc_backupkey = 'rpc/backupkey.c'
+    else:
+        torture_rpc_backupkey = 'rpc/backupkey_heimdal.c'
 bld.SAMBA_MODULE('torture_rpc',
                  source='''
                         rpc/join.c
@@ -56,12 +99,12 @@ bld.SAMBA_MODULE('torture_rpc',
                         rpc/echo.c
                         rpc/dfs.c
                         rpc/drsuapi.c
+                        rpc/drsuapi_w2k8.c
                         rpc/drsuapi_cracknames.c
                         rpc/dsgetinfo.c
                         rpc/spoolss.c
                         rpc/spoolss_win.c
                         rpc/spoolss_access.c
-                        rpc/spoolss_notify.c
                         rpc/unixinfo.c
                         rpc/samr.c
                         rpc/samr_accessmask.c
@@ -78,7 +121,6 @@ bld.SAMBA_MODULE('torture_rpc',
                         rpc/remact.c
                         rpc/mgmt.c
                         rpc/scanner.c
-                        rpc/autoidl.c
                         rpc/countcalls.c
                         rpc/testjoin.c
                         rpc/schannel.c
@@ -100,7 +142,11 @@ bld.SAMBA_MODULE('torture_rpc',
                         rpc/bind.c
                         rpc/fsrvp.c
                         rpc/clusapi.c
-                        rpc/witness.c''' + heimdal_specific['rpc'][0],
+                        rpc/witness.c
+                        rpc/iremotewinspool.c
+                        rpc/iremotewinspool_driver.c
+                        rpc/mdssvc.c
+                        ''' + torture_rpc_backupkey + ntvfs_specific['source'],
                  autoproto='rpc/proto.h',
                  subsystem='smbtorture',
                  init_function='torture_rpc_init',
@@ -115,7 +161,7 @@ bld.SAMBA_MODULE('torture_rpc',
                       RPC_NDR_ECHO
                       RPC_NDR_SVCCTL
                       RPC_NDR_NETLOGON
-                      dcerpc-atsvc
+                      RPC_NDR_ATSVC
                       RPC_NDR_DRSUAPI
                       RPC_NDR_LSA
                       RPC_NDR_EPMAPPER
@@ -129,8 +175,7 @@ bld.SAMBA_MODULE('torture_rpc',
                       RPC_NDR_REMACT
                       RPC_NDR_OXIDRESOLVER
                       RPC_NDR_NTSVCS
-                      WB_HELPER
-                      samba-net
+                      %s
                       LIBCLI_AUTH
                       popt
                       POPT_CREDENTIALS
@@ -145,8 +190,15 @@ bld.SAMBA_MODULE('torture_rpc',
                       RPC_NDR_FSRVP
                       RPC_NDR_CLUSAPI
                       RPC_NDR_WITNESS
-                      ''' + heimdal_specific['rpc'][1],
-                 internal_module=True)
+                      RPC_NDR_BACKUPKEY
+                      RPC_NDR_WINSPOOL
+                      IREMOTEWINSPOOL_COMMON
+                      printer_driver
+                      RPC_NDR_MDSSVC
+                      mdssvc
+                      ''' % samba_net + ntvfs_specific['deps'],
+                 internal_module=True,
+                 enabled=bld.PYTHON_BUILD_IS_ENABLED())
 
 bld.RECURSE('drs')
 bld.RECURSE('dns')
@@ -157,7 +209,8 @@ bld.SAMBA_MODULE('TORTURE_RAP',
        subsystem='smbtorture',
        init_function='torture_rap_init',
        deps='TORTURE_UTIL LIBCLI_SMB NDR_RAP LIBCLI_RAP',
-       internal_module=True
+       internal_module=True,
+       enabled=bld.PYTHON_BUILD_IS_ENABLED()
        )
 
 bld.SAMBA_MODULE('TORTURE_DFS',
@@ -217,7 +270,8 @@ bld.SAMBA_MODULE('TORTURE_NBT',
        subsystem='smbtorture',
        init_function='torture_nbt_init',
        deps='LIBCLI_SMB cli-nbt LIBCLI_DGRAM LIBCLI_WREPL torture_rpc',
-       internal_module=True
+       internal_module=True,
+       enabled=bld.PYTHON_BUILD_IS_ENABLED()
        )
 
 
@@ -226,8 +280,9 @@ bld.SAMBA_MODULE('TORTURE_NET',
        autoproto='libnet/proto.h',
        subsystem='smbtorture',
        init_function='torture_net_init',
-       deps='samba-net popt POPT_CREDENTIALS torture_rpc PROVISION',
-       internal_module=True
+       deps='%s popt POPT_CREDENTIALS torture_rpc %s' % (provision, samba_net),
+       internal_module=True,
+       enabled=bld.PYTHON_BUILD_IS_ENABLED()
        )
 
 
@@ -237,11 +292,12 @@ bld.SAMBA_MODULE('TORTURE_NTP',
        subsystem='smbtorture',
        init_function='torture_ntp_init',
        deps='popt POPT_CREDENTIALS torture_rpc',
-       internal_module=True
+       internal_module=True,
+       enabled=bld.PYTHON_BUILD_IS_ENABLED()
        )
 
 bld.SAMBA_MODULE('TORTURE_VFS',
-       source='vfs/vfs.c vfs/fruit.c',
+       source='vfs/vfs.c vfs/fruit.c vfs/acl_xattr.c',
        subsystem='smbtorture',
        deps='LIBCLI_SMB POPT_CREDENTIALS TORTURE_UTIL smbclient-raw TORTURE_RAW',
        internal_module=True,
@@ -255,14 +311,16 @@ bld.SAMBA_SUBSYSTEM('torturemain',
                     source='smbtorture.c torture.c shell.c',
                     subsystem_name='smbtorture',
                     deps='torture popt POPT_SAMBA POPT_CREDENTIALS dcerpc LIBCLI_SMB SMBREADLINE ' + TORTURE_MODULES,
+                    enabled=bld.PYTHON_BUILD_IS_ENABLED()
                     )
 
 bld.SAMBA_BINARY('smbtorture',
                  source=[],
                  manpages='man/smbtorture.1',
-                 public_headers='smbtorture.h',
+                 private_headers='smbtorture.h',
                  deps='torturemain torture popt POPT_SAMBA POPT_CREDENTIALS dcerpc LIBCLI_SMB SMBREADLINE ' + TORTURE_MODULES,
-                 pyembed=True
+                 pyembed=True,
+                 enabled=bld.PYTHON_BUILD_IS_ENABLED()
                  )
 
 bld.SAMBA_BINARY('gentest',
@@ -289,3 +347,12 @@ bld.SAMBA_BINARY('locktest',
        deps='popt POPT_SAMBA POPT_CREDENTIALS samba-util LIBCLI_SMB samba-hostconfig param_options',
        )
 
+bld.SAMBA_MODULE('TORTURE_DSDB',
+       source="../../source4/dsdb/common/tests/dsdb.c",
+       autoproto='dsdb_proto.h',
+       subsystem='smbtorture',
+       init_function='torture_dsdb_init',
+       deps="TORTURE_UTIL samba-util",
+       internal_module=True,
+       enabled=bld.PYTHON_BUILD_IS_ENABLED()
+       )