]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4-torture: also test ClusterControl with a large initial buffer size.
authorGünther Deschner <gd@samba.org>
Thu, 16 Jul 2015 06:21:27 +0000 (08:21 +0200)
committerJosé A. Rivera <jarrpa@samba.org>
Tue, 4 Aug 2015 17:11:17 +0000 (19:11 +0200)
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: José A. Rivera <jarrpa@samba.org>
source4/torture/rpc/clusapi.c

index 8163029f0d3eb4ece7645c41e727863a6f81293e..1ba96570456c059740c8e5d3605f1c2c7269cd95 100644 (file)
@@ -2056,6 +2056,21 @@ static bool test_ClusterControl_int(struct torture_context *tctx,
                r.out.result,
                "ClusterControl failed");
 
+       /* now try what happens when we query with a buffer large enough to hold
+        * the entire packet */
+
+       r.in.nOutBufferSize = 0x400;
+       r.out.lpOutBuffer = talloc_zero_array(tctx, uint8_t, r.in.nOutBufferSize);
+
+       torture_assert_ntstatus_ok(tctx,
+               dcerpc_clusapi_ClusterControl_r(b, tctx, &r),
+               "ClusterControl failed");
+       torture_assert_werr_ok(tctx,
+               r.out.result,
+               "ClusterControl failed");
+       torture_assert(tctx, *r.out.lpBytesReturned < r.in.nOutBufferSize,
+               "lpBytesReturned expected to be smaller than input size nOutBufferSize");
+
        return true;
 }