From 1fd59e3d6112b295f292a4586cc16363c3d4514b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 1 May 2005 10:18:19 +0000 Subject: r6556: added BENCH-RPC test, useful for simple rpc load testing (This used to be commit d1e0b7a2e3078c9cc1baff2fd17222ebae94ada7) --- source4/torture/rpc/bench.c | 120 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 source4/torture/rpc/bench.c (limited to 'source4/torture/rpc/bench.c') diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c new file mode 100644 index 0000000000..a2d0ba1dcf --- /dev/null +++ b/source4/torture/rpc/bench.c @@ -0,0 +1,120 @@ +/* + Unix SMB/CIFS implementation. + + simple RPC benchmark + + Copyright (C) Andrew Tridgell 2005 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_srvsvc.h" + +/**************************/ +/* srvsvc_NetShare */ +/**************************/ +static BOOL test_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +{ + NTSTATUS status; + struct srvsvc_NetShareEnumAll r; + struct srvsvc_NetShareCtr0 c0; + uint32_t levels[] = {0, 1, 2, 501, 502}; + int i; + BOOL ret = True; + uint32_t resume_handle; + + ZERO_STRUCT(c0); + + r.in.server_unc = talloc_asprintf(mem_ctx,"\\\\%s",dcerpc_server_name(p)); + r.in.ctr.ctr0 = &c0; + r.in.max_buffer = (uint32_t)-1; + r.in.resume_handle = &resume_handle; + r.out.resume_handle = &resume_handle; + + for (i=0;i Date: Tue, 27 Dec 2005 14:28:01 +0000 Subject: r12510: Change the DCE/RPC interfaces to take a pointer to a dcerpc_interface_table struct rather then a tuple of interface name, UUID and version. This removes the requirement for having a global list of DCE/RPC interfaces, except for these parts of the code that use that list explicitly (ndrdump and the scanner torture test). This should also allow us to remove the hack that put the authservice parameter in the dcerpc_binding struct as it can now be read directly from dcerpc_interface_table. I will now modify some of these functions to take a dcerpc_syntax_id structure rather then a full dcerpc_interface_table. (This used to be commit 8aae0f168e54c01d0866ad6e0da141dbd828574f) --- source4/torture/rpc/bench.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source4/torture/rpc/bench.c') diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c index a2d0ba1dcf..21afc560a0 100644 --- a/source4/torture/rpc/bench.c +++ b/source4/torture/rpc/bench.c @@ -102,9 +102,7 @@ BOOL torture_bench_rpc(void) status = torture_rpc_connection(mem_ctx, &p, - DCERPC_SRVSVC_NAME, - DCERPC_SRVSVC_UUID, - DCERPC_SRVSVC_VERSION); + &dcerpc_table_srvsvc); if (!NT_STATUS_IS_OK(status)) { talloc_free(mem_ctx); return False; -- cgit From 25bb00fbcd409572e1c19c05fdc42c883936780b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 3 Jan 2006 13:41:17 +0000 Subject: r12693: Move core data structures out of smb.h into core.h torture prototypes in seperate header (This used to be commit 73610639b23ca3743077193fa0b1de7c7f65944d) --- source4/torture/rpc/bench.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/rpc/bench.c') diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c index 21afc560a0..b0605649c3 100644 --- a/source4/torture/rpc/bench.c +++ b/source4/torture/rpc/bench.c @@ -21,6 +21,7 @@ */ #include "includes.h" +#include "torture/torture.h" #include "librpc/gen_ndr/ndr_srvsvc.h" /**************************/ -- cgit From eefe30b7d8e17ed744318417954669bacf2b3ac0 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 14 Mar 2006 15:02:05 +0000 Subject: r14379: Build torture/rpc/ as a seperate smbtorture module. Move helper functions for rpc out of torture/torture.c (This used to be commit 1d2d970f3b8aef3f36c2befb94b5dd72c0086639) --- source4/torture/rpc/bench.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/rpc/bench.c') diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c index b0605649c3..c4a0859725 100644 --- a/source4/torture/rpc/bench.c +++ b/source4/torture/rpc/bench.c @@ -23,6 +23,7 @@ #include "includes.h" #include "torture/torture.h" #include "librpc/gen_ndr/ndr_srvsvc.h" +#include "torture/rpc/rpc.h" /**************************/ /* srvsvc_NetShare */ -- cgit From 1060f6b3f621cb70b075a879f129e57f10fdbf8a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 14 Mar 2006 23:35:30 +0000 Subject: r14402: Generate seperate headers for RPC client functions. (This used to be commit 7054ebf0249930843a2baf4d023ae8f62cedb109) --- source4/torture/rpc/bench.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/rpc/bench.c') diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c index c4a0859725..a5aaaeeb29 100644 --- a/source4/torture/rpc/bench.c +++ b/source4/torture/rpc/bench.c @@ -23,6 +23,7 @@ #include "includes.h" #include "torture/torture.h" #include "librpc/gen_ndr/ndr_srvsvc.h" +#include "librpc/gen_ndr/ndr_srvsvc_c.h" #include "torture/rpc/rpc.h" /**************************/ -- cgit From 4f1c8daa36a7a0372c5fd9eab51f3c16ee81c49d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 16 Mar 2006 12:43:28 +0000 Subject: r14470: Remove some unnecessary headers. (This used to be commit f7312dab3b9aba2b2b82e8a6e0c483a32a03a63a) --- source4/torture/rpc/bench.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source4/torture/rpc/bench.c') diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c index a5aaaeeb29..a4b2cf1269 100644 --- a/source4/torture/rpc/bench.c +++ b/source4/torture/rpc/bench.c @@ -22,7 +22,6 @@ #include "includes.h" #include "torture/torture.h" -#include "librpc/gen_ndr/ndr_srvsvc.h" #include "librpc/gen_ndr/ndr_srvsvc_c.h" #include "torture/rpc/rpc.h" -- cgit From 909b111f587705a45f63540b39968f1af58a9b5d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 25 Mar 2006 16:01:28 +0000 Subject: r14720: Add torture_context argument to all torture tests (This used to be commit 3c7a5ce29108dd82210dc3e1f00414f545949e1d) --- source4/torture/rpc/bench.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/rpc/bench.c') diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c index a4b2cf1269..92b6f513bd 100644 --- a/source4/torture/rpc/bench.c +++ b/source4/torture/rpc/bench.c @@ -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; -- cgit From 628ff1bea3e167e2d45dffbffb3c4fffaa3d1916 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 29 Apr 2007 21:37:29 +0000 Subject: r22579: disable progress printing in the build-farm metze (This used to be commit 93089ad5e8b6e20c4fa92bf13b0137765aeac689) --- source4/torture/rpc/bench.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/torture/rpc/bench.c') diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c index 92b6f513bd..e847a3d9c0 100644 --- a/source4/torture/rpc/bench.c +++ b/source4/torture/rpc/bench.c @@ -82,8 +82,10 @@ static BOOL bench_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) talloc_free(tmp_ctx); count++; if (count % 50 == 0) { - printf("%.1f queries per second \r", - count / timeval_elapsed(&tv)); + if (lp_parm_bool(-1, "torture", "progress", true)) { + printf("%.1f queries per second \r", + count / timeval_elapsed(&tv)); + } } } -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/torture/rpc/bench.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/torture/rpc/bench.c') diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c index e847a3d9c0..b2077d01b3 100644 --- a/source4/torture/rpc/bench.c +++ b/source4/torture/rpc/bench.c @@ -7,7 +7,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -16,8 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit From f14bd1a90ab47a418c0ec2492990a417a0bb3bf6 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 19 Aug 2007 21:23:03 +0000 Subject: r24557: rename 'dcerpc_table_' -> 'ndr_table_' metze (This used to be commit 84651aee81aaabbebf52ffc3fbcbabb2eec6eed5) --- source4/torture/rpc/bench.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/rpc/bench.c') diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c index b2077d01b3..6e3ee1c421 100644 --- a/source4/torture/rpc/bench.c +++ b/source4/torture/rpc/bench.c @@ -105,7 +105,7 @@ BOOL torture_bench_rpc(struct torture_context *torture) status = torture_rpc_connection(mem_ctx, &p, - &dcerpc_table_srvsvc); + &ndr_table_srvsvc); if (!NT_STATUS_IS_OK(status)) { talloc_free(mem_ctx); return False; -- cgit From 919aa6b27e5fe49b70c814210aa026c19be66e8a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 28 Aug 2007 12:54:27 +0000 Subject: r24735: Use torture API in more places. (This used to be commit 1319d88c099496be29dd9214fa2492c81e848369) --- source4/torture/rpc/bench.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/rpc/bench.c') diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c index 6e3ee1c421..48fd0609f0 100644 --- a/source4/torture/rpc/bench.c +++ b/source4/torture/rpc/bench.c @@ -103,7 +103,7 @@ BOOL torture_bench_rpc(struct torture_context *torture) mem_ctx = talloc_init("torture_rpc_srvsvc"); - status = torture_rpc_connection(mem_ctx, + status = torture_rpc_connection(torture, &p, &ndr_table_srvsvc); if (!NT_STATUS_IS_OK(status)) { -- cgit From ffeee68e4b72dd94fee57366bd8d38b8c284c3d4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 12:42:09 +0000 Subject: r25026: Move param/param.h out of includes.h (This used to be commit abe8349f9b4387961ff3665d8c589d61cd2edf31) --- source4/torture/rpc/bench.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/rpc/bench.c') diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c index 48fd0609f0..be00e0b7a6 100644 --- a/source4/torture/rpc/bench.c +++ b/source4/torture/rpc/bench.c @@ -23,6 +23,7 @@ #include "torture/torture.h" #include "librpc/gen_ndr/ndr_srvsvc_c.h" #include "torture/rpc/rpc.h" +#include "param/param.h" /**************************/ /* srvsvc_NetShare */ -- cgit From 98b57d5eb61094a9c88e2f7d90d3e21b7e74e9d8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 16:46:30 +0000 Subject: r25035: Fix some more warnings, use service pointer rather than service number in more places. (This used to be commit df9cebcb97e20564359097148665bd519f31bc6f) --- source4/torture/rpc/bench.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/rpc/bench.c') diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c index be00e0b7a6..7f71723e6d 100644 --- a/source4/torture/rpc/bench.c +++ b/source4/torture/rpc/bench.c @@ -72,7 +72,7 @@ static BOOL bench_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) { struct timeval tv = timeval_current(); BOOL ret = True; - int timelimit = lp_parm_int(-1, "torture", "timelimit", 10); + int timelimit = lp_parm_int(NULL, "torture", "timelimit", 10); int count=0; printf("Running for %d seconds\n", timelimit); @@ -82,7 +82,7 @@ static BOOL bench_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) talloc_free(tmp_ctx); count++; if (count % 50 == 0) { - if (lp_parm_bool(-1, "torture", "progress", true)) { + if (lp_parm_bool(NULL, "torture", "progress", true)) { printf("%.1f queries per second \r", count / timeval_elapsed(&tv)); } -- cgit From 60a1046c5c5783799bd64fe18e03534670f83d82 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 29 Sep 2007 18:00:19 +0000 Subject: r25430: Add the loadparm context to all parametric options. (This used to be commit fd697d77c9fe67a00939a1f04b35c451316fff58) --- source4/torture/rpc/bench.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/rpc/bench.c') diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c index 7f71723e6d..9880393cdd 100644 --- a/source4/torture/rpc/bench.c +++ b/source4/torture/rpc/bench.c @@ -72,7 +72,7 @@ static BOOL bench_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) { struct timeval tv = timeval_current(); BOOL ret = True; - int timelimit = lp_parm_int(NULL, "torture", "timelimit", 10); + int timelimit = lp_parm_int(global_loadparm, NULL, "torture", "timelimit", 10); int count=0; printf("Running for %d seconds\n", timelimit); @@ -82,7 +82,7 @@ static BOOL bench_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) talloc_free(tmp_ctx); count++; if (count % 50 == 0) { - if (lp_parm_bool(NULL, "torture", "progress", true)) { + if (lp_parm_bool(global_loadparm, NULL, "torture", "progress", true)) { printf("%.1f queries per second \r", count / timeval_elapsed(&tv)); } -- cgit From 2151cde58014ea2e822c13d2f8a369b45dc19ca8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 6 Oct 2007 22:28:14 +0000 Subject: r25554: Convert last instances of BOOL, True and False to the standard types. (This used to be commit 566aa14139510788548a874e9213d91317f83ca9) --- source4/torture/rpc/bench.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'source4/torture/rpc/bench.c') diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c index 9880393cdd..2619ac2d25 100644 --- a/source4/torture/rpc/bench.c +++ b/source4/torture/rpc/bench.c @@ -28,14 +28,14 @@ /**************************/ /* srvsvc_NetShare */ /**************************/ -static BOOL test_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +static bool test_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) { NTSTATUS status; struct srvsvc_NetShareEnumAll r; struct srvsvc_NetShareCtr0 c0; uint32_t levels[] = {0, 1, 2, 501, 502}; int i; - BOOL ret = True; + bool ret = true; uint32_t resume_handle; ZERO_STRUCT(c0); @@ -53,7 +53,7 @@ static BOOL test_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) status = dcerpc_srvsvc_NetShareEnumAll(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { printf("NetShareEnumAll level %u failed - %s\n", r.in.level, nt_errstr(status)); - ret = False; + ret = false; continue; } if (!W_ERROR_IS_OK(r.out.result)) { @@ -68,10 +68,10 @@ static BOOL test_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) /* benchmark srvsvc netshareenumall queries */ -static BOOL bench_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +static bool bench_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) { struct timeval tv = timeval_current(); - BOOL ret = True; + bool ret = true; int timelimit = lp_parm_int(global_loadparm, NULL, "torture", "timelimit", 10); int count=0; @@ -95,12 +95,12 @@ static BOOL bench_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) } -BOOL torture_bench_rpc(struct torture_context *torture) +bool torture_bench_rpc(struct torture_context *torture) { NTSTATUS status; struct dcerpc_pipe *p; TALLOC_CTX *mem_ctx; - BOOL ret = True; + bool ret = true; mem_ctx = talloc_init("torture_rpc_srvsvc"); @@ -109,11 +109,11 @@ BOOL torture_bench_rpc(struct torture_context *torture) &ndr_table_srvsvc); if (!NT_STATUS_IS_OK(status)) { talloc_free(mem_ctx); - return False; + return false; } if (!bench_NetShareEnumAll(p, mem_ctx)) { - ret = False; + ret = false; } talloc_free(mem_ctx); -- cgit From bbdfbf8d9d486aee51117976b8f825759a4c4a37 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 3 Dec 2007 00:28:22 +0100 Subject: r26238: Add a loadparm context parameter to torture_context, remove more uses of global_loadparm. (This used to be commit a33a5530545086b81a3b205aa109dff11c546926) --- source4/torture/rpc/bench.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/torture/rpc/bench.c') diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c index 2619ac2d25..2ae92332f8 100644 --- a/source4/torture/rpc/bench.c +++ b/source4/torture/rpc/bench.c @@ -68,11 +68,11 @@ static bool test_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) /* benchmark srvsvc netshareenumall queries */ -static bool bench_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +static bool bench_NetShareEnumAll(struct torture_context *tctx, struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) { struct timeval tv = timeval_current(); bool ret = true; - int timelimit = lp_parm_int(global_loadparm, NULL, "torture", "timelimit", 10); + int timelimit = torture_setting_int(tctx, "timelimit", 10); int count=0; printf("Running for %d seconds\n", timelimit); @@ -82,7 +82,7 @@ static bool bench_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) talloc_free(tmp_ctx); count++; if (count % 50 == 0) { - if (lp_parm_bool(global_loadparm, NULL, "torture", "progress", true)) { + if (torture_setting_bool(tctx, "progress", true)) { printf("%.1f queries per second \r", count / timeval_elapsed(&tv)); } @@ -112,7 +112,7 @@ bool torture_bench_rpc(struct torture_context *torture) return false; } - if (!bench_NetShareEnumAll(p, mem_ctx)) { + if (!bench_NetShareEnumAll(torture, p, mem_ctx)) { ret = false; } -- cgit