From 357fd2cecc6ee1cd0eb8b3d377454d3f02825ea1 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 25 Jan 2011 22:51:26 +0100 Subject: s4-torture: Added a test_Insert for epmapper. --- source4/torture/rpc/epmapper.c | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/epmapper.c b/source4/torture/rpc/epmapper.c index 77c93631fb..326a5bfdee 100644 --- a/source4/torture/rpc/epmapper.c +++ b/source4/torture/rpc/epmapper.c @@ -391,6 +391,52 @@ static bool test_Delete(struct torture_context *tctx, return true; } +static bool test_Insert(struct torture_context *tctx, + struct dcerpc_binding_handle *h, + const char *annotation, + struct dcerpc_binding *b) +{ + struct epm_Insert r; + NTSTATUS status; + + r.in.num_ents = 1; + r.in.entries = talloc_array(tctx, struct epm_entry_t, 1); + + ZERO_STRUCT(r.in.entries[0].object); + r.in.entries[0].annotation = annotation; + + + r.in.entries[0].tower = talloc(tctx, struct epm_twr_t); + + status = dcerpc_binding_build_tower(tctx, + b, + &r.in.entries[0].tower->tower); + + torture_assert_ntstatus_ok(tctx, + status, + "Unable to build tower from binding struct"); + r.in.replace = 0; + + /* shoot! */ + status = dcerpc_epm_Insert_r(h, tctx, &r); + + if (NT_STATUS_IS_ERR(status)) { + torture_comment(tctx, + "epm_Insert failed - %s\n", + nt_errstr(status)); + return false; + } + + if (r.out.result != EPMAPPER_STATUS_OK) { + torture_comment(tctx, + "epm_Insert failed - internal error: 0x%.4x\n", + r.out.result); + return false; + } + + return true; +} + static bool test_Insert_noreplace(struct torture_context *tctx, struct dcerpc_pipe *p) { -- cgit