Skip to content

Commit

Permalink
selftest: Add tunable for smb2.maxfid limit
Browse files Browse the repository at this point in the history
Signed-off-by: Christof Schmitt <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
  • Loading branch information
chs authored and jrasamba committed Jul 14, 2016
1 parent 84992e3 commit f6d4380
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions source4/torture/smb2/maxfid.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ bool torture_smb2_maxfid(struct torture_context *tctx)
const char *dname = "smb2_maxfid";
int i, maxfid;
struct smb2_handle *handles, dir_handle = { };
const size_t max_handles = 0x41000; /* Windows 8.1 allowed 0x40000 */
size_t max_handles;

max_handles = torture_setting_int(tctx, "maxopenfiles", 0x11000);

if (!torture_smb2_connection(tctx, &tree)) {
return false;
Expand Down Expand Up @@ -117,7 +119,11 @@ bool torture_smb2_maxfid(struct torture_context *tctx)
}

maxfid = i;
torture_comment(tctx, "Maximum number of open files: %d\n", maxfid);
if (maxfid == max_handles) {
torture_comment(tctx, "Reached test limit of %d open files. "
"Adjust to higher test with "
"--option=torture:maxopenfiles=NNN\n", maxfid);
}

torture_comment(tctx, "Cleanup open files\n");

Expand Down

0 comments on commit f6d4380

Please sign in to comment.