1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

r14720: Add torture_context argument to all torture tests

This commit is contained in:
Jelmer Vernooij 2006-03-25 16:01:28 +00:00 committed by Gerald (Jerry) Carter
parent a15a8d87b5
commit 3c7a5ce291
119 changed files with 197 additions and 165 deletions

View File

@ -48,6 +48,8 @@
#define BOOL int
#endif
struct torture_context;
static struct timeval timeval_current(void)
{
struct timeval tv;
@ -842,7 +844,7 @@ BOOL test_lifeless(void)
}
BOOL torture_local_talloc(void)
BOOL torture_local_talloc(struct torture_context *torture)
{
BOOL ret = True;
@ -871,8 +873,8 @@ BOOL torture_local_talloc(void)
#if !defined(_SAMBA_BUILD_) || ((SAMBA_VERSION_MAJOR==3)&&(SAMBA_VERSION_MINOR<9))
int main(void)
{
if (!torture_local_talloc()) {
printf("ERROR: TESTSUIE FAILED\n");
if (!torture_local_talloc(NULL)) {
printf("ERROR: TESTSUITE FAILED\n");
return -1;
}
return 0;

View File

@ -22,8 +22,9 @@
#include "auth/auth.h"
#include "auth/ntlmssp/ntlmssp.h"
#include "lib/cmdline/popt_common.h"
#include "torture/torture.h"
BOOL torture_ntlmssp_self_check(void)
BOOL torture_ntlmssp_self_check(struct torture_context *torture)
{
struct gensec_security *gensec_security;
struct gensec_ntlmssp_state *gensec_ntlmssp_state;

View File

@ -29,6 +29,7 @@
#include "samba3/samba3.h"
#include "libcli/security/proto.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "torture/torture.h"
static BOOL torture_pac_self_check(void)
{
@ -693,7 +694,7 @@ static BOOL torture_pac_saved_check(void)
return True;
}
BOOL torture_pac(void)
BOOL torture_pac(struct torture_context *torture)
{
BOOL ret = True;
ret &= torture_pac_self_check();

View File

@ -384,7 +384,7 @@ static void setpathinfo_aliases(struct smbcli_state *cli)
/* look for aliased info levels in trans2 calls */
BOOL torture_trans2_aliases(void)
BOOL torture_trans2_aliases(struct torture_context *torture)
{
struct smbcli_state *cli;

View File

@ -87,7 +87,7 @@ static const struct trunc_open_results attr_results[] = {
};
BOOL torture_openattrtest(void)
BOOL torture_openattrtest(struct torture_context *torture)
{
struct smbcli_state *cli1;
const char *fname = "\\openattr.file";

View File

@ -116,7 +116,7 @@ static BOOL tcon_devtest(struct smbcli_state *cli,
test whether fnums and tids open on one VC are available on another (a major
security hole)
*/
static BOOL run_fdpasstest(void)
static BOOL run_fdpasstest(struct torture_context *torture)
{
struct smbcli_state *cli1, *cli2;
const char *fname = "\\fdpass.tst";
@ -174,7 +174,7 @@ static BOOL run_fdpasstest(void)
/**
This checks how the getatr calls works
*/
static BOOL run_attrtest(void)
static BOOL run_attrtest(struct torture_context *torture)
{
struct smbcli_state *cli;
int fnum;
@ -244,7 +244,7 @@ static BOOL run_attrtest(void)
/**
This checks a couple of trans2 calls
*/
static BOOL run_trans2test(void)
static BOOL run_trans2test(struct torture_context *torture)
{
struct smbcli_state *cli;
int fnum;
@ -378,7 +378,7 @@ static BOOL run_trans2test(void)
}
/* send smb negprot commands, not reading the response */
static BOOL run_negprot_nowait(void)
static BOOL run_negprot_nowait(struct torture_context *torture)
{
int i;
struct smbcli_state *cli, *cli2;
@ -431,7 +431,7 @@ static BOOL run_negprot_nowait(void)
this checks to see if a secondary tconx can use open files from an
earlier tconx
*/
static BOOL run_tcon_test(void)
static BOOL run_tcon_test(struct torture_context *torture)
{
struct smbcli_state *cli;
const char *fname = "\\tcontest.tmp";
@ -544,7 +544,7 @@ static BOOL run_tcon_test(void)
/**
checks for correct tconX support
*/
static BOOL run_tcon_devtype_test(void)
static BOOL run_tcon_devtype_test(struct torture_context *torture)
{
struct smbcli_state *cli1 = NULL;
NTSTATUS status;
@ -685,7 +685,7 @@ static BOOL rw_torture2(struct smbcli_state *c1, struct smbcli_state *c2)
#define BOOLSTR(b) ((b) ? "Yes" : "No")
static BOOL run_readwritetest(void)
static BOOL run_readwritetest(struct torture_context *torture)
{
struct smbcli_state *cli1, *cli2;
BOOL test1, test2 = True;
@ -794,7 +794,7 @@ static BOOL run_deferopen(struct smbcli_state *cli, int dummy)
Try with a wrong vuid and check error message.
*/
static BOOL run_vuidtest(void)
static BOOL run_vuidtest(struct torture_context *torture)
{
struct smbcli_state *cli;
const char *fname = "\\vuid.tst";
@ -861,7 +861,7 @@ static BOOL run_vuidtest(void)
/*
Test open mode returns on read-only files.
*/
static BOOL run_opentest(void)
static BOOL run_opentest(struct torture_context *torture)
{
static struct smbcli_state *cli1;
static struct smbcli_state *cli2;
@ -1397,7 +1397,7 @@ error_test80:
/**
Test ntcreate calls made by xcopy
*/
static BOOL run_xcopy(void)
static BOOL run_xcopy(struct torture_context *torture)
{
struct smbcli_state *cli1;
const char *fname = "\\test.txt";
@ -1441,7 +1441,7 @@ static BOOL run_xcopy(void)
/**
tries variants of chkpath
*/
static BOOL torture_chkpath_test(void)
static BOOL torture_chkpath_test(struct torture_context *torture)
{
struct smbcli_state *cli;
int fnum;

View File

@ -229,7 +229,7 @@ static BOOL test_widea(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
return True;
}
BOOL torture_charset(void)
BOOL torture_charset(struct torture_context *torture)
{
static struct smbcli_state *cli;
BOOL ret = True;

View File

@ -625,7 +625,7 @@ static BOOL test_finfo_after_write(struct smbcli_state *cli, TALLOC_CTX *mem_ctx
/*
testing of delayed update of write_time
*/
BOOL torture_delay_write(void)
BOOL torture_delay_write(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -1622,7 +1622,7 @@ static BOOL deltest21(struct smbcli_state **ppcli1, struct smbcli_state **ppcli2
/*
Test delete on close semantics.
*/
BOOL torture_test_delete(void)
BOOL torture_test_delete(struct torture_context *torture)
{
struct smbcli_state *cli1 = NULL;
struct smbcli_state *cli2 = NULL;

View File

@ -1410,7 +1410,7 @@ static void progress_bar(uint_t i, uint_t total)
/*
this produces a matrix of deny mode behaviour for 1 connection
*/
BOOL torture_denytest1(void)
BOOL torture_denytest1(struct torture_context *torture)
{
static struct smbcli_state *cli1;
int fnum1, fnum2;
@ -1509,7 +1509,7 @@ failed:
/*
this produces a matrix of deny mode behaviour with 2 connections
*/
BOOL torture_denytest2(void)
BOOL torture_denytest2(struct torture_context *torture)
{
static struct smbcli_state *cli1, *cli2;
int fnum1, fnum2;
@ -1610,7 +1610,7 @@ failed:
/*
simple test harness for playing with deny modes
*/
BOOL torture_denytest3(void)
BOOL torture_denytest3(struct torture_context *torture)
{
struct smbcli_state *cli1, *cli2;
int fnum1, fnum2;
@ -1938,7 +1938,7 @@ BOOL torture_ntdenytest1(struct smbcli_state *cli, int client)
/*
a denytest for ntcreatex
*/
BOOL torture_ntdenytest2(void)
BOOL torture_ntdenytest2(struct torture_context *torture)
{
struct smbcli_state *cli1, *cli2;
BOOL ret;
@ -1980,7 +1980,7 @@ BOOL torture_ntdenytest2(void)
/*
test sharing of handles with DENY_DOS on a single connection
*/
BOOL torture_denydos_sharing(void)
BOOL torture_denydos_sharing(struct torture_context *torture)
{
struct smbcli_state *cli;
union smb_open io;

View File

@ -34,7 +34,7 @@ static void list_fn(struct clilist_file_info *finfo, const char *name, void *sta
/*
test directory listing speed
*/
BOOL torture_dirtest1(void)
BOOL torture_dirtest1(struct torture_context *torture)
{
int i;
struct smbcli_state *cli;
@ -89,7 +89,7 @@ BOOL torture_dirtest1(void)
return correct;
}
BOOL torture_dirtest2(void)
BOOL torture_dirtest2(struct torture_context *torture)
{
int i;
struct smbcli_state *cli;

View File

@ -127,7 +127,7 @@ static BOOL test_disconnect_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
/*
basic testing of disconnects
*/
BOOL torture_disconnect(void)
BOOL torture_disconnect(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -38,7 +38,7 @@
must not use posix semantics)
2) support for lock timeouts
*/
BOOL torture_locktest1(void)
BOOL torture_locktest1(struct torture_context *torture)
{
struct smbcli_state *cli1, *cli2;
const char *fname = BASEDIR "\\lockt1.lck";
@ -195,7 +195,7 @@ BOOL torture_locktest1(void)
3) the server denies unlock requests by an incorrect client PID
*/
BOOL torture_locktest2(void)
BOOL torture_locktest2(struct torture_context *torture)
{
struct smbcli_state *cli;
const char *fname = BASEDIR "\\lockt2.lck";
@ -336,7 +336,7 @@ BOOL torture_locktest2(void)
1) the server supports the full offset range in lock requests
*/
BOOL torture_locktest3(void)
BOOL torture_locktest3(struct torture_context *torture)
{
struct smbcli_state *cli1, *cli2;
const char *fname = BASEDIR "\\lockt3.lck";
@ -470,7 +470,7 @@ BOOL torture_locktest3(void)
/*
looks at overlapping locks
*/
BOOL torture_locktest4(void)
BOOL torture_locktest4(struct torture_context *torture)
{
struct smbcli_state *cli1, *cli2;
const char *fname = BASEDIR "\\lockt4.lck";
@ -640,7 +640,7 @@ BOOL torture_locktest4(void)
/*
looks at lock upgrade/downgrade.
*/
BOOL torture_locktest5(void)
BOOL torture_locktest5(struct torture_context *torture)
{
struct smbcli_state *cli1, *cli2;
const char *fname = BASEDIR "\\lockt5.lck";
@ -763,7 +763,7 @@ ret = NT_STATUS_IS_OK(smbcli_unlock(cli1->tree, fnum1, 0, 4)) &&
/*
tries the unusual lockingX locktype bits
*/
BOOL torture_locktest6(void)
BOOL torture_locktest6(struct torture_context *torture)
{
struct smbcli_state *cli;
const char *fname[1] = { "\\lock6.txt" };
@ -805,7 +805,7 @@ BOOL torture_locktest6(void)
return True;
}
BOOL torture_locktest7(void)
BOOL torture_locktest7(struct torture_context *torture)
{
struct smbcli_state *cli1;
const char *fname = BASEDIR "\\lockt7.lck";

View File

@ -154,7 +154,7 @@ static void gen_name(char *name)
}
BOOL torture_mangle(void)
BOOL torture_mangle(struct torture_context *torture)
{
extern int torture_numops;
static struct smbcli_state *cli;

View File

@ -89,7 +89,7 @@ static void show_bits(const struct bitmapping *bm, uint32_t value)
/*
print out server properties
*/
BOOL torture_test_properties(void)
BOOL torture_test_properties(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL correct = True;

View File

@ -28,7 +28,7 @@
/*
Test rename on files open with share delete and no share delete.
*/
BOOL torture_test_rename(void)
BOOL torture_test_rename(struct torture_context *torture)
{
struct smbcli_state *cli1;
const char *fname = "\\test.txt";

View File

@ -242,7 +242,7 @@ static BOOL scan_trans2(struct smbcli_state *cli, int op, int level,
}
BOOL torture_trans2_scan(void)
BOOL torture_trans2_scan(struct torture_context *torture)
{
static struct smbcli_state *cli;
int op, level;
@ -483,7 +483,7 @@ static BOOL scan_nttrans(struct smbcli_state *cli, int op, int level,
}
BOOL torture_nttrans_scan(void)
BOOL torture_nttrans_scan(struct torture_context *torture)
{
static struct smbcli_state *cli;
int op, level;
@ -523,7 +523,7 @@ BOOL torture_nttrans_scan(void)
/* scan for valid base SMB requests */
BOOL torture_smb_scan(void)
BOOL torture_smb_scan(struct torture_context *torture)
{
static struct smbcli_state *cli;
int op;

View File

@ -56,7 +56,7 @@ static BOOL try_failed_login(struct smbcli_state *cli)
return True;
}
BOOL torture_sec_leak(void)
BOOL torture_sec_leak(struct torture_context *torture)
{
struct smbcli_state *cli;
time_t t1 = time(NULL);

View File

@ -34,7 +34,7 @@
1) the server does not allow an unlink on a file that is open
*/
BOOL torture_unlinktest(void)
BOOL torture_unlinktest(struct torture_context *torture)
{
struct smbcli_state *cli;
const char *fname = BASEDIR "\\unlink.tst";

View File

@ -26,7 +26,7 @@
#include "torture/util.h"
#include "pstring.h"
BOOL torture_utable(void)
BOOL torture_utable(struct torture_context *torture)
{
struct smbcli_state *cli;
fstring fname;
@ -121,7 +121,7 @@ static char *form_name(int c)
return fname;
}
BOOL torture_casetable(void)
BOOL torture_casetable(struct torture_context *torture)
{
static struct smbcli_state *cli;
char *fname;

View File

@ -25,6 +25,7 @@
#include "libcli/ldap/ldap_client.h"
#include "lib/cmdline/popt_common.h"
#include "torture/torture.h"
#include "torture/ldap/proto.h"
static BOOL test_bind_simple(struct ldap_connection *conn, const char *userdn, const char *password)
@ -187,7 +188,7 @@ static BOOL test_compare_sasl(struct ldap_connection *conn, const char *basedn)
}
BOOL torture_ldap_basic(void)
BOOL torture_ldap_basic(struct torture_context *torture)
{
NTSTATUS status;
struct ldap_connection *conn;

View File

@ -24,6 +24,7 @@
#include "includes.h"
#include "libcli/cldap/cldap.h"
#include "librpc/gen_ndr/ndr_nbt.h"
#include "torture/torture.h"
#define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \
@ -164,7 +165,7 @@ done:
return ret;
}
BOOL torture_cldap(void)
BOOL torture_cldap(struct torture_context *torture)
{
TALLOC_CTX *mem_ctx;
BOOL ret = True;

View File

@ -101,7 +101,7 @@ static BOOL bench_cldap(TALLOC_CTX *mem_ctx, const char *address)
benchmark how fast a CLDAP server can respond to a series of parallel
requests
*/
BOOL torture_bench_cldap(void)
BOOL torture_bench_cldap(struct torture_context *torture)
{
const char *address;
struct nbt_name name;

View File

@ -69,7 +69,7 @@ static BOOL test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
BOOL torture_domainopen(void)
BOOL torture_domainopen(struct torture_context *torture)
{
NTSTATUS status;
const char *binding;

View File

@ -23,9 +23,10 @@
#include "lib/cmdline/popt_common.h"
#include "libnet/libnet.h"
#include "librpc/gen_ndr/nbt.h"
#include "torture/torture.h"
BOOL torture_lookup(void)
BOOL torture_lookup(struct torture_context *torture)
{
BOOL ret;
NTSTATUS status;
@ -62,7 +63,7 @@ done:
}
BOOL torture_lookup_host(void)
BOOL torture_lookup_host(struct torture_context *torture)
{
BOOL ret;
NTSTATUS status;
@ -98,7 +99,7 @@ done:
}
BOOL torture_lookup_pdc(void)
BOOL torture_lookup_pdc(struct torture_context *torture)
{
BOOL ret;
NTSTATUS status;

View File

@ -25,6 +25,7 @@
#include "librpc/gen_ndr/ndr_lsa.h"
#include "librpc/gen_ndr/ndr_samr.h"
#include "librpc/rpc/dcerpc.h"
#include "torture/torture.h"
static BOOL test_lsa_connect(struct libnet_context *ctx)
@ -70,7 +71,7 @@ static BOOL test_samr_connect(struct libnet_context *ctx)
return True;
}
BOOL torture_rpc_connect(void)
BOOL torture_rpc_connect(struct torture_context *torture)
{
struct libnet_context *ctx;

View File

@ -109,7 +109,7 @@ static void test_displayshares(struct libnet_ListShares s)
}
BOOL torture_listshares(void)
BOOL torture_listshares(struct torture_context *torture)
{
struct libnet_ListShares share;
NTSTATUS status;
@ -194,7 +194,7 @@ static BOOL test_addshare(struct dcerpc_pipe *pipe, TALLOC_CTX *mem_ctx, const c
}
BOOL torture_delshare(void)
BOOL torture_delshare(struct torture_context *torture)
{
struct dcerpc_pipe *p;
struct dcerpc_binding *bind;

View File

@ -23,6 +23,7 @@
#include "lib/cmdline/popt_common.h"
#include "libnet/libnet.h"
#include "librpc/gen_ndr/ndr_samr_c.h"
#include "torture/torture.h"
#define TEST_USERNAME "libnetusertest"
@ -93,7 +94,7 @@ static BOOL test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
BOOL torture_createuser(void)
BOOL torture_createuser(struct torture_context *torture)
{
NTSTATUS status;
const char *binding;

View File

@ -265,7 +265,7 @@ static BOOL test_userinfo_async(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
BOOL torture_userinfo(void)
BOOL torture_userinfo(struct torture_context *torture)
{
NTSTATUS status;
const char *binding;

View File

@ -298,7 +298,7 @@ static BOOL test_usermod(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
BOOL torture_useradd(void)
BOOL torture_useradd(struct torture_context *torture)
{
NTSTATUS status;
const char *binding;
@ -357,7 +357,7 @@ done:
}
BOOL torture_userdel(void)
BOOL torture_userdel(struct torture_context *torture)
{
NTSTATUS status;
const char *binding;
@ -401,7 +401,7 @@ done:
}
BOOL torture_usermod(void)
BOOL torture_usermod(struct torture_context *torture)
{
NTSTATUS status;
const char *binding;

View File

@ -23,6 +23,7 @@
#include "includes.h"
#include "librpc/gen_ndr/epmapper.h"
#include "librpc/rpc/dcerpc.h"
#include "torture/torture.h"
static BOOL test_BindingString(TALLOC_CTX *mem_ctx, const char *binding)
{
@ -116,7 +117,7 @@ static const char *test_strings[] = {
"ncacn_unix_stream:[/tmp/epmapper,sign]",
};
BOOL torture_local_binding_string(void)
BOOL torture_local_binding_string(struct torture_context *torture)
{
BOOL ret = True;
TALLOC_CTX *mem_ctx = talloc_init("test_BindingString");

View File

@ -312,7 +312,7 @@ static int test_codepoint(unsigned int codepoint)
return 1;
}
BOOL torture_local_iconv(void)
BOOL torture_local_iconv(struct torture_context *torture)
{
size_t size;
unsigned char inbuf[1000];
@ -382,7 +382,7 @@ BOOL torture_local_iconv(void)
#else
BOOL torture_local_iconv(void)
BOOL torture_local_iconv(struct torture_context *torture)
{
printf("No native iconv library - can't run iconv test\n");
return True;

View File

@ -21,8 +21,9 @@
*/
#include "includes.h"
#include "torture/torture.h"
BOOL torture_local_idtree(void)
BOOL torture_local_idtree(struct torture_context *torture)
{
struct idr_context *idr;
int i;

View File

@ -24,6 +24,7 @@
#include "lib/events/events.h"
#include "lib/messaging/irpc.h"
#include "librpc/gen_ndr/ndr_echo.h"
#include "torture/torture.h"
const uint32_t MSG_ID1 = 1, MSG_ID2 = 2;
@ -214,7 +215,7 @@ static BOOL test_speed(TALLOC_CTX *mem_ctx,
}
BOOL torture_local_irpc(void)
BOOL torture_local_irpc(struct torture_context *torture)
{
TALLOC_CTX *mem_ctx = talloc_init("torture_local_irpc");
BOOL ret = True;

View File

@ -23,6 +23,7 @@
#include "includes.h"
#include "lib/events/events.h"
#include "lib/messaging/irpc.h"
#include "torture/torture.h"
enum {MY_PING=1000, MY_PONG, MY_EXIT};
@ -144,7 +145,7 @@ static BOOL test_ping_speed(TALLOC_CTX *mem_ctx)
return ret;
}
BOOL torture_local_messaging(void)
BOOL torture_local_messaging(struct torture_context *torture)
{
TALLOC_CTX *mem_ctx = talloc_init("torture_local_messaging");
BOOL ret = True;

View File

@ -83,7 +83,7 @@ BOOL test_check_string_terminator(TALLOC_CTX *mem_ctx)
return True;
}
BOOL torture_local_ndr(void)
BOOL torture_local_ndr(struct torture_context *torture)
{
TALLOC_CTX *mem_ctx;
BOOL ret = True;

View File

@ -23,6 +23,7 @@
#include "includes.h"
#include "lib/registry/registry.h"
#include "lib/cmdline/popt_common.h"
#include "torture/torture.h"
static BOOL test_hive(TALLOC_CTX *mem_ctx, const char *backend, const char *location)
{
@ -80,7 +81,7 @@ static BOOL test_hive(TALLOC_CTX *mem_ctx, const char *backend, const char *loca
return True;
}
BOOL torture_registry(void)
BOOL torture_registry(struct torture_context *torture)
{
BOOL ret = True;
TALLOC_CTX *mem_ctx = talloc_init("torture_registry");

View File

@ -23,6 +23,7 @@
#include "includes.h"
#include "lib/events/events.h"
#include "libcli/resolve/resolve.h"
#include "torture/torture.h"
static BOOL test_async_resolve(TALLOC_CTX *mem_ctx)
{
@ -73,7 +74,7 @@ static BOOL test_sync_resolve(TALLOC_CTX *mem_ctx)
}
BOOL torture_local_resolve(void)
BOOL torture_local_resolve(struct torture_context *torture)
{
TALLOC_CTX *mem_ctx = talloc_init("torture_local_irpc");
BOOL ret = True;

View File

@ -23,6 +23,7 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "libcli/security/proto.h"
#include "torture/torture.h"
/*
@ -94,7 +95,7 @@ static const char *examples[] = {
};
/* test a set of example SDDL strings */
BOOL torture_local_sddl(void)
BOOL torture_local_sddl(struct torture_context *torture)
{
int i;
BOOL ret = True;

View File

@ -256,7 +256,7 @@ done:
return ret;
}
BOOL torture_local_socket(void)
BOOL torture_local_socket(struct torture_context *torture)
{
BOOL ret = True;
TALLOC_CTX *mem_ctx = talloc_new(NULL);

View File

@ -22,6 +22,7 @@
#include "includes.h"
#include "system/filesys.h"
#include "torture/torture.h"
#define TEST_FILENAME "utilfile.test"
#define TEST_LINE1 "This is list line 1..."
@ -87,7 +88,7 @@ static BOOL test_afdgets(TALLOC_CTX *mem_ctx)
return True;
}
BOOL torture_local_util_file(void)
BOOL torture_local_util_file(struct torture_context *torture)
{
BOOL ret = True;
TALLOC_CTX *mem_ctx = talloc_init("test_util_file");

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "torture/torture.h"
static const char *test_lists_shell_strings[] = {
"",
@ -69,7 +70,7 @@ static BOOL test_lists_shell(TALLOC_CTX *mem_ctx)
return True;
}
BOOL torture_local_util_strlist(void)
BOOL torture_local_util_strlist(struct torture_context *torture)
{
BOOL ret = True;
TALLOC_CTX *mem_ctx = talloc_init("test_util_strlist");

View File

@ -167,7 +167,7 @@ done:
/* run a test that simulates an approximate netbench client load */
BOOL torture_nbench(void)
BOOL torture_nbench(struct torture_context *torture)
{
BOOL correct = True;
extern int torture_nprocs;

View File

@ -23,11 +23,12 @@
#include "includes.h"
#include "librpc/gen_ndr/nbt.h"
#include "libcli/resolve/resolve.h"
#include "torture/torture.h"
/*
test nbt dgram operations
*/
BOOL torture_nbt_browse(void)
BOOL torture_nbt_browse(struct torture_context *torture)
{
const char *address;
struct nbt_name name;

View File

@ -348,7 +348,7 @@ failed:
/*
test nbt dgram operations
*/
BOOL torture_nbt_dgram(void)
BOOL torture_nbt_dgram(struct torture_context *torture)
{
const char *address;
struct nbt_name name;

View File

@ -23,6 +23,7 @@
#include "includes.h"
#include "lib/events/events.h"
#include "libcli/resolve/resolve.h"
#include "torture/torture.h"
struct result_struct {
int num_pass;
@ -101,7 +102,7 @@ failed:
/*
benchmark how fast a server can respond to name queries
*/
BOOL torture_bench_nbt(void)
BOOL torture_bench_nbt(struct torture_context *torture)
{
const char *address;
struct nbt_name name;

View File

@ -25,6 +25,7 @@
#include "libcli/resolve/resolve.h"
#include "system/network.h"
#include "netif/netif.h"
#include "torture/torture.h"
#define CHECK_VALUE(v, correct) do { \
if ((v) != (correct)) { \
@ -175,7 +176,7 @@ static BOOL nbt_refresh_own(TALLOC_CTX *mem_ctx, struct nbt_name *name,
/*
test name registration to a server
*/
BOOL torture_nbt_register(void)
BOOL torture_nbt_register(struct torture_context *torture)
{
const char *address;
struct nbt_name name;

View File

@ -26,6 +26,7 @@
#include "system/network.h"
#include "netif/netif.h"
#include "librpc/gen_ndr/ndr_nbt.h"
#include "torture/torture.h"
#define CHECK_VALUE(v, correct) do { \
if ((v) != (correct)) { \
@ -368,7 +369,7 @@ static BOOL nbt_test_wins(TALLOC_CTX *mem_ctx, const char *address)
/*
test WINS operations
*/
BOOL torture_nbt_wins(void)
BOOL torture_nbt_wins(struct torture_context *torture)
{
const char *address;
struct nbt_name name;

View File

@ -26,6 +26,7 @@
#include "libcli/resolve/resolve.h"
#include "system/network.h"
#include "netif/netif.h"
#include "torture/torture.h"
struct wins_state {
int num_names;
@ -273,7 +274,7 @@ static BOOL bench_wins(TALLOC_CTX *mem_ctx, struct nbt_name *name, const char *a
benchmark how fast a WINS server can respond to a mixture of
registration/refresh/release and name query requests
*/
BOOL torture_bench_wins(void)
BOOL torture_bench_wins(struct torture_context *torture)
{
const char *address;
struct nbt_name name;

View File

@ -29,6 +29,7 @@
#include "system/network.h"
#include "netif/netif.h"
#include "librpc/gen_ndr/ndr_nbt.h"
#include "torture/torture.h"
#define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \
@ -9625,7 +9626,7 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket
/*
test simple WINS replication operations
*/
BOOL torture_nbt_winsreplication_simple(void)
BOOL torture_nbt_winsreplication_simple(struct torture_context *torture)
{
const char *address;
struct nbt_name name;
@ -9657,7 +9658,7 @@ BOOL torture_nbt_winsreplication_simple(void)
/*
test WINS replication replica conflicts operations
*/
BOOL torture_nbt_winsreplication_replica(void)
BOOL torture_nbt_winsreplication_replica(struct torture_context *torture)
{
const char *address;
struct nbt_name name;
@ -9691,7 +9692,7 @@ BOOL torture_nbt_winsreplication_replica(void)
/*
test WINS replication owned conflicts operations
*/
BOOL torture_nbt_winsreplication_owned(void)
BOOL torture_nbt_winsreplication_owned(struct torture_context *torture)
{
const char *address;
struct nbt_name name;

View File

@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/libcli.h"
#include "torture/torture.h"
#include "torture/util.h"
#include "libcli/rap/rap.h"
#include "libcli/raw/libcliraw.h"
@ -427,7 +428,7 @@ static BOOL test_rap(struct smbcli_state *cli)
return res;
}
BOOL torture_raw_rap(void)
BOOL torture_raw_rap(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;
@ -449,7 +450,7 @@ BOOL torture_raw_rap(void)
return ret;
}
BOOL torture_rap_scan(void)
BOOL torture_rap_scan(struct torture_context *torture)
{
TALLOC_CTX *mem_ctx;
struct smbcli_state *cli;

View File

@ -1427,7 +1427,7 @@ done:
/*
basic testing of security descriptor calls
*/
BOOL torture_raw_acls(void)
BOOL torture_raw_acls(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -214,7 +214,7 @@ done:
/*
basic testing of chkpath calls
*/
BOOL torture_raw_chkpath(void)
BOOL torture_raw_chkpath(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -28,7 +28,7 @@
/* basic testing of all RAW_CLOSE_* calls
*/
BOOL torture_raw_close(void)
BOOL torture_raw_close(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -393,7 +393,7 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
/*
basic testing of libcli composite calls
*/
BOOL torture_raw_composite(void)
BOOL torture_raw_composite(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -747,7 +747,7 @@ static BOOL torture_raw_context_int(void)
/*
basic testing of session/tree context calls
*/
BOOL torture_raw_context(void)
BOOL torture_raw_context(struct torture_context *torture)
{
BOOL ret = True;
if (lp_use_spnego()) {

View File

@ -445,7 +445,7 @@ done:
/*
basic testing of EA calls
*/
BOOL torture_raw_eas(void)
BOOL torture_raw_eas(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;
@ -474,7 +474,7 @@ BOOL torture_raw_eas(void)
/*
test max EA size
*/
BOOL torture_max_eas(void)
BOOL torture_max_eas(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -148,7 +148,7 @@ done:
/*
basic testing of some ioctl calls
*/
BOOL torture_raw_ioctl(void)
BOOL torture_raw_ioctl(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -662,7 +662,7 @@ done:
/*
basic testing of lock calls
*/
BOOL torture_raw_lock(void)
BOOL torture_raw_lock(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -145,7 +145,7 @@ done:
/*
basic testing of all RAW_MKDIR_* calls
*/
BOOL torture_raw_mkdir(void)
BOOL torture_raw_mkdir(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -307,7 +307,7 @@ done:
/*
basic testing of multiplexing notify
*/
BOOL torture_raw_mux(void)
BOOL torture_raw_mux(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -492,7 +492,7 @@ done:
/*
basic testing of change notify
*/
BOOL torture_raw_notify(void)
BOOL torture_raw_notify(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -1393,7 +1393,7 @@ static BOOL test_raw_open_multi(void)
/* basic testing of all RAW_OPEN_* calls
*/
BOOL torture_raw_open(void)
BOOL torture_raw_open(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -476,7 +476,7 @@ done:
/*
basic testing of oplocks
*/
BOOL torture_raw_oplock(void)
BOOL torture_raw_oplock(struct torture_context *torture)
{
struct smbcli_state *cli1;
BOOL ret = True;

View File

@ -151,7 +151,7 @@ static union smb_fileinfo *fname_find(const char *name)
for each call we test that it succeeds, and where possible test
for consistency between the calls.
*/
BOOL torture_raw_qfileinfo(void)
BOOL torture_raw_qfileinfo(struct torture_context *torture)
{
struct smbcli_state *cli;
int i;

View File

@ -121,7 +121,7 @@ static union smb_fsinfo *find(const char *name)
Some of the consistency tests assume that the target filesystem is
quiescent, which is sometimes hard to achieve
*/
BOOL torture_raw_qfsinfo(void)
BOOL torture_raw_qfsinfo(struct torture_context *torture)
{
struct smbcli_state *cli;
int i;

View File

@ -714,7 +714,7 @@ done:
/*
basic testing of read calls
*/
BOOL torture_raw_read(void)
BOOL torture_raw_read(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -419,7 +419,7 @@ done:
/*
basic testing of rename calls
*/
BOOL torture_raw_rename(void)
BOOL torture_raw_rename(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -1310,7 +1310,7 @@ done:
/*
basic testing of all RAW_SEARCH_* calls using a single file
*/
BOOL torture_raw_search(void)
BOOL torture_raw_search(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -234,7 +234,7 @@ done:
/*
basic testing of seek calls
*/
BOOL torture_raw_seek(void)
BOOL torture_raw_seek(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -31,7 +31,7 @@
for each call we test that it succeeds, and where possible test
for consistency between the calls.
*/
BOOL torture_raw_sfileinfo(void)
BOOL torture_raw_sfileinfo(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;
@ -533,7 +533,7 @@ done:
/*
look for the w2k3 setpathinfo STANDARD bug
*/
BOOL torture_raw_sfileinfo_bug(void)
BOOL torture_raw_sfileinfo_bug(struct torture_context *torture)
{
struct smbcli_state *cli;
TALLOC_CTX *mem_ctx;

View File

@ -214,7 +214,7 @@ done:
/*
basic testing of streams calls
*/
BOOL torture_raw_streams(void)
BOOL torture_raw_streams(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -401,7 +401,7 @@ done:
/*
basic testing of unlink calls
*/
BOOL torture_raw_unlink(void)
BOOL torture_raw_unlink(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -676,7 +676,7 @@ done:
/*
basic testing of write calls
*/
BOOL torture_raw_write(void)
BOOL torture_raw_write(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;

View File

@ -27,7 +27,7 @@
#include "librpc/rpc/dcerpc.h"
#include "torture/rpc/rpc.h"
BOOL torture_rpc_alter_context(void)
BOOL torture_rpc_alter_context(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p, *p2;

View File

@ -135,7 +135,7 @@ static BOOL test_JobAdd(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
return True;
}
BOOL torture_rpc_atsvc(void)
BOOL torture_rpc_atsvc(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;

View File

@ -260,7 +260,7 @@ static void test_auto_scan(TALLOC_CTX *mem_ctx, const struct dcerpc_interface_ta
test_scan_call(mem_ctx, iface, 2);
}
BOOL torture_rpc_autoidl(void)
BOOL torture_rpc_autoidl(struct torture_context *torture)
{
TALLOC_CTX *mem_ctx;
const struct dcerpc_interface_table *iface;

View File

@ -93,7 +93,7 @@ static BOOL bench_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
}
BOOL torture_bench_rpc(void)
BOOL torture_bench_rpc(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;

View File

@ -38,7 +38,7 @@
*/
BOOL torture_multi_bind(void)
BOOL torture_multi_bind(struct torture_context *torture)
{
struct dcerpc_pipe *p;
struct dcerpc_binding *binding;

View File

@ -27,7 +27,7 @@
#include "torture/rpc/rpc.h"
BOOL torture_rpc_countcalls(void)
BOOL torture_rpc_countcalls(struct torture_context *torture)
{
const struct dcerpc_interface_table *iface;
NTSTATUS status;

View File

@ -166,7 +166,7 @@ static BOOL test_Add(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
}
#endif
BOOL torture_rpc_dfs(void)
BOOL torture_rpc_dfs(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;

View File

@ -623,7 +623,7 @@ BOOL test_DsUnbind(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return ret;
}
BOOL torture_rpc_drsuapi(void)
BOOL torture_rpc_drsuapi(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;

View File

@ -773,7 +773,7 @@ BOOL test_DsCrackNames(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return ret;
}
BOOL torture_rpc_drsuapi_cracknames(void)
BOOL torture_rpc_drsuapi_cracknames(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;

View File

@ -57,7 +57,7 @@ BOOL test_DsRoleGetPrimaryDomainInformation(struct dcerpc_pipe *p, TALLOC_CTX *m
return ret;
}
BOOL torture_rpc_dssetup(void)
BOOL torture_rpc_dssetup(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;

View File

@ -26,6 +26,7 @@
#include "librpc/gen_ndr/ndr_drsuapi_c.h"
#include "libcli/cldap/cldap.h"
#include "libcli/ldap/ldap_client.h"
#include "torture/torture.h"
#include "torture/ldap/proto.h"
struct DsSyncBindInfo {
@ -547,7 +548,7 @@ static BOOL test_FetchData(struct DsSyncTest *ctx)
return ret;
}
BOOL torture_rpc_dssync(void)
BOOL torture_rpc_dssync(struct torture_context *torture)
{
BOOL ret = True;
TALLOC_CTX *mem_ctx;

View File

@ -482,7 +482,7 @@ failed:
}
BOOL torture_rpc_echo(void)
BOOL torture_rpc_echo(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;

View File

@ -272,7 +272,7 @@ static BOOL test_InqObject(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
return True;
}
BOOL torture_rpc_epmapper(void)
BOOL torture_rpc_epmapper(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;

View File

@ -222,7 +222,7 @@ static BOOL test_OpenEventLog(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return True;
}
BOOL torture_rpc_eventlog(void)
BOOL torture_rpc_eventlog(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;

View File

@ -113,7 +113,7 @@ static BOOL test_Abort(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
return True;
}
BOOL torture_rpc_initshutdown(void)
BOOL torture_rpc_initshutdown(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;

View File

@ -7,7 +7,7 @@
#define TORTURE_NETBIOS_NAME "smbtorturejoin"
BOOL torture_rpc_join(void)
BOOL torture_rpc_join(struct torture_context *torture)
{
struct test_join *tj;
struct cli_credentials *machine_account;

View File

@ -1812,7 +1812,7 @@ BOOL test_lsa_Close(struct dcerpc_pipe *p,
return True;
}
BOOL torture_rpc_lsa(void)
BOOL torture_rpc_lsa(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;

View File

@ -219,7 +219,7 @@ static BOOL get_downleveltrust(TALLOC_CTX *mem_ctx, struct dcerpc_pipe *p,
#define NUM_SIDS 8
BOOL torture_rpc_lsa_lookup(void)
BOOL torture_rpc_lsa_lookup(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;

View File

@ -174,7 +174,7 @@ static BOOL test_stop_server_listening(struct dcerpc_pipe *p,
}
BOOL torture_rpc_mgmt(void)
BOOL torture_rpc_mgmt(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;

View File

@ -1501,7 +1501,7 @@ static BOOL test_ManyGetDCName(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
}
BOOL torture_rpc_netlogon(void)
BOOL torture_rpc_netlogon(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;

View File

@ -215,7 +215,7 @@ static int test_ServerAlive2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
return 1;
}
BOOL torture_rpc_oxidresolve(void)
BOOL torture_rpc_oxidresolve(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p, *premact;

View File

@ -96,7 +96,7 @@ static int test_RemoteActivation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
return 1;
}
BOOL torture_rpc_remact(void)
BOOL torture_rpc_remact(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;

View File

@ -24,7 +24,7 @@
#include "librpc/gen_ndr/ndr_rot.h"
#include "torture/rpc/rpc.h"
BOOL torture_rpc_rot(void)
BOOL torture_rpc_rot(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;

View File

@ -22,6 +22,7 @@
#ifndef __TORTURE_RPC_H__
#define __TORTURE_RPC_H__
#include "torture/torture.h"
#include "auth/credentials/credentials.h"
#include "torture/rpc/drsuapi.h"
#include "libnet/libnet_join.h"

View File

@ -1469,7 +1469,7 @@ BOOL test_InteractiveLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
BOOL torture_rpc_samlogon(void)
BOOL torture_rpc_samlogon(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;

View File

@ -3367,7 +3367,7 @@ static BOOL test_Connect(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
BOOL torture_rpc_samr(void)
BOOL torture_rpc_samr(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;

Some files were not shown because too many files have changed in this diff Show More