Imported Upstream version 4.0.0+dfsg1
[abartlet/samba-debian.git] / source4 / torture / smb2 / read.c
index 076ae9c23e14a00bdecbc838729eaa064d6b102f..3600765c8e966199bf54e86bc0021794411de446 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);