summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-09-21 22:20:20 +0200
committerMichael Adam <obnox@samba.org>2012-09-22 10:18:58 +0200
commit25437df8a65e56616499dda18c696f58be08f67a (patch)
tree7199623d0fb85c8d2209fdc2f229de7df4a7b43b /source4
parent1ae6f9c62629f8513bbe93a56775b3c64ff06832 (diff)
downloadsamba-25437df8a65e56616499dda18c696f58be08f67a.tar.gz
samba-25437df8a65e56616499dda18c696f58be08f67a.tar.bz2
samba-25437df8a65e56616499dda18c696f58be08f67a.zip
s4:torture:smb2: extend the compound.invalid1 test
Test that when turning the related flag back off for the last compound request, the return code changes from invalid parameter to file closed. Pair-Programmed-With: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/smb2/compound.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source4/torture/smb2/compound.c b/source4/torture/smb2/compound.c
index 1c2b7cc5a6..596702bd99 100644
--- a/source4/torture/smb2/compound.c
+++ b/source4/torture/smb2/compound.c
@@ -348,9 +348,9 @@ static bool test_compound_invalid1(struct torture_context *tctx,
const char *fname = "compound_invalid1.dat";
struct smb2_close cl;
bool ret = true;
- struct smb2_request *req[2];
+ struct smb2_request *req[3];
- smb2_transport_credits_ask_num(tree->session->transport, 2);
+ smb2_transport_credits_ask_num(tree->session->transport, 3);
smb2_util_unlink(tree, fname);
@@ -374,7 +374,7 @@ static bool test_compound_invalid1(struct torture_context *tctx,
0x00200000;
cr.in.fname = fname;
- smb2_transport_compound_start(tree->session->transport, 2);
+ smb2_transport_compound_start(tree->session->transport, 3);
/* passing the first request with the related flag is invalid */
smb2_transport_compound_set_related(tree->session->transport, true);
@@ -388,11 +388,16 @@ static bool test_compound_invalid1(struct torture_context *tctx,
cl.in.file.handle = hd;
req[1] = smb2_close_send(tree, &cl);
+ smb2_transport_compound_set_related(tree->session->transport, false);
+ req[2] = smb2_close_send(tree, &cl);
+
status = smb2_create_recv(req[0], tree, &cr);
/* TODO: check why this fails with --signing=required */
CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
status = smb2_close_recv(req[1], &cl);
CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
+ status = smb2_close_recv(req[2], &cl);
+ CHECK_STATUS(status, NT_STATUS_FILE_CLOSED);
smb2_util_unlink(tree, fname);
done: