summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-06-25 08:49:45 +0000
committerDavid Disseldorp <ddiss@samba.org>2014-06-25 13:37:24 +0200
commit8fa0cde05f41ba9a37ed9d1fdb7b515d661426d8 (patch)
tree4b39a1a5d46e33c5686203001b4234f4539b5e7d
parent1dc5c20c8f7d8aa96fa0601bf5bf6dc69fb79d9f (diff)
downloadsamba-8fa0cde05f41ba9a37ed9d1fdb7b515d661426d8.tar.gz
samba-8fa0cde05f41ba9a37ed9d1fdb7b515d661426d8.tar.xz
samba-8fa0cde05f41ba9a37ed9d1fdb7b515d661426d8.zip
torture4: Add a little test that truncate actually works :-)
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Wed Jun 25 13:37:24 CEST 2014 on sn-devel-104
-rw-r--r--source4/torture/raw/open.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c
index 494f2a2ca6..763c718a98 100644
--- a/source4/torture/raw/open.c
+++ b/source4/torture/raw/open.c
@@ -2096,6 +2096,19 @@ static bool test_open_for_truncate(struct torture_context *tctx, struct smbcli_s
CHECK_VAL(finfo.getattre.out.size, 1024);
smbcli_close(cli->tree, fnum);
+
+ status = smb_raw_open(cli->tree, tctx, &io);
+ CHECK_STATUS(status, NT_STATUS_OK);
+ fnum = io.ntcreatex.out.file.fnum;
+
+ /* Ensure truncate actually works */
+ finfo.generic.level = RAW_FILEINFO_GETATTRE;
+ finfo.generic.in.file.fnum = fnum;
+ status = smb_raw_fileinfo(cli->tree, tctx, &finfo);
+ CHECK_STATUS(status, NT_STATUS_OK);
+ CHECK_VAL(finfo.getattre.out.size, 0);
+
+ smbcli_close(cli->tree, fnum);
smbcli_unlink(cli->tree, fname);
done: