summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@sernet.de>2007-12-04 11:38:57 +0100
committerVolker Lendecke <vl@sernet.de>2007-12-05 10:15:54 +0100
commit113cb765aad93e00ba495f50c50ccf425be44cd9 (patch)
tree0119e38f8c88c086bf2301525d1851f6bd3e1689
parent786e73e99d2439c6a04ce63474f6c5c9e1b10a91 (diff)
downloadsamba-113cb765aad93e00ba495f50c50ccf425be44cd9.tar.gz
samba-113cb765aad93e00ba495f50c50ccf425be44cd9.tar.bz2
samba-113cb765aad93e00ba495f50c50ccf425be44cd9.zip
add SESSSETUP_BENCH
(This used to be commit 3b057022a570a1fb68e03c477a6989e7d1e7cef2)
-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}};