{
struct torture_suite *suite;
- suite = torture_suite_create(talloc_autofree_context(), "echo");
+ suite = torture_suite_create(ctx, "echo");
NT_STATUS_HAVE_NO_MEMORY(suite);
torture_suite_add_simple_test(suite, "udp", torture_echo_udp);
suite->description = talloc_strdup(suite, "libcli/echo interface tests");
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
NTSTATUS torture_base_init(TALLOC_CTX *ctx)
{
- struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "base");
+ struct torture_suite *suite = torture_suite_create(ctx, "base");
torture_suite_add_2smb_test(suite, "fdpass", run_fdpasstest);
torture_suite_add_suite(suite, torture_base_locktest(suite));
suite->description = talloc_strdup(suite,
"Basic SMB tests (imported from the original smbtorture)");
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
NTSTATUS torture_dfs_init(TALLOC_CTX *ctx)
{
- struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "dfs");
+ struct torture_suite *suite = torture_suite_create(ctx, "dfs");
struct torture_suite *suite_basic = torture_suite_create(suite, "domain");
torture_suite_add_suite(suite, suite_basic);
suite->description = talloc_strdup(suite, "DFS referrals calls");
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
NTSTATUS torture_bind_dns_init(TALLOC_CTX *ctx)
{
struct torture_suite *suite;
- TALLOC_CTX *mem_ctx = talloc_autofree_context();
/* register DNS related test cases */
- suite = dlz_bind9_suite(mem_ctx);
+ suite = dlz_bind9_suite(ctx);
if (!suite) return NT_STATUS_NO_MEMORY;
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
NTSTATUS torture_internal_dns_init(TALLOC_CTX *ctx)
{
struct torture_suite *suite;
- TALLOC_CTX *mem_ctx = talloc_autofree_context();
/* register internal DNS torture test cases */
- suite = internal_dns_suite(mem_ctx);
+ suite = internal_dns_suite(ctx);
if (!suite) return NT_STATUS_NO_MEMORY;
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
NTSTATUS torture_drs_init(TALLOC_CTX *ctx)
{
struct torture_suite *suite;
- TALLOC_CTX *mem_ctx = talloc_autofree_context();
/* register RPC related test cases */
- suite = torture_drs_rpc_suite(mem_ctx, "drs.rpc");
+ suite = torture_drs_rpc_suite(ctx, "drs.rpc");
if (!suite) return NT_STATUS_NO_MEMORY;
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
/* register DRS Unit test cases */
- suite = torture_drs_unit_suite(mem_ctx, "drs.unit");
+ suite = torture_drs_unit_suite(ctx, "drs.unit");
if (!suite) return NT_STATUS_NO_MEMORY;
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
NTSTATUS torture_krb5_init(TALLOC_CTX *ctx)
{
- struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "krb5");
+ struct torture_suite *suite = torture_suite_create(ctx, "krb5");
struct torture_suite *kdc_suite = torture_suite_create(suite, "kdc");
suite->description = talloc_strdup(suite, "Kerberos tests");
kdc_suite->description = talloc_strdup(kdc_suite, "Kerberos KDC tests");
torture_suite_add_suite(kdc_suite, torture_krb5_canon(kdc_suite));
torture_suite_add_suite(suite, kdc_suite);
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
NTSTATUS torture_krb5_init(TALLOC_CTX *ctx)
{
struct torture_suite *suite =
- torture_suite_create(talloc_autofree_context(), "krb5");
+ torture_suite_create(ctx, "krb5");
struct torture_suite *kdc_suite = torture_suite_create(suite, "kdc");
suite->description = talloc_strdup(suite, "Kerberos tests");
kdc_suite->description = talloc_strdup(kdc_suite, "Kerberos KDC tests");
torture_suite_add_suite(suite, kdc_suite);
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
NTSTATUS torture_ldap_init(TALLOC_CTX *ctx)
{
- struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "ldap");
+ struct torture_suite *suite = torture_suite_create(ctx, "ldap");
torture_suite_add_simple_test(suite, "bench-cldap", torture_bench_cldap);
torture_suite_add_simple_test(suite, "basic", torture_ldap_basic);
torture_suite_add_simple_test(suite, "sort", torture_ldap_sort);
suite->description = talloc_strdup(suite, "LDAP and CLDAP tests");
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
NTSTATUS torture_net_init(TALLOC_CTX *ctx)
{
struct torture_suite *suite = torture_suite_create(
- talloc_autofree_context(), "net");
+ ctx, "net");
torture_suite_add_simple_test(suite, "userinfo", torture_userinfo);
torture_suite_add_simple_test(suite, "useradd", torture_useradd);
suite->description = talloc_strdup(suite, "libnet convenience interface tests");
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
{
struct torture_suite *suite;
- suite = torture_suite_create(talloc_autofree_context(), "netapi");
+ suite = torture_suite_create(ctx, "netapi");
torture_suite_add_simple_test(suite, "server", torture_libnetapi_server);
torture_suite_add_simple_test(suite, "group", torture_libnetapi_group);
suite->description = talloc_strdup(suite, "libnetapi convenience interface tests");
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
{
struct torture_suite *suite;
- suite = torture_suite_create(talloc_autofree_context(), "libsmbclient");
+ suite = torture_suite_create(ctx, "libsmbclient");
torture_suite_add_simple_test(suite, "version", torture_libsmbclient_version);
torture_suite_add_simple_test(suite, "initialize", torture_libsmbclient_initialize);
suite->description = talloc_strdup(suite, "libsmbclient interface tests");
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
{
int i;
struct torture_suite *suite = torture_suite_create(
- talloc_autofree_context(), "local");
+ ctx, "local");
torture_suite_add_simple_test(suite, "talloc", torture_local_talloc);
torture_suite_add_simple_test(suite, "replace", torture_local_replace);
for (i = 0; suite_generators[i]; i++)
torture_suite_add_suite(suite,
- suite_generators[i](talloc_autofree_context()));
+ suite_generators[i](ctx));
suite->description = talloc_strdup(suite,
"Local, Samba-specific tests");
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
NTSTATUS torture_nbench_init(TALLOC_CTX *ctx)
{
struct torture_suite *suite = torture_suite_create(
- talloc_autofree_context(), "bench");
+ ctx, "bench");
torture_suite_add_simple_test(suite, "nbench", torture_nbench);
suite->description = talloc_strdup(suite, "Benchmarks");
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
NTSTATUS torture_nbt_init(TALLOC_CTX *ctx)
{
struct torture_suite *suite = torture_suite_create(
- talloc_autofree_context(), "nbt");
+ ctx, "nbt");
/* nbt tests */
torture_suite_add_suite(suite, torture_nbt_register(suite));
torture_suite_add_suite(suite, torture_nbt_wins(suite));
suite->description = talloc_strdup(suite,
"NetBIOS over TCP/IP and WINS tests");
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
NTSTATUS torture_ntp_init(TALLOC_CTX *ctx)
{
- struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "ntp");
+ struct torture_suite *suite = torture_suite_create(ctx, "ntp");
struct torture_rpc_tcase *tcase;
tcase = torture_suite_add_machine_workstation_rpc_iface_tcase(suite,
suite->description = talloc_strdup(suite, "NTP tests");
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
NTSTATUS torture_rap_init(TALLOC_CTX *ctx)
{
- struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "rap");
+ struct torture_suite *suite = torture_suite_create(ctx, "rap");
struct torture_suite *suite_basic = torture_suite_create(suite, "basic");
torture_suite_add_suite(suite, suite_basic);
suite->description = talloc_strdup(suite,
"Remote Administration Protocol tests");
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
NTSTATUS torture_raw_init(TALLOC_CTX *ctx)
{
struct torture_suite *suite = torture_suite_create(
- talloc_autofree_context(), "raw");
+ ctx, "raw");
/* RAW smb tests */
torture_suite_add_simple_test(suite, "bench-oplock", torture_bench_oplock);
torture_suite_add_simple_test(suite, "ping-pong", torture_ping_pong);
suite->description = talloc_strdup(suite, "Tests for the raw SMB interface");
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
NTSTATUS torture_rpc_init(TALLOC_CTX *ctx)
{
- struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "rpc");
+ struct torture_suite *suite = torture_suite_create(ctx, "rpc");
ndr_table_init();
suite->description = talloc_strdup(suite, "DCE/RPC protocol and interface tests");
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
NTSTATUS torture_smb2_init(TALLOC_CTX *ctx)
{
- struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "smb2");
+ struct torture_suite *suite = torture_suite_create(ctx, "smb2");
torture_suite_add_simple_test(suite, "connect", torture_smb2_connect);
torture_suite_add_suite(suite, torture_smb2_scan_init());
torture_suite_add_suite(suite, torture_smb2_getinfo_init());
suite->description = talloc_strdup(suite, "SMB2-specific tests");
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
struct torture_test;
int torture_init(TALLOC_CTX *);
-bool torture_register_suite(struct torture_suite *suite);
+bool torture_register_suite(TALLOC_CTX *, struct torture_suite *suite);
void torture_shell(struct torture_context *tctx);
void torture_print_testsuites(bool structured);
bool torture_run_named_tests(struct torture_context *torture, const char *name,
struct torture_suite *torture_root = NULL;
-bool torture_register_suite(struct torture_suite *suite)
+bool torture_register_suite(TALLOC_CTX *mem_ctx, struct torture_suite *suite)
{
if (!suite)
return true;
if (torture_root == NULL)
- torture_root = talloc_zero(talloc_autofree_context(), struct torture_suite);
+ torture_root = talloc_zero(mem_ctx, struct torture_suite);
return torture_suite_add_suite(torture_root, suite);
}
NTSTATUS torture_unix_init(TALLOC_CTX *ctx)
{
struct torture_suite *suite =
- torture_suite_create(talloc_autofree_context(), "unix");
+ torture_suite_create(ctx, "unix");
suite->description =
talloc_strdup(suite, "CIFS UNIX extensions tests");
torture_suite_add_simple_test(suite,
"info2", unix_torture_unix_info2);
- return (torture_register_suite(suite)) ? NT_STATUS_OK
+ return (torture_register_suite(ctx, suite)) ? NT_STATUS_OK
: NT_STATUS_UNSUCCESSFUL;
}
NTSTATUS torture_vfs_init(TALLOC_CTX *ctx)
{
struct torture_suite *suite = torture_suite_create(
- talloc_autofree_context(), "vfs");
+ ctx, "vfs");
suite->description = talloc_strdup(suite, "VFS modules tests");
torture_suite_add_suite(suite, torture_acl_xattr());
torture_suite_add_suite(suite, torture_vfs_fruit_file_id());
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
NTSTATUS torture_winbind_init(TALLOC_CTX *ctx)
{
- struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "winbind");
+ struct torture_suite *suite = torture_suite_create(ctx, "winbind");
struct torture_suite *pac_suite;
torture_suite_add_suite(suite, torture_winbind_struct_init());
torture_suite_add_suite(suite, torture_wbclient());
- pac_suite = torture_suite_create(talloc_autofree_context(), "pac");
+ pac_suite = torture_suite_create(ctx, "pac");
torture_suite_add_simple_test(pac_suite,
"GSSAPI", torture_winbind_pac_gssapi);
torture_suite_add_simple_test(pac_suite,
suite->description = talloc_strdup(suite, "WINBIND tests");
- torture_register_suite(suite);
+ torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}