torture: validate FSCTL_SRV_ENUMERATE_SNAPSHOTS response
authorDavid Disseldorp <ddiss@samba.org>
Fri, 20 Jun 2014 17:14:12 +0000 (19:14 +0200)
committerMichael Adam <obnox@samba.org>
Sat, 21 Jun 2014 10:42:10 +0000 (12:42 +0200)
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@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source4/torture/rpc/fsrvp.c

index 4a55d28963109504274ea6c15d2f384f2037ec7d..85d188ec0dc2b87fb9ecb2fc1a0f99a120a92c3a 100644 (file)
@@ -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;
 }