diff options
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/config.mk | 262 | ||||
-rw-r--r-- | source4/torture/libnet/libnet_domain.c | 11 | ||||
-rw-r--r-- | source4/torture/libnet/libnet_group.c | 6 | ||||
-rw-r--r-- | source4/torture/libnet/libnet_lookup.c | 8 | ||||
-rw-r--r-- | source4/torture/libnet/libnet_rpc.c | 2 | ||||
-rw-r--r-- | source4/torture/libnet/libnet_share.c | 4 | ||||
-rw-r--r-- | source4/torture/libnet/libnet_user.c | 10 | ||||
-rw-r--r-- | source4/torture/local/config.mk | 60 | ||||
-rw-r--r-- | source4/torture/rpc/dfs.c | 4 | ||||
-rw-r--r-- | source4/torture/rpc/testjoin.c | 4 | ||||
-rw-r--r-- | source4/torture/smb2/config.mk | 14 | ||||
-rw-r--r-- | source4/torture/smbtorture.c | 4 | ||||
-rw-r--r-- | source4/torture/torture.c | 12 | ||||
-rw-r--r-- | source4/torture/ui.c | 6 | ||||
-rw-r--r-- | source4/torture/ui.h | 2 | ||||
-rw-r--r-- | source4/torture/util_smb.c | 3 | ||||
-rw-r--r-- | source4/torture/winbind/config.mk | 6 |
17 files changed, 186 insertions, 232 deletions
diff --git a/source4/torture/config.mk b/source4/torture/config.mk index 7acb1e0792..e6c54022c2 100644 --- a/source4/torture/config.mk +++ b/source4/torture/config.mk @@ -1,25 +1,23 @@ # TORTURE subsystem [LIBRARY::torture] -SO_VERSION = 0 -VERSION = 0.0.1 -PC_FILE = torture.pc PRIVATE_PROTO_HEADER = proto.h -OBJ_FILES = \ - torture.o \ - ui.o PUBLIC_DEPENDENCIES = \ LIBSAMBA-HOSTCONFIG \ LIBSAMBA-UTIL \ LIBTALLOC \ LIBPOPT +PC_FILES += torture/torture.pc +torture_OBJ_FILES = $(addprefix torture/, torture.o ui.o) + PUBLIC_HEADERS += torture/torture.h torture/ui.h [SUBSYSTEM::TORTURE_UTIL] -OBJ_FILES = util_smb.o PRIVATE_DEPENDENCIES = LIBCLI_RAW LIBPYTHON smbcalls PROVISION PUBLIC_DEPENDENCIES = POPT_CREDENTIALS +TORTURE_UTIL_OBJ_FILES = $(addprefix torture/, util_smb.o) + ################################# # Start SUBSYSTEM TORTURE_BASIC [MODULE::TORTURE_BASIC] @@ -27,25 +25,6 @@ SUBSYSTEM = torture INIT_FUNCTION = torture_base_init PRIVATE_PROTO_HEADER = \ basic/proto.h -OBJ_FILES = \ - basic/base.o \ - basic/misc.o \ - basic/scanner.o \ - basic/utable.o \ - basic/charset.o \ - basic/mangle_test.o \ - basic/denytest.o \ - basic/aliases.o \ - basic/locking.o \ - basic/secleak.o \ - basic/rename.o \ - basic/dir.o \ - basic/delete.o \ - basic/unlink.o \ - basic/disconnect.o \ - basic/delaywrite.o \ - basic/attr.o \ - basic/properties.o PRIVATE_DEPENDENCIES = \ LIBCLI_SMB POPT_CREDENTIALS \ TORTURE_UTIL LIBCLI_RAW \ @@ -53,6 +32,27 @@ PRIVATE_DEPENDENCIES = \ # End SUBSYSTEM TORTURE_BASIC ################################# +TORTURE_BASIC_OBJ_FILES = $(addprefix torture/basic/, \ + base.o \ + misc.o \ + scanner.o \ + utable.o \ + charset.o \ + mangle_test.o \ + denytest.o \ + aliases.o \ + locking.o \ + secleak.o \ + rename.o \ + dir.o \ + delete.o \ + unlink.o \ + disconnect.o \ + delaywrite.o \ + attr.o \ + properties.o) + + ################################# # Start SUBSYSTEM TORTURE_RAW [MODULE::TORTURE_RAW] @@ -60,58 +60,52 @@ SUBSYSTEM = torture INIT_FUNCTION = torture_raw_init PRIVATE_PROTO_HEADER = \ raw/proto.h -OBJ_FILES = \ - raw/qfsinfo.o \ - raw/qfileinfo.o \ - raw/setfileinfo.o \ - raw/search.o \ - raw/close.o \ - raw/open.o \ - raw/mkdir.o \ - raw/oplock.o \ - raw/notify.o \ - raw/mux.o \ - raw/ioctl.o \ - raw/chkpath.o \ - raw/unlink.o \ - raw/read.o \ - raw/context.o \ - raw/write.o \ - raw/lock.o \ - raw/pingpong.o \ - raw/lockbench.o \ - raw/openbench.o \ - raw/rename.o \ - raw/eas.o \ - raw/streams.o \ - raw/acls.o \ - raw/seek.o \ - raw/samba3hide.o \ - raw/samba3misc.o \ - raw/composite.o \ - raw/raw.o \ - raw/offline.o PRIVATE_DEPENDENCIES = \ LIBCLI_SMB LIBCLI_LSA LIBCLI_SMB_COMPOSITE \ POPT_CREDENTIALS TORTURE_UTIL # End SUBSYSTEM TORTURE_RAW ################################# +TORTURE_RAW_OBJ_FILES = $(addprefix torture/raw/, \ + qfsinfo.o \ + qfileinfo.o \ + setfileinfo.o \ + search.o \ + close.o \ + open.o \ + mkdir.o \ + oplock.o \ + notify.o \ + mux.o \ + ioctl.o \ + chkpath.o \ + unlink.o \ + read.o \ + context.o \ + write.o \ + lock.o \ + pingpong.o \ + lockbench.o \ + openbench.o \ + rename.o \ + eas.o \ + streams.o \ + acls.o \ + seek.o \ + samba3hide.o \ + samba3misc.o \ + composite.o \ + raw.o \ + offline.o) + + mkinclude smb2/config.mk mkinclude winbind/config.mk [SUBSYSTEM::TORTURE_NDR] PRIVATE_PROTO_HEADER = ndr/proto.h -OBJ_FILES = ndr/ndr.o \ - ndr/winreg.o \ - ndr/atsvc.o \ - ndr/lsa.o \ - ndr/epmap.o \ - ndr/dfs.o \ - ndr/netlogon.o \ - ndr/drsuapi.o \ - ndr/spoolss.o \ - ndr/samr.o + +TORTURE_NDR_OBJ_FILES = $(addprefix torture/ndr/, ndr.o winreg.o atsvc.o lsa.o epmap.o dfs.o netlogon.o drsuapi.o spoolss.o samr.o) [MODULE::torture_rpc] # TORTURE_NET and TORTURE_NBT use functions from torture_rpc... @@ -120,50 +114,6 @@ SUBSYSTEM = torture INIT_FUNCTION = torture_rpc_init PRIVATE_PROTO_HEADER = \ rpc/proto.h -OBJ_FILES = \ - rpc/join.o \ - rpc/lsa.o \ - rpc/lsa_lookup.o \ - rpc/session_key.o \ - rpc/echo.o \ - rpc/dfs.o \ - rpc/drsuapi.o \ - rpc/drsuapi_cracknames.o \ - rpc/dssync.o \ - rpc/spoolss.o \ - rpc/spoolss_notify.o \ - rpc/spoolss_win.o \ - rpc/unixinfo.o \ - rpc/samr.o \ - rpc/samr_accessmask.o \ - rpc/wkssvc.o \ - rpc/srvsvc.o \ - rpc/svcctl.o \ - rpc/atsvc.o \ - rpc/eventlog.o \ - rpc/epmapper.o \ - rpc/winreg.o \ - rpc/initshutdown.o \ - rpc/oxidresolve.o \ - rpc/remact.o \ - rpc/mgmt.o \ - rpc/scanner.o \ - rpc/autoidl.o \ - rpc/countcalls.o \ - rpc/testjoin.o \ - rpc/schannel.o \ - rpc/netlogon.o \ - rpc/samlogon.o \ - rpc/samsync.o \ - rpc/bind.o \ - rpc/dssetup.o \ - rpc/alter_context.o \ - rpc/bench.o \ - rpc/samba3rpc.o \ - rpc/rpc.o \ - rpc/async_bind.o \ - rpc/handles.o \ - rpc/frsapi.o PRIVATE_DEPENDENCIES = \ NDR_TABLE RPC_NDR_UNIXINFO dcerpc_samr RPC_NDR_WINREG RPC_NDR_INITSHUTDOWN \ RPC_NDR_OXIDRESOLVER RPC_NDR_EVENTLOG RPC_NDR_ECHO RPC_NDR_SVCCTL \ @@ -172,7 +122,16 @@ PRIVATE_DEPENDENCIES = \ RPC_NDR_SRVSVC RPC_NDR_WKSSVC RPC_NDR_ROT RPC_NDR_DSSETUP \ RPC_NDR_REMACT RPC_NDR_OXIDRESOLVER WB_HELPER LIBSAMBA-NET \ LIBCLI_AUTH POPT_CREDENTIALS TORTURE_LDAP TORTURE_UTIL TORTURE_RAP \ - dcerpc_server service process_model + dcerpc_server service process_model ntvfs SERVICE_SMB + +torture_rpc_OBJ_FILES = $(addprefix torture/rpc/, \ + join.o lsa.o lsa_lookup.o session_key.o echo.o dfs.o drsuapi.o \ + drsuapi_cracknames.o dssync.o spoolss.o spoolss_notify.o spoolss_win.o \ + unixinfo.o samr.o samr_accessmask.o wkssvc.o srvsvc.o svcctl.o atsvc.o \ + eventlog.o epmapper.o winreg.o initshutdown.o oxidresolve.o remact.o mgmt.o \ + scanner.o autoidl.o countcalls.o testjoin.o schannel.o netlogon.o samlogon.o \ + samsync.o bind.o dssetup.o alter_context.o bench.o samba3rpc.o rpc.o async_bind.o \ + handles.o frsapi.o) ################################# # Start SUBSYSTEM TORTURE_RAP @@ -181,27 +140,26 @@ SUBSYSTEM = torture INIT_FUNCTION = torture_rap_init PRIVATE_PROTO_HEADER = \ rap/proto.h -OBJ_FILES = \ - rap/rap.o PRIVATE_DEPENDENCIES = TORTURE_UTIL LIBCLI_SMB # End SUBSYSTEM TORTURE_RAP ################################# +TORTURE_RAP_OBJ_FILES = torture/rap/rap.o + ################################# # Start SUBSYSTEM TORTURE_AUTH [MODULE::TORTURE_AUTH] SUBSYSTEM = torture PRIVATE_PROTO_HEADER = \ auth/proto.h -OBJ_FILES = \ - auth/ntlmssp.o \ - auth/pac.o PRIVATE_DEPENDENCIES = \ LIBCLI_SMB gensec auth KERBEROS \ POPT_CREDENTIALS SMBPASSWD # End SUBSYSTEM TORTURE_AUTH ################################# +TORTURE_AUTH_OBJ_FILES = $(addprefix torture/auth/, ntlmssp.o pac.o) + mkinclude local/config.mk ################################# @@ -212,12 +170,11 @@ INIT_FUNCTION = torture_nbench_init PRIVATE_DEPENDENCIES = TORTURE_UTIL PRIVATE_PROTO_HEADER = \ nbench/proto.h -OBJ_FILES = \ - nbench/nbio.o \ - nbench/nbench.o # End MODULE TORTURE_NBENCH ################################# +TORTURE_NBENCH_OBJ_FILES = $(addprefix torture/nbench/, nbio.o nbench.o) + ################################# # Start MODULE TORTURE_UNIX [MODULE::TORTURE_UNIX] @@ -226,13 +183,11 @@ INIT_FUNCTION = torture_unix_init PRIVATE_DEPENDENCIES = TORTURE_UTIL PRIVATE_PROTO_HEADER = \ unix/proto.h -OBJ_FILES = \ - unix/unix.o \ - unix/whoami.o \ - unix/unix_info2.o # End MODULE TORTURE_UNIX ################################# +TORTURE_UNIX_OBJ_FILES = $(addprefix torture/unix/, unix.o whoami.o unix_info2.o) + ################################# # Start SUBSYSTEM TORTURE_LDAP [MODULE::TORTURE_LDAP] @@ -240,18 +195,14 @@ SUBSYSTEM = torture INIT_FUNCTION = torture_ldap_init PRIVATE_PROTO_HEADER = \ ldap/proto.h -OBJ_FILES = \ - ldap/common.o \ - ldap/basic.o \ - ldap/schema.o \ - ldap/uptodatevector.o \ - ldap/cldap.o \ - ldap/cldapbench.o PRIVATE_DEPENDENCIES = \ LIBCLI_LDAP LIBCLI_CLDAP SAMDB POPT_CREDENTIALS # End SUBSYSTEM TORTURE_LDAP ################################# +TORTURE_LDAP_OBJ_FILES = $(addprefix torture/ldap/, common.o basic.o schema.o uptodatevector.o cldap.o cldapbench.o) + + ################################# # Start SUBSYSTEM TORTURE_NBT [MODULE::TORTURE_NBT] @@ -259,19 +210,15 @@ SUBSYSTEM = torture INIT_FUNCTION = torture_nbt_init PRIVATE_PROTO_HEADER = \ nbt/proto.h -OBJ_FILES = \ - nbt/query.o \ - nbt/register.o \ - nbt/wins.o \ - nbt/winsbench.o \ - nbt/winsreplication.o \ - nbt/dgram.o \ - nbt/nbt.o PRIVATE_DEPENDENCIES = \ LIBCLI_SMB LIBCLI_NBT LIBCLI_DGRAM LIBCLI_WREPL torture_rpc # End SUBSYSTEM TORTURE_NBT ################################# +TORTURE_NBT_OBJ_FILES = $(addprefix torture/nbt/, query.o register.o \ + wins.o winsbench.o winsreplication.o dgram.o nbt.o) + + ################################# # Start SUBSYSTEM TORTURE_NET [MODULE::TORTURE_NET] @@ -279,21 +226,6 @@ SUBSYSTEM = torture INIT_FUNCTION = torture_net_init PRIVATE_PROTO_HEADER = \ libnet/proto.h -OBJ_FILES = \ - libnet/libnet.o \ - libnet/utils.o \ - libnet/userinfo.o \ - libnet/userman.o \ - libnet/groupinfo.o \ - libnet/groupman.o \ - libnet/domain.o \ - libnet/libnet_lookup.o \ - libnet/libnet_user.o \ - libnet/libnet_group.o \ - libnet/libnet_share.o \ - libnet/libnet_rpc.o \ - libnet/libnet_domain.o \ - libnet/libnet_BecomeDC.o PRIVATE_DEPENDENCIES = \ LIBSAMBA-NET \ POPT_CREDENTIALS \ @@ -301,12 +233,16 @@ PRIVATE_DEPENDENCIES = \ # End SUBSYSTEM TORTURE_NET ################################# +TORTURE_NET_OBJ_FILES = $(addprefix torture/libnet/, libnet.o \ + utils.o userinfo.o userman.o groupinfo.o groupman.o \ + domain.o libnet_lookup.o libnet_user.o libnet_group.o \ + libnet_share.o libnet_rpc.o libnet_domain.o libnet_BecomeDC.o) + + ################################# # Start BINARY smbtorture [BINARY::smbtorture] INSTALLDIR = BINDIR -OBJ_FILES = \ - smbtorture.o PRIVATE_DEPENDENCIES = \ torture \ LIBPOPT \ @@ -318,14 +254,14 @@ PRIVATE_DEPENDENCIES = \ # End BINARY smbtorture ################################# +smbtorture_OBJ_FILES = torture/smbtorture.o + MANPAGES += torture/man/smbtorture.1 ################################# # Start BINARY gentest [BINARY::gentest] INSTALLDIR = BINDIR -OBJ_FILES = \ - gentest.o PRIVATE_DEPENDENCIES = \ LIBSAMBA-HOSTCONFIG \ LIBSAMBA-UTIL \ @@ -337,14 +273,14 @@ PRIVATE_DEPENDENCIES = \ # End BINARY gentest ################################# +gentest_OBJ_FILES = torture/gentest.o + MANPAGES += torture/man/gentest.1 ################################# # Start BINARY masktest [BINARY::masktest] INSTALLDIR = BINDIR -OBJ_FILES = \ - masktest.o PRIVATE_DEPENDENCIES = \ LIBSAMBA-HOSTCONFIG \ LIBSAMBA-UTIL \ @@ -355,14 +291,14 @@ PRIVATE_DEPENDENCIES = \ # End BINARY masktest ################################# +masktest_OBJ_FILES = torture/masktest.o + MANPAGES += torture/man/masktest.1 ################################# # Start BINARY locktest [BINARY::locktest] INSTALLDIR = BINDIR -OBJ_FILES = \ - locktest.o PRIVATE_DEPENDENCIES = \ LIBPOPT \ POPT_SAMBA \ @@ -373,6 +309,8 @@ PRIVATE_DEPENDENCIES = \ # End BINARY locktest ################################# +locktest_OBJ_FILES = torture/locktest.o + MANPAGES += torture/man/locktest.1 COV_TARGET = test diff --git a/source4/torture/libnet/libnet_domain.c b/source4/torture/libnet/libnet_domain.c index 3c8d574f0e..eb6abc45d5 100644 --- a/source4/torture/libnet/libnet_domain.c +++ b/source4/torture/libnet/libnet_domain.c @@ -136,7 +136,7 @@ bool torture_domain_open_lsa(struct torture_context *torture) of specific server name. */ domain_name = lp_workgroup(torture->lp_ctx); - ctx = libnet_context_init(NULL, torture->lp_ctx); + ctx = libnet_context_init(torture->ev, torture->lp_ctx); if (ctx == NULL) { d_printf("failed to create libnet context\n"); return false; @@ -190,7 +190,7 @@ bool torture_domain_close_lsa(struct torture_context *torture) return false; } - ctx = libnet_context_init(NULL, torture->lp_ctx); + ctx = libnet_context_init(torture->ev, torture->lp_ctx); if (ctx == NULL) { d_printf("failed to create libnet context\n"); ret = false; @@ -245,7 +245,6 @@ bool torture_domain_open_samr(struct torture_context *torture) { NTSTATUS status; struct libnet_context *ctx; - struct event_context *evt_ctx=NULL; TALLOC_CTX *mem_ctx; struct policy_handle domain_handle, handle; struct libnet_DomainOpen io; @@ -255,7 +254,7 @@ bool torture_domain_open_samr(struct torture_context *torture) mem_ctx = talloc_init("test_domainopen_lsa"); - ctx = libnet_context_init(evt_ctx, torture->lp_ctx); + ctx = libnet_context_init(torture->ev, torture->lp_ctx); ctx->cred = cmdline_credentials; /* we're accessing domain controller so the domain name should be @@ -320,7 +319,7 @@ bool torture_domain_close_samr(struct torture_context *torture) return false; } - ctx = libnet_context_init(NULL, torture->lp_ctx); + ctx = libnet_context_init(torture->ev, torture->lp_ctx); if (ctx == NULL) { d_printf("failed to create libnet context\n"); ret = false; @@ -388,7 +387,7 @@ bool torture_domain_list(struct torture_context *torture) return false; } - ctx = libnet_context_init(NULL, torture->lp_ctx); + ctx = libnet_context_init(torture->ev, torture->lp_ctx); if (ctx == NULL) { d_printf("failed to create libnet context\n"); ret = false; diff --git a/source4/torture/libnet/libnet_group.c b/source4/torture/libnet/libnet_group.c index cabccdbe66..12b8167a86 100644 --- a/source4/torture/libnet/libnet_group.c +++ b/source4/torture/libnet/libnet_group.c @@ -235,7 +235,7 @@ bool torture_groupinfo_api(struct torture_context *torture) prep_mem_ctx = talloc_init("prepare torture group info"); - ctx = libnet_context_init(NULL, torture->lp_ctx); + ctx = libnet_context_init(torture->ev, torture->lp_ctx); ctx->cred = cmdline_credentials; status = torture_rpc_connection(torture, @@ -300,7 +300,7 @@ bool torture_grouplist(struct torture_context *torture) struct libnet_GroupList req; int i; - ctx = libnet_context_init(NULL, torture->lp_ctx); + ctx = libnet_context_init(torture->ev, torture->lp_ctx); ctx->cred = cmdline_credentials; domain_name.string = lp_workgroup(torture->lp_ctx); @@ -361,7 +361,7 @@ bool torture_creategroup(struct torture_context *torture) mem_ctx = talloc_init("test_creategroup"); - ctx = libnet_context_init(NULL, torture->lp_ctx); + ctx = libnet_context_init(torture->ev, torture->lp_ctx); ctx->cred = cmdline_credentials; req.in.group_name = TEST_GROUPNAME; diff --git a/source4/torture/libnet/libnet_lookup.c b/source4/torture/libnet/libnet_lookup.c index 9167d1de3e..b25b51b7d9 100644 --- a/source4/torture/libnet/libnet_lookup.c +++ b/source4/torture/libnet/libnet_lookup.c @@ -40,7 +40,7 @@ bool torture_lookup(struct torture_context *torture) mem_ctx = talloc_init("test_lookup"); - ctx = libnet_context_init(NULL, torture->lp_ctx); + ctx = libnet_context_init(torture->ev, torture->lp_ctx); ctx->cred = cmdline_credentials; lookup.in.hostname = torture_setting_string(torture, "host", NULL); @@ -84,7 +84,7 @@ bool torture_lookup_host(struct torture_context *torture) mem_ctx = talloc_init("test_lookup_host"); - ctx = libnet_context_init(NULL, torture->lp_ctx); + ctx = libnet_context_init(torture->ev, torture->lp_ctx); ctx->cred = cmdline_credentials; lookup.in.hostname = torture_setting_string(torture, "host", NULL); @@ -127,7 +127,7 @@ bool torture_lookup_pdc(struct torture_context *torture) mem_ctx = talloc_init("test_lookup_pdc"); - ctx = libnet_context_init(NULL, torture->lp_ctx); + ctx = libnet_context_init(torture->ev, torture->lp_ctx); ctx->cred = cmdline_credentials; talloc_steal(ctx, mem_ctx); @@ -171,7 +171,7 @@ bool torture_lookup_sam_name(struct torture_context *torture) struct libnet_context *ctx; struct libnet_LookupName r; - ctx = libnet_context_init(NULL, torture->lp_ctx); + ctx = libnet_context_init(torture->ev, torture->lp_ctx); ctx->cred = cmdline_credentials; mem_ctx = talloc_init("torture lookup sam name"); diff --git a/source4/torture/libnet/libnet_rpc.c b/source4/torture/libnet/libnet_rpc.c index 282837d3fe..f25c1ecc48 100644 --- a/source4/torture/libnet/libnet_rpc.c +++ b/source4/torture/libnet/libnet_rpc.c @@ -89,7 +89,7 @@ static bool torture_rpc_connect(struct torture_context *torture, { struct libnet_context *ctx; - ctx = libnet_context_init(NULL, torture->lp_ctx); + ctx = libnet_context_init(torture->ev, torture->lp_ctx); ctx->cred = cmdline_credentials; d_printf("Testing connection to LSA interface\n"); diff --git a/source4/torture/libnet/libnet_share.c b/source4/torture/libnet/libnet_share.c index eb1edff18d..6bc5be40a6 100644 --- a/source4/torture/libnet/libnet_share.c +++ b/source4/torture/libnet/libnet_share.c @@ -131,7 +131,7 @@ bool torture_listshares(struct torture_context *torture) goto done; } - libnetctx = libnet_context_init(NULL, torture->lp_ctx); + libnetctx = libnet_context_init(torture->ev, torture->lp_ctx); if (!libnetctx) { printf("Couldn't allocate libnet context\n"); ret = false; @@ -210,7 +210,7 @@ bool torture_delshare(struct torture_context *torture) status = torture_rpc_binding(torture, &binding); torture_assert_ntstatus_ok(torture, status, "Failed to get binding"); - libnetctx = libnet_context_init(NULL, torture->lp_ctx); + libnetctx = libnet_context_init(torture->ev, torture->lp_ctx); libnetctx->cred = cmdline_credentials; status = torture_rpc_connection(torture, diff --git a/source4/torture/libnet/libnet_user.c b/source4/torture/libnet/libnet_user.c index 5446087034..15e3f03506 100644 --- a/source4/torture/libnet/libnet_user.c +++ b/source4/torture/libnet/libnet_user.c @@ -241,7 +241,7 @@ bool torture_createuser(struct torture_context *torture) mem_ctx = talloc_init("test_createuser"); - ctx = libnet_context_init(NULL, torture->lp_ctx); + ctx = libnet_context_init(torture->ev, torture->lp_ctx); ctx->cred = cmdline_credentials; req.in.user_name = TEST_USERNAME; @@ -287,7 +287,7 @@ bool torture_deleteuser(struct torture_context *torture) prep_mem_ctx = talloc_init("prepare test_deleteuser"); - ctx = libnet_context_init(NULL, torture->lp_ctx); + ctx = libnet_context_init(torture->ev, torture->lp_ctx); ctx->cred = cmdline_credentials; req.in.user_name = TEST_USERNAME; @@ -482,7 +482,7 @@ bool torture_modifyuser(struct torture_context *torture) prep_mem_ctx = talloc_init("prepare test_deleteuser"); - ctx = libnet_context_init(NULL, torture->lp_ctx); + ctx = libnet_context_init(torture->ev, torture->lp_ctx); ctx->cred = cmdline_credentials; status = torture_rpc_connection(torture, @@ -616,7 +616,7 @@ bool torture_userinfo_api(struct torture_context *torture) prep_mem_ctx = talloc_init("prepare torture user info"); - ctx = libnet_context_init(NULL, torture->lp_ctx); + ctx = libnet_context_init(torture->ev, torture->lp_ctx); ctx->cred = cmdline_credentials; status = torture_rpc_connection(torture, @@ -681,7 +681,7 @@ bool torture_userlist(struct torture_context *torture) struct libnet_UserList req; int i; - ctx = libnet_context_init(NULL, torture->lp_ctx); + ctx = libnet_context_init(torture->ev, torture->lp_ctx); ctx->cred = cmdline_credentials; domain_name.string = lp_workgroup(torture->lp_ctx); diff --git a/source4/torture/local/config.mk b/source4/torture/local/config.mk index 4143d415cf..efdea7f66a 100644 --- a/source4/torture/local/config.mk +++ b/source4/torture/local/config.mk @@ -5,35 +5,6 @@ SUBSYSTEM = torture INIT_FUNCTION = torture_local_init PRIVATE_PROTO_HEADER = \ proto.h -OBJ_FILES = \ - ../../lib/charset/tests/iconv.o \ - ../../lib/talloc/testsuite.o \ - ../../lib/replace/test/getifaddrs.o \ - ../../lib/replace/test/os2_delete.o \ - ../../lib/replace/test/strptime.o \ - ../../lib/replace/test/testsuite.o \ - ../../lib/messaging/tests/messaging.o \ - ../../lib/messaging/tests/irpc.o \ - ../../librpc/tests/binding_string.o \ - ../../lib/util/tests/idtree.o \ - ../../lib/socket/testsuite.o \ - ../../lib/socket_wrapper/testsuite.o \ - ../../libcli/resolve/testsuite.o \ - ../../lib/util/tests/strlist.o \ - ../../lib/util/tests/str.o \ - ../../lib/util/tests/file.o \ - ../../lib/util/tests/genrand.o \ - ../../lib/compression/testsuite.o \ - ../../lib/charset/tests/charset.o \ - ../../libcli/security/tests/sddl.o \ - ../../lib/tdr/testsuite.o \ - ../../lib/events/testsuite.o \ - ../../param/tests/share.o \ - ../../param/tests/loadparm.o \ - ../../auth/credentials/tests/simple.o \ - local.o \ - dbspeed.o \ - torture.o PRIVATE_DEPENDENCIES = \ RPC_NDR_ECHO \ TDR \ @@ -48,3 +19,34 @@ PRIVATE_DEPENDENCIES = \ torture_registry # End SUBSYSTEM TORTURE_LOCAL ################################# + +TORTURE_LOCAL_OBJ_FILES = \ + lib/charset/tests/iconv.o \ + lib/talloc/testsuite.o \ + lib/replace/test/getifaddrs.o \ + lib/replace/test/os2_delete.o \ + lib/replace/test/strptime.o \ + lib/replace/test/testsuite.o \ + lib/messaging/tests/messaging.o \ + lib/messaging/tests/irpc.o \ + librpc/tests/binding_string.o \ + lib/util/tests/idtree.o \ + lib/socket/testsuite.o \ + lib/socket_wrapper/testsuite.o \ + libcli/resolve/testsuite.o \ + lib/util/tests/strlist.o \ + lib/util/tests/str.o \ + lib/util/tests/file.o \ + lib/util/tests/genrand.o \ + lib/compression/testsuite.o \ + lib/charset/tests/charset.o \ + libcli/security/tests/sddl.o \ + lib/tdr/testsuite.o \ + lib/events/testsuite.o \ + param/tests/share.o \ + param/tests/loadparm.o \ + auth/credentials/tests/simple.o \ + torture/local/local.o \ + torture/local/dbspeed.o \ + torture/local/torture.o + diff --git a/source4/torture/rpc/dfs.c b/source4/torture/rpc/dfs.c index 9cfdd80578..5656476922 100644 --- a/source4/torture/rpc/dfs.c +++ b/source4/torture/rpc/dfs.c @@ -56,7 +56,7 @@ static bool test_NetShareAdd(TALLOC_CTX *mem_ctx, printf("Creating share %s\n", sharename); - if (!(libnetctx = libnet_context_init(NULL, tctx->lp_ctx))) { + if (!(libnetctx = libnet_context_init(tctx->ev, tctx->lp_ctx))) { return false; } @@ -96,7 +96,7 @@ static bool test_NetShareDel(TALLOC_CTX *mem_ctx, printf("Deleting share %s\n", sharename); - if (!(libnetctx = libnet_context_init(NULL, tctx->lp_ctx))) { + if (!(libnetctx = libnet_context_init(tctx->ev, tctx->lp_ctx))) { return false; } diff --git a/source4/torture/rpc/testjoin.c b/source4/torture/rpc/testjoin.c index 892886c08c..100e7cead2 100644 --- a/source4/torture/rpc/testjoin.c +++ b/source4/torture/rpc/testjoin.c @@ -311,7 +311,7 @@ _PUBLIC_ struct test_join *torture_join_domain(struct torture_context *tctx, struct samr_SetUserInfo s; union samr_UserInfo u; - tj = talloc(NULL, struct test_join); + tj = talloc(tctx, struct test_join); if (!tj) return NULL; libnet_r = talloc(tj, struct libnet_JoinDomain); @@ -320,7 +320,7 @@ _PUBLIC_ struct test_join *torture_join_domain(struct torture_context *tctx, return NULL; } - libnet_ctx = libnet_context_init(NULL, tctx->lp_ctx); + libnet_ctx = libnet_context_init(tctx->ev, tctx->lp_ctx); if (!libnet_ctx) { talloc_free(tj); return NULL; diff --git a/source4/torture/smb2/config.mk b/source4/torture/smb2/config.mk index 7463a31318..379632f0e7 100644 --- a/source4/torture/smb2/config.mk +++ b/source4/torture/smb2/config.mk @@ -6,7 +6,12 @@ SUBSYSTEM = torture INIT_FUNCTION = torture_smb2_init PRIVATE_PROTO_HEADER = \ proto.h -OBJ_FILES = \ +PRIVATE_DEPENDENCIES = \ + LIBCLI_SMB2 POPT_CREDENTIALS +# End SUBSYSTEM TORTURE_SMB2 +################################# + +TORTURE_SMB2_OBJ_FILES = $(addprefix torture/smb2/, \ connect.o \ scan.o \ util.o \ @@ -15,8 +20,5 @@ OBJ_FILES = \ find.o \ lock.o \ notify.o \ - smb2.o -PRIVATE_DEPENDENCIES = \ - LIBCLI_SMB2 POPT_CREDENTIALS -# End SUBSYSTEM TORTURE_SMB2 -################################# + smb2.o) + diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c index 4eeea73003..faae784e4b 100644 --- a/source4/torture/smbtorture.c +++ b/source4/torture/smbtorture.c @@ -36,6 +36,8 @@ #include "librpc/rpc/dcerpc.h" #include "param/param.h" +#include "auth/credentials/credentials.h" + static bool run_matching(struct torture_context *torture, const char *prefix, const char *expr, @@ -673,7 +675,7 @@ int main(int argc,char *argv[]) exit(1); } - torture = torture_context_init(talloc_autofree_context(), ui_ops); + torture = torture_context_init(cli_credentials_get_event_context(cmdline_credentials), ui_ops); if (basedir != NULL) { if (basedir[0] != '/') { fprintf(stderr, "Please specify an absolute path to --basedir\n"); diff --git a/source4/torture/torture.c b/source4/torture/torture.c index ea8efaa8c3..8a41b72249 100644 --- a/source4/torture/torture.c +++ b/source4/torture/torture.c @@ -48,6 +48,18 @@ bool torture_register_suite(struct torture_suite *suite) _PUBLIC_ int torture_init(void) { + extern NTSTATUS torture_base_init(void); + extern NTSTATUS torture_ldap_init(void); + extern NTSTATUS torture_local_init(void); + extern NTSTATUS torture_nbt_init(void); + extern NTSTATUS torture_nbench_init(void); + extern NTSTATUS torture_rap_init(void); + extern NTSTATUS torture_rpc_init(void); + extern NTSTATUS torture_smb2_init(void); + extern NTSTATUS torture_net_init(void); + extern NTSTATUS torture_raw_init(void); + extern NTSTATUS torture_unix_init(void); + extern NTSTATUS torture_winbind_init(void); init_module_fn static_init[] = { STATIC_torture_MODULES }; init_module_fn *shared_init = load_samba_modules(NULL, cmdline_lp_ctx, "torture"); diff --git a/source4/torture/ui.c b/source4/torture/ui.c index a7025aac95..efa584ebea 100644 --- a/source4/torture/ui.c +++ b/source4/torture/ui.c @@ -27,14 +27,14 @@ #include "auth/credentials/credentials.h" #include "lib/cmdline/popt_common.h" -struct torture_context *torture_context_init(TALLOC_CTX *mem_ctx, +struct torture_context *torture_context_init(struct event_context *event_ctx, const struct torture_ui_ops *ui_ops) { - struct torture_context *torture = talloc_zero(mem_ctx, + struct torture_context *torture = talloc_zero(event_ctx, struct torture_context); torture->ui_ops = ui_ops; torture->returncode = true; - torture->ev = cli_credentials_get_event_context(cmdline_credentials); + torture->ev = event_ctx; if (ui_ops->init) ui_ops->init(torture); diff --git a/source4/torture/ui.h b/source4/torture/ui.h index ec4a658d74..15b04c2397 100644 --- a/source4/torture/ui.h +++ b/source4/torture/ui.h @@ -390,7 +390,7 @@ bool torture_suite_init_tcase(struct torture_suite *suite, struct torture_tcase *tcase, const char *name); -struct torture_context *torture_context_init(TALLOC_CTX *mem_ctx, +struct torture_context *torture_context_init(struct event_context *event_ctx, const struct torture_ui_ops *ui_ops); #endif /* __TORTURE_UI_H__ */ diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c index 513070500e..c1a20094f3 100644 --- a/source4/torture/util_smb.c +++ b/source4/torture/util_smb.c @@ -553,8 +553,7 @@ _PUBLIC_ bool torture_open_connection_ev(struct smbcli_state **c, _PUBLIC_ bool torture_open_connection(struct smbcli_state **c, struct torture_context *tctx, int conn_index) { - return torture_open_connection_ev(c, conn_index, tctx, - cli_credentials_get_event_context(cmdline_credentials)); + return torture_open_connection_ev(c, conn_index, tctx, tctx->ev); } diff --git a/source4/torture/winbind/config.mk b/source4/torture/winbind/config.mk index b64b0647fc..155766a677 100644 --- a/source4/torture/winbind/config.mk +++ b/source4/torture/winbind/config.mk @@ -6,10 +6,10 @@ SUBSYSTEM = torture INIT_FUNCTION = torture_winbind_init PRIVATE_PROTO_HEADER = \ proto.h -OBJ_FILES = \ - winbind.o \ - struct_based.o PRIVATE_DEPENDENCIES = \ LIBWINBIND-CLIENT # End SUBSYSTEM TORTURE_WINBIND ################################# + +TORTURE_WINBIND_OBJ_FILES = $(addprefix torture/winbind/, winbind.o struct_based.o) + |