summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorRichard Sharpe <realrichardsharpe@gmail.com>2013-02-14 16:04:24 -0800
committerJeremy Allison <jra@samba.org>2013-02-15 07:09:59 +0100
commit10b96e3ffe1ccec4e6866b61ddd93e04a7863bbf (patch)
tree1601e92947bb7ac7b2fb19c7a525423590e33991 /source4
parentdaada849209df893ef9b42ea2be5de77d2d4125f (diff)
downloadsamba-10b96e3ffe1ccec4e6866b61ddd93e04a7863bbf.tar.gz
samba-10b96e3ffe1ccec4e6866b61ddd93e04a7863bbf.tar.bz2
samba-10b96e3ffe1ccec4e6866b61ddd93e04a7863bbf.zip
Fix the maxfids test so that it does not fork lots of processes and so that it works for all cases of maxfids.
Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Feb 15 07:09:59 CET 2013 on sn-devel-104
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/basic/base.c2
-rw-r--r--source4/torture/basic/misc.c22
2 files changed, 5 insertions, 19 deletions
diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c
index 56461005e8..5fba9b0812 100644
--- a/source4/torture/basic/base.c
+++ b/source4/torture/basic/base.c
@@ -1938,7 +1938,7 @@ NTSTATUS torture_base_init(void)
torture_suite_add_smb_multi_test(suite, "bench-torture", run_torture);
torture_suite_add_1smb_test(suite, "scan-pipe_number", run_pipe_number);
torture_suite_add_1smb_test(suite, "scan-ioctl", torture_ioctl_test);
- torture_suite_add_smb_multi_test(suite, "scan-maxfid", run_maxfidtest);
+ torture_suite_add_1smb_test(suite, "scan-maxfid", torture_maxfid_test);
suite->description = talloc_strdup(suite,
"Basic SMB tests (imported from the original smbtorture)");
diff --git a/source4/torture/basic/misc.c b/source4/torture/basic/misc.c
index 213d923950..721727ba17 100644
--- a/source4/torture/basic/misc.c
+++ b/source4/torture/basic/misc.c
@@ -295,7 +295,7 @@ bool torture_holdopen(struct torture_context *tctx,
/*
test how many open files this server supports on the one socket
*/
-bool run_maxfidtest(struct torture_context *tctx, struct smbcli_state *cli, int dummy)
+bool torture_maxfid_test(struct torture_context *tctx, struct smbcli_state *cli)
{
#define MAXFID_TEMPLATE "\\maxfid\\fid%d\\maxfid.%d.%d"
char *fname;
@@ -347,12 +347,11 @@ bool run_maxfidtest(struct torture_context *tctx, struct smbcli_state *cli, int
}
}
torture_comment(tctx, "%6d\n", i);
- i--;
maxfid = i;
torture_comment(tctx, "cleaning up\n");
- for (i=0;i<maxfid/2;i++) {
+ for (i=0;i<maxfid;i++) {
asprintf(&fname, MAXFID_TEMPLATE, i/1000, i,(int)getpid());
if (NT_STATUS_IS_ERR(smbcli_close(cli->tree, fnums[i]))) {
torture_comment(tctx, "Close of fnum %d failed - %s\n", fnums[i], smbcli_errstr(cli->tree));
@@ -364,19 +363,8 @@ bool run_maxfidtest(struct torture_context *tctx, struct smbcli_state *cli, int
}
free(fname);
- asprintf(&fname, MAXFID_TEMPLATE, (maxfid-i)/1000, maxfid-i,(int)getpid());
- if (NT_STATUS_IS_ERR(smbcli_close(cli->tree, fnums[maxfid-i]))) {
- torture_comment(tctx, "Close of fnum %d failed - %s\n", fnums[maxfid-i], smbcli_errstr(cli->tree));
- }
- if (NT_STATUS_IS_ERR(smbcli_unlink(cli->tree, fname))) {
- torture_comment(tctx, "unlink of %s failed (%s)\n",
- fname, smbcli_errstr(cli->tree));
- correct = false;
- }
- free(fname);
-
if (torture_setting_bool(tctx, "progress", true)) {
- torture_comment(tctx, "%6d %6d\r", i, maxfid-i);
+ torture_comment(tctx, "%6d\r", i);
fflush(stdout);
}
}
@@ -389,9 +377,7 @@ bool run_maxfidtest(struct torture_context *tctx, struct smbcli_state *cli, int
}
torture_comment(tctx, "maxfid test finished\n");
- if (!torture_close_connection(cli)) {
- correct = false;
- }
+
return correct;
#undef MAXFID_TEMPLATE
}