s4-torture: remove unchecked read from smb2 create
authorDavid Disseldorp <ddiss@suse.de>
Wed, 21 Sep 2011 19:50:29 +0000 (21:50 +0200)
committerDavid Disseldorp <ddiss@samba.org>
Thu, 29 Sep 2011 11:14:21 +0000 (13:14 +0200)
Add a corresponding test case to smb2.read.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
source4/torture/smb2/read.c
source4/torture/smb2/util.c

index f27ce2441395c20dea51e1cd259510768da880fb..92b3ce0cf705c4e9db075f91b89800c31db3c740 100644 (file)
@@ -57,9 +57,18 @@ static bool test_read_eof(struct torture_context *torture, struct smb2_tree *tre
 
        ZERO_STRUCT(buf);
 
+       smb2_util_unlink(tree, FNAME);
+
        status = torture_smb2_testfile(tree, FNAME, &h);
        CHECK_STATUS(status, NT_STATUS_OK);
 
+       ZERO_STRUCT(rd);
+       rd.in.file.handle = h;
+       rd.in.length      = 5;
+       rd.in.offset      = 0;
+       status = smb2_read(tree, tree, &rd);
+       CHECK_STATUS(status, NT_STATUS_END_OF_FILE);
+
        status = smb2_util_write(tree, h, buf, 0, ARRAY_SIZE(buf));
        CHECK_STATUS(status, NT_STATUS_OK);
 
index 54aea81e0bd1d4573d06f0a2500623926b4be98c..a94b0d76b6bfb4602c6af360b0eb9d491eb2753d 100644 (file)
@@ -298,7 +298,6 @@ NTSTATUS torture_smb2_testfile(struct smb2_tree *tree, const char *fname,
                               struct smb2_handle *handle)
 {
        struct smb2_create io;
-       struct smb2_read r;
        NTSTATUS status;
 
        ZERO_STRUCT(io);
@@ -318,14 +317,6 @@ NTSTATUS torture_smb2_testfile(struct smb2_tree *tree, const char *fname,
 
        *handle = io.out.file.handle;
 
-       ZERO_STRUCT(r);
-       r.in.file.handle = *handle;
-       r.in.length      = 5;
-       r.in.offset      = 0;
-
-       // What is the purpose of this? Server returns EOF.
-       smb2_read(tree, tree, &r);
-
        return NT_STATUS_OK;
 }