From: Günther Deschner Date: Thu, 16 Jul 2015 06:21:27 +0000 (+0200) Subject: s4-torture: also test ClusterControl with a large initial buffer size. X-Git-Tag: talloc-2.1.4~460 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2654ac3d52bcc99a650b35f492af4ba2f857217d;p=thirdparty%2Fsamba.git s4-torture: also test ClusterControl with a large initial buffer size. Guenther Signed-off-by: Günther Deschner Reviewed-by: José A. Rivera --- diff --git a/source4/torture/rpc/clusapi.c b/source4/torture/rpc/clusapi.c index 8163029f0d3..1ba96570456 100644 --- a/source4/torture/rpc/clusapi.c +++ b/source4/torture/rpc/clusapi.c @@ -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; }