summaryrefslogtreecommitdiff
path: root/source4/torture/rpc/epmapper.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-01-25 22:51:26 +0100
committerGünther Deschner <gd@samba.org>2011-01-27 14:41:41 +0100
commit357fd2cecc6ee1cd0eb8b3d377454d3f02825ea1 (patch)
tree4d7a7eb8ad6924c815ec6bf8019b73242038774b /source4/torture/rpc/epmapper.c
parent43f766dd0494e4b6c52a5e8bdffd5e82740d13ae (diff)
downloadsamba-357fd2cecc6ee1cd0eb8b3d377454d3f02825ea1.tar.gz
samba-357fd2cecc6ee1cd0eb8b3d377454d3f02825ea1.tar.bz2
samba-357fd2cecc6ee1cd0eb8b3d377454d3f02825ea1.zip
s4-torture: Added a test_Insert for epmapper.
Diffstat (limited to 'source4/torture/rpc/epmapper.c')
-rw-r--r--source4/torture/rpc/epmapper.c46
1 files changed, 46 insertions, 0 deletions
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)
{