summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2011-07-22 10:48:35 +0200
committerStefan Metzmacher <metze@samba.org>2011-07-22 17:06:08 +0200
commit0986b0bed78c90c2b688cc9d98e5daa8c471cdc2 (patch)
treea12cea13275109e21b776f15971071a5652b10bd /source3/torture
parent48de32936389612240203d3d12016d8730aeb64c (diff)
downloadsamba-0986b0bed78c90c2b688cc9d98e5daa8c471cdc2.tar.gz
s3-torture: introduce test_cli_read()
test_cli_read calls cli_read and returns success or failure Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index c197de98cb6..aa24a180122 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -1905,6 +1905,28 @@ static bool run_locktest3(int dummy)
return correct;
}
+static bool test_cli_read(struct cli_state *cli, uint16_t fnum,
+ char *buf, off_t offset, size_t size,
+ size_t *nread, size_t expect)
+{
+ NTSTATUS status;
+ size_t l_nread;
+
+ status = cli_read(cli, fnum, buf, offset, size, &l_nread);
+
+ if(!NT_STATUS_IS_OK(status)) {
+ return false;
+ } else if (l_nread != expect) {
+ return false;
+ }
+
+ if (nread) {
+ *nread = l_nread;
+ }
+
+ return true;
+}
+
#define EXPECTED(ret, v) if ((ret) != (v)) { \
printf("** "); correct = False; \
}