[PATCH v2 1/4] torture: validate FSCTL_SRV_ENUMERATE_SNAPSHOTS response

David Disseldorp ddiss at samba.org
Fri Jun 20 11:14:12 MDT 2014


Check the NumberOfSnapShotsReturned and SnapShotArraySize fields in the
FSCTL_SRV_ENUMERATE_SNAPSHOTS response match expected values.

This is a regression test for bso#10549.

Signed-off-by: David Disseldorp <ddiss at samba.org>
---
 source4/torture/rpc/fsrvp.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/source4/torture/rpc/fsrvp.c b/source4/torture/rpc/fsrvp.c
index 4a55d28..85d188e 100644
--- a/source4/torture/rpc/fsrvp.c
+++ b/source4/torture/rpc/fsrvp.c
@@ -551,6 +551,16 @@ static bool test_fsrvp_enum_snaps(struct torture_context *tctx,
 
 	*_count = IVAL(io.out.out.data, 0);
 
+	/* with max_response_size=16, no labels should be sent */
+	torture_assert_int_equal(tctx, IVAL(io.out.out.data, 4), 0,
+				 "enum snaps labels");
+
+	/* TODO with 0 snaps, needed_data_count should be 0? */
+	if (*_count != 0) {
+		torture_assert(tctx, IVAL(io.out.out.data, 8) != 0,
+			       "enum snaps needed non-zero");
+	}
+
 	return true;
 }
 
-- 
1.8.4.5



More information about the samba-technical mailing list