#define BOOL int
#endif
+struct torture_context;
+
static struct timeval timeval_current(void)
{
struct timeval tv;
}
-BOOL torture_local_talloc(void)
+BOOL torture_local_talloc(struct torture_context *torture)
{
BOOL ret = True;
#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;
#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;
#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)
{
return True;
}
-BOOL torture_pac(void)
+BOOL torture_pac(struct torture_context *torture)
{
BOOL ret = True;
ret &= torture_pac_self_check();
/* 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;
};
-BOOL torture_openattrtest(void)
+BOOL torture_openattrtest(struct torture_context *torture)
{
struct smbcli_state *cli1;
const char *fname = "\\openattr.file";
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";
/**
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;
/**
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;
}
/* 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;
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";
/**
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;
#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;
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";
/*
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;
/**
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";
/**
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;
return True;
}
-BOOL torture_charset(void)
+BOOL torture_charset(struct torture_context *torture)
{
static struct smbcli_state *cli;
BOOL ret = True;
/*
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;
/*
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;
/*
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;
/*
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;
/*
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;
/*
a denytest for ntcreatex
*/
-BOOL torture_ntdenytest2(void)
+BOOL torture_ntdenytest2(struct torture_context *torture)
{
struct smbcli_state *cli1, *cli2;
BOOL ret;
/*
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;
/*
test directory listing speed
*/
-BOOL torture_dirtest1(void)
+BOOL torture_dirtest1(struct torture_context *torture)
{
int i;
struct smbcli_state *cli;
return correct;
}
-BOOL torture_dirtest2(void)
+BOOL torture_dirtest2(struct torture_context *torture)
{
int i;
struct smbcli_state *cli;
/*
basic testing of disconnects
*/
-BOOL torture_disconnect(void)
+BOOL torture_disconnect(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;
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";
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";
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";
/*
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";
/*
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";
/*
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" };
return True;
}
-BOOL torture_locktest7(void)
+BOOL torture_locktest7(struct torture_context *torture)
{
struct smbcli_state *cli1;
const char *fname = BASEDIR "\\lockt7.lck";
}
-BOOL torture_mangle(void)
+BOOL torture_mangle(struct torture_context *torture)
{
extern int torture_numops;
static struct smbcli_state *cli;
/*
print out server properties
*/
-BOOL torture_test_properties(void)
+BOOL torture_test_properties(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL correct = True;
/*
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";
}
-BOOL torture_trans2_scan(void)
+BOOL torture_trans2_scan(struct torture_context *torture)
{
static struct smbcli_state *cli;
int op, level;
}
-BOOL torture_nttrans_scan(void)
+BOOL torture_nttrans_scan(struct torture_context *torture)
{
static struct smbcli_state *cli;
int op, level;
/* 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;
return True;
}
-BOOL torture_sec_leak(void)
+BOOL torture_sec_leak(struct torture_context *torture)
{
struct smbcli_state *cli;
time_t t1 = time(NULL);
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";
#include "torture/util.h"
#include "pstring.h"
-BOOL torture_utable(void)
+BOOL torture_utable(struct torture_context *torture)
{
struct smbcli_state *cli;
fstring fname;
return fname;
}
-BOOL torture_casetable(void)
+BOOL torture_casetable(struct torture_context *torture)
{
static struct smbcli_state *cli;
char *fname;
#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)
}
-BOOL torture_ldap_basic(void)
+BOOL torture_ldap_basic(struct torture_context *torture)
{
NTSTATUS status;
struct ldap_connection *conn;
#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)) { \
return ret;
}
-BOOL torture_cldap(void)
+BOOL torture_cldap(struct torture_context *torture)
{
TALLOC_CTX *mem_ctx;
BOOL ret = True;
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;
}
-BOOL torture_domainopen(void)
+BOOL torture_domainopen(struct torture_context *torture)
{
NTSTATUS status;
const char *binding;
#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;
}
-BOOL torture_lookup_host(void)
+BOOL torture_lookup_host(struct torture_context *torture)
{
BOOL ret;
NTSTATUS status;
}
-BOOL torture_lookup_pdc(void)
+BOOL torture_lookup_pdc(struct torture_context *torture)
{
BOOL ret;
NTSTATUS status;
#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)
return True;
}
-BOOL torture_rpc_connect(void)
+BOOL torture_rpc_connect(struct torture_context *torture)
{
struct libnet_context *ctx;
}
-BOOL torture_listshares(void)
+BOOL torture_listshares(struct torture_context *torture)
{
struct libnet_ListShares share;
NTSTATUS status;
}
-BOOL torture_delshare(void)
+BOOL torture_delshare(struct torture_context *torture)
{
struct dcerpc_pipe *p;
struct dcerpc_binding *bind;
#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"
}
-BOOL torture_createuser(void)
+BOOL torture_createuser(struct torture_context *torture)
{
NTSTATUS status;
const char *binding;
}
-BOOL torture_userinfo(void)
+BOOL torture_userinfo(struct torture_context *torture)
{
NTSTATUS status;
const char *binding;
}
-BOOL torture_useradd(void)
+BOOL torture_useradd(struct torture_context *torture)
{
NTSTATUS status;
const char *binding;
}
-BOOL torture_userdel(void)
+BOOL torture_userdel(struct torture_context *torture)
{
NTSTATUS status;
const char *binding;
}
-BOOL torture_usermod(void)
+BOOL torture_usermod(struct torture_context *torture)
{
NTSTATUS status;
const char *binding;
#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)
{
"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");
return 1;
}
-BOOL torture_local_iconv(void)
+BOOL torture_local_iconv(struct torture_context *torture)
{
size_t size;
unsigned char inbuf[1000];
#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;
*/
#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;
#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;
}
-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;
#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};
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;
return True;
}
-BOOL torture_local_ndr(void)
+BOOL torture_local_ndr(struct torture_context *torture)
{
TALLOC_CTX *mem_ctx;
BOOL ret = True;
#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)
{
return True;
}
-BOOL torture_registry(void)
+BOOL torture_registry(struct torture_context *torture)
{
BOOL ret = True;
TALLOC_CTX *mem_ctx = talloc_init("torture_registry");
#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)
{
}
-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;
#include "includes.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "libcli/security/proto.h"
+#include "torture/torture.h"
/*
};
/* 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;
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);
#include "includes.h"
#include "system/filesys.h"
+#include "torture/torture.h"
#define TEST_FILENAME "utilfile.test"
#define TEST_LINE1 "This is list line 1..."
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");
*/
#include "includes.h"
+#include "torture/torture.h"
static const char *test_lists_shell_strings[] = {
"",
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");
/* 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;
#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;
/*
test nbt dgram operations
*/
-BOOL torture_nbt_dgram(void)
+BOOL torture_nbt_dgram(struct torture_context *torture)
{
const char *address;
struct nbt_name name;
#include "includes.h"
#include "lib/events/events.h"
#include "libcli/resolve/resolve.h"
+#include "torture/torture.h"
struct result_struct {
int num_pass;
/*
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;
#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)) { \
/*
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;
#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)) { \
/*
test WINS operations
*/
-BOOL torture_nbt_wins(void)
+BOOL torture_nbt_wins(struct torture_context *torture)
{
const char *address;
struct nbt_name name;
#include "libcli/resolve/resolve.h"
#include "system/network.h"
#include "netif/netif.h"
+#include "torture/torture.h"
struct wins_state {
int num_names;
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;
#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)) { \
/*
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;
/*
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;
/*
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;
#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"
return res;
}
-BOOL torture_raw_rap(void)
+BOOL torture_raw_rap(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;
return ret;
}
-BOOL torture_rap_scan(void)
+BOOL torture_rap_scan(struct torture_context *torture)
{
TALLOC_CTX *mem_ctx;
struct smbcli_state *cli;
/*
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;
/*
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;
/* 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;
/*
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;
/*
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()) {
/*
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;
/*
test max EA size
*/
-BOOL torture_max_eas(void)
+BOOL torture_max_eas(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;
/*
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;
/*
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;
/*
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;
/*
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;
/*
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;
/* 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;
/*
basic testing of oplocks
*/
-BOOL torture_raw_oplock(void)
+BOOL torture_raw_oplock(struct torture_context *torture)
{
struct smbcli_state *cli1;
BOOL ret = True;
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;
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;
/*
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;
/*
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;
/*
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;
/*
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;
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;
/*
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;
/*
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;
/*
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;
/*
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;
#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;
return True;
}
-BOOL torture_rpc_atsvc(void)
+BOOL torture_rpc_atsvc(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
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;
}
-BOOL torture_bench_rpc(void)
+BOOL torture_bench_rpc(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
*/
-BOOL torture_multi_bind(void)
+BOOL torture_multi_bind(struct torture_context *torture)
{
struct dcerpc_pipe *p;
struct dcerpc_binding *binding;
#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;
}
#endif
-BOOL torture_rpc_dfs(void)
+BOOL torture_rpc_dfs(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
return ret;
}
-BOOL torture_rpc_drsuapi(void)
+BOOL torture_rpc_drsuapi(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
return ret;
}
-BOOL torture_rpc_drsuapi_cracknames(void)
+BOOL torture_rpc_drsuapi_cracknames(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
return ret;
}
-BOOL torture_rpc_dssetup(void)
+BOOL torture_rpc_dssetup(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
#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 {
return ret;
}
-BOOL torture_rpc_dssync(void)
+BOOL torture_rpc_dssync(struct torture_context *torture)
{
BOOL ret = True;
TALLOC_CTX *mem_ctx;
}
-BOOL torture_rpc_echo(void)
+BOOL torture_rpc_echo(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
return True;
}
-BOOL torture_rpc_epmapper(void)
+BOOL torture_rpc_epmapper(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
return True;
}
-BOOL torture_rpc_eventlog(void)
+BOOL torture_rpc_eventlog(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
return True;
}
-BOOL torture_rpc_initshutdown(void)
+BOOL torture_rpc_initshutdown(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
#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;
return True;
}
-BOOL torture_rpc_lsa(void)
+BOOL torture_rpc_lsa(struct torture_context *torture)
{
NTSTATUS status;
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;
}
-BOOL torture_rpc_mgmt(void)
+BOOL torture_rpc_mgmt(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
}
-BOOL torture_rpc_netlogon(void)
+BOOL torture_rpc_netlogon(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
return 1;
}
-BOOL torture_rpc_oxidresolve(void)
+BOOL torture_rpc_oxidresolve(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p, *premact;
return 1;
}
-BOOL torture_rpc_remact(void)
+BOOL torture_rpc_remact(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
#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;
#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"
-BOOL torture_rpc_samlogon(void)
+BOOL torture_rpc_samlogon(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
}
-BOOL torture_rpc_samr(void)
+BOOL torture_rpc_samr(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
-BOOL torture_rpc_samsync(void)
+BOOL torture_rpc_samsync(struct torture_context *torture)
{
NTSTATUS status;
TALLOC_CTX *mem_ctx;
}
-BOOL torture_rpc_scanner(void)
+BOOL torture_rpc_scanner(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
/*
a schannel test suite
*/
-BOOL torture_rpc_schannel(void)
+BOOL torture_rpc_schannel(struct torture_context *torture)
{
TALLOC_CTX *mem_ctx;
BOOL ret = True;
/* TEST session key correctness by pushing and pulling secrets */
-BOOL torture_rpc_lsa_secrets(void)
+BOOL torture_rpc_lsa_secrets(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
return ret;
}
-BOOL torture_rpc_spoolss(void)
+BOOL torture_rpc_spoolss(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
return ret;
}
-BOOL torture_rpc_srvsvc(void)
+BOOL torture_rpc_srvsvc(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
return True;
}
-BOOL torture_rpc_svcctl(void)
+BOOL torture_rpc_svcctl(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
return NT_STATUS_IS_OK(result);
}
-BOOL torture_rpc_unixinfo(void)
+BOOL torture_rpc_unixinfo(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
return ret;
}
-BOOL torture_rpc_winreg(void)
+BOOL torture_rpc_winreg(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
-BOOL torture_rpc_wkssvc(void)
+BOOL torture_rpc_wkssvc(struct torture_context *torture)
{
NTSTATUS status;
struct dcerpc_pipe *p;
#include "librpc/gen_ndr/security.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
+#include "torture/torture.h"
#include "torture/smb2/proto.h"
/*
/*
basic testing of SMB2 connection calls
*/
-BOOL torture_smb2_connect(void)
+BOOL torture_smb2_connect(struct torture_context *torture)
{
TALLOC_CTX *mem_ctx = talloc_new(NULL);
struct smb2_tree *tree;
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
+#include "torture/torture.h"
#include "torture/smb2/proto.h"
static struct {
/* basic testing of all SMB2 find levels
*/
-BOOL torture_smb2_find(void)
+BOOL torture_smb2_find(struct torture_context *torture)
{
TALLOC_CTX *mem_ctx = talloc_new(NULL);
struct smb2_tree *tree;
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
+#include "torture/torture.h"
#include "torture/smb2/proto.h"
static struct {
/* basic testing of all SMB2 getinfo levels
*/
-BOOL torture_smb2_getinfo(void)
+BOOL torture_smb2_getinfo(struct torture_context *torture)
{
TALLOC_CTX *mem_ctx = talloc_new(NULL);
struct smb2_tree *tree;
#include "libcli/smb2/smb2_calls.h"
#include "lib/cmdline/popt_common.h"
#include "lib/events/events.h"
+#include "torture/torture.h"
#include "torture/smb2/proto.h"
/*
scan for valid SMB2 getinfo levels
*/
-BOOL torture_smb2_getinfo_scan(void)
+BOOL torture_smb2_getinfo_scan(struct torture_context *torture)
{
TALLOC_CTX *mem_ctx = talloc_new(NULL);
struct smb2_tree *tree;
/*
scan for valid SMB2 setinfo levels
*/
-BOOL torture_smb2_setinfo_scan(void)
+BOOL torture_smb2_setinfo_scan(struct torture_context *torture)
{
TALLOC_CTX *mem_ctx = talloc_new(NULL);
struct smb2_tree *tree;
/*
scan for valid SMB2 scan levels
*/
-BOOL torture_smb2_find_scan(void)
+BOOL torture_smb2_find_scan(struct torture_context *torture)
{
TALLOC_CTX *mem_ctx = talloc_new(NULL);
struct smb2_tree *tree;
/*
scan for valid SMB2 opcodes
*/
-BOOL torture_smb2_scan(void)
+BOOL torture_smb2_scan(struct torture_context *torture)
{
TALLOC_CTX *mem_ctx = talloc_new(NULL);
struct smb2_tree *tree;
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
+#include "torture/torture.h"
#include "torture/smb2/proto.h"
#define BASEDIR ""
for each call we test that it succeeds, and where possible test
for consistency between the calls.
*/
-BOOL torture_smb2_setinfo(void)
+BOOL torture_smb2_setinfo(struct torture_context *torture)
{
struct smb2_tree *tree;
BOOL ret = True;
} else {
struct timeval tv = timeval_current();
- if (!o->fn()) {
+ if (!o->fn(NULL)) {
ret = False;
printf("TEST %s FAILED!\n", o->name);
}
#include "auth/credentials/credentials.h"
#include "libcli/ldap/ldap_client.h"
#include "librpc/gen_ndr/ndr_nbt.h"
+#include "torture/torture.h"
#include "torture/raw/proto.h"
#include "libcli/smb2/smb2.h"
#include "torture/com/proto.h"
#include "torture/nbt/proto.h"
#include "torture/libnet/proto.h"
-#include "torture/torture.h"
#include "torture/util.h"
#include "build.h"
#include "dlinklist.h"
static BOOL run_torture(struct smbcli_state *cli, int dummy)
{
- BOOL ret;
+ BOOL ret;
ret = rw_torture(cli);
/*
see how many RPC pipes we can open at once
*/
-static BOOL run_pipe_number(void)
+static BOOL run_pipe_number(struct torture_context *torture)
{
struct smbcli_state *cli1;
const char *pipe_name = "\\WKSSVC";
used for testing performance when there are N idle users
already connected
*/
- static BOOL torture_holdcon(void)
+ static BOOL torture_holdcon(struct torture_context *torture)
{
int i;
struct smbcli_state **cli;
/*
sees what IOCTLs are supported
*/
-static BOOL torture_ioctl_test(void)
+static BOOL torture_ioctl_test(struct torture_context *torture)
{
struct smbcli_state *cli;
uint16_t device, function;
static struct {
const char *name;
- BOOL (*fn)(void);
+ BOOL (*fn)(struct torture_context *);
BOOL (*multi_fn)(struct smbcli_state *, int );
} builtin_torture_ops[] = {
/* benchmarking tests */
struct torture_op *torture_ops = NULL;
-_PUBLIC_ NTSTATUS register_torture_op(const char *name, BOOL (*fn)(void), BOOL (*multi_fn)(struct smbcli_state *, int ))
+_PUBLIC_ NTSTATUS register_torture_op(const char *name, BOOL (*fn)(struct torture_context *), BOOL (*multi_fn)(struct smbcli_state *, int ))
{
struct torture_op *op, *p;
#define __TORTURE_H__
struct smbcli_state;
+struct torture_context;
struct torture_op {
const char *name;
- BOOL (*fn)(void);
+ BOOL (*fn)(struct torture_context *);
BOOL (*multi_fn)(struct smbcli_state *, int );
struct torture_op *prev, *next;
};
extern int torture_failures;
extern BOOL use_level_II_oplocks;
-struct torture_context;
struct torture_test;
#include "torture/proto.h"
return NULL;
}
-void torture_comment(struct torture_test *test, const char *comment, ...)
+void torture_comment(struct torture_test *test, const char *comment, ...) _PRINTF_ATTRIBUTE(2,3)
{
va_list ap;
char *tmp;