Пример #1
0
BOOL torture_rpc_epmapper(struct torture_context *torture)
{
        NTSTATUS status;
        struct dcerpc_pipe *p;
	TALLOC_CTX *mem_ctx;
	BOOL ret = True;

	mem_ctx = talloc_init("torture_rpc_epmapper");

	status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_epmapper);
	if (!NT_STATUS_IS_OK(status)) {
		talloc_free(mem_ctx);
		return False;
	}

	if (!test_Lookup(p, mem_ctx)) {
		ret = False;
	}

	if (!test_Insert(p, mem_ctx)) {
		ret = False;
	}

	if (!test_InqObject(p, mem_ctx)) {
		ret = False;
	}

	talloc_free(mem_ctx);

	return ret;
}
int main(void) {

  test_Insert();

  puts("");
  puts("TESTING COMPLETE!");
  
  return 0;
}
Пример #3
0
static bool test_Map_full(struct torture_context *tctx,
			   struct dcerpc_pipe *p)
{
	const struct ndr_syntax_id obj = {
		{ 0x8a885d04, 0x1ceb, 0x11c9, {0x9f, 0xe8}, {0x08,0x00,0x2b,0x10,0x48,0x60} },
		2
	};
	struct dcerpc_binding_handle *h = p->binding_handle;
	const char *annotation = "SMBTORTURE";
	struct dcerpc_binding *b;
	NTSTATUS status;
	bool ok;

	status = dcerpc_parse_binding(tctx, "ncacn_ip_tcp:216.83.154.106[41768]", &b);
	torture_assert_ntstatus_ok(tctx,
				   status,
				   "Unable to generate dcerpc_binding struct");
	b->object = obj;

	ok = test_Insert(tctx, h, obj, annotation, b);
	if (!ok) {
		return false;
	}

	ok = test_Map_tcpip(tctx, h, obj);
	if (!ok) {
		return false;
	}

	ok = test_Delete(tctx, h, annotation, b);
	if (!ok) {
		return false;
	}

	return true;
}