1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

add SESSSETUP_BENCH

This commit is contained in:
Volker Lendecke 2007-12-04 11:38:57 +01:00
parent 905943137c
commit 3b057022a5

View File

@ -4780,6 +4780,46 @@ static bool run_error_map_extract(int dummy) {
return True;
}
static bool run_sesssetup_bench(int dummy)
{
static struct cli_state *c;
NTSTATUS status;
int i;
if (!(c = open_nbt_connection())) {
return false;
}
if (!cli_negprot(c)) {
printf("%s rejected the NT-error negprot (%s)\n", host,
cli_errstr(c));
cli_shutdown(c);
return false;
}
for (i=0; i<torture_numops; i++) {
status = cli_session_setup(
c, username,
password, strlen(password),
password, strlen(password),
workgroup);
if (!NT_STATUS_IS_OK(status)) {
d_printf("(%s) cli_session_setup failed: %s\n",
__location__, nt_errstr(status));
return false;
}
if (!cli_ulogoff(c)) {
d_printf("(%s) cli_ulogoff failed: %s\n",
__location__, cli_errstr(c));
return false;
}
c->vuid = 0;
}
return true;
}
static bool subst_test(const char *str, const char *user, const char *domain,
uid_t uid, gid_t gid, const char *expected)
{
@ -5070,6 +5110,7 @@ static struct {
{"CHKPATH", torture_chkpath_test, 0},
{"FDSESS", run_fdsesstest, 0},
{ "EATEST", run_eatest, 0},
{ "SESSSETUP_BENCH", run_sesssetup_bench, 0},
{ "LOCAL-SUBSTITUTE", run_local_substitute, 0},
{ "LOCAL-GENCACHE", run_local_gencache, 0},
{NULL, NULL, 0}};