From 420c7b4c5dd4213f0b97e1aa987274b611726455 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 21 Feb 2004 04:02:55 +0000 Subject: added the simple HOLDCON torture test. This is used to establish hundreds of idle connections to the server, which can be used to simulate environments with large numbers of idle connections. (This used to be commit cfce9458a22e8b6da1a10bb338b287c3eab9a1fc) --- source4/torture/torture.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'source4/torture') diff --git a/source4/torture/torture.c b/source4/torture/torture.c index 9c71508bdf..a770e98c5f 100644 --- a/source4/torture/torture.c +++ b/source4/torture/torture.c @@ -2827,6 +2827,61 @@ static BOOL run_pipe_number(int dummy) } + + +/* + open N connections to the server and just hold them open + used for testing performance when there are N idle users + already connected + */ + static BOOL torture_holdcon(int dummy) +{ + int i; + struct cli_state **cli; + int num_dead = 0; + + printf("Opening %d connections\n", torture_numops); + + cli = malloc(sizeof(struct cli_state *) * torture_numops); + + for (i=0;itree, "\\"); + if (!NT_STATUS_IS_OK(status)) { + printf("Connection %d is dead\n", i); + cli[i] = NULL; + num_dead++; + } + usleep(100); + } + } + + if (num_dead == torture_numops) { + printf("All connections dead - finishing\n"); + break; + } + + printf("."); + fflush(stdout); + } + + return True; +} + + + /* Test open mode returns on read-only files. */ @@ -3943,6 +3998,7 @@ static struct { {"PIPE_NUMBER", run_pipe_number, 0}, {"IOCTL", torture_ioctl_test, 0}, {"CHKPATH", torture_chkpath_test, 0}, + {"HOLDCON", torture_holdcon, 0}, {"RAW-QFSINFO", torture_raw_qfsinfo, 0}, {"RAW-QFILEINFO", torture_raw_qfileinfo, 0}, {"RAW-SFILEINFO", torture_raw_sfileinfo, 0}, -- cgit