s4:torture/smb2: we only support 64KB reads/writes for now
authorStefan Metzmacher <metze@samba.org>
Wed, 12 Oct 2011 16:34:26 +0000 (18:34 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 12 Oct 2011 23:59:05 +0000 (01:59 +0200)
We don't have multi-credit support yet.

metze

source4/torture/smb2/connect.c
source4/torture/smb2/read.c

index 1b69c18a553aaed5d512d61a32c2d4a1bb6eef33..b383a67a44bd09a1531bd93bdee9bcc0766890b6 100644 (file)
@@ -71,14 +71,14 @@ static NTSTATUS torture_smb2_write(struct torture_context *tctx, struct smb2_tre
        NTSTATUS status;
        DATA_BLOB data;
        int i;
+       uint32_t size = torture_setting_int(tctx, "smb2maxwrite", 64*1024);
        
-       if (torture_setting_bool(tctx, "dangerous", false)) {
-               data = data_blob_talloc(tree, NULL, 160000);
-       } else if (torture_setting_bool(tctx, "samba4", false)) {
-               data = data_blob_talloc(tree, NULL, UINT16_MAX);
-       } else {
-               data = data_blob_talloc(tree, NULL, torture_setting_int(tctx, "smb2maxwrite", 120000));
+       data = data_blob_talloc(tree, NULL, size);
+       if (size != data.length) {
+               printf("data_blob_talloc(%s) failed\n", size);
+               return NT_STATUS_NO_MEMORY;
        }
+
        for (i=0;i<data.length;i++) {
                data.data[i] = i;
        }
index 92b3ce0cf705c4e9db075f91b89800c31db3c740..3600765c8e966199bf54e86bc0021794411de446 100644 (file)
@@ -51,7 +51,7 @@ static bool test_read_eof(struct torture_context *torture, struct smb2_tree *tre
        bool ret = true;
        NTSTATUS status;
        struct smb2_handle h;
-       uint8_t buf[70000];
+       uint8_t buf[64*1024];
        struct smb2_read rd;
        TALLOC_CTX *tmp_ctx = talloc_new(tree);
 
@@ -143,7 +143,7 @@ static bool test_read_position(struct torture_context *torture, struct smb2_tree
        bool ret = true;
        NTSTATUS status;
        struct smb2_handle h;
-       uint8_t buf[70000];
+       uint8_t buf[64*1024];
        struct smb2_read rd;
        TALLOC_CTX *tmp_ctx = talloc_new(tree);
        union smb_fileinfo info;