summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/torture/torture.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 1aea6145b8..48b7aa60c0 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -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}};