selftest: Add tunable for smb2.maxfid limit
authorChristof Schmitt <cs@samba.org>
Wed, 13 Jul 2016 20:09:48 +0000 (13:09 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 14 Jul 2016 00:06:10 +0000 (02:06 +0200)
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/torture/smb2/maxfid.c

index 3de76ab6b70fcc56199f19396dc3336acf0795c3..cfdf7c17939d830e472e00f8281f8220c2035a06 100644 (file)
@@ -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;
@@ -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");