s4: allow python code to dump NTACL object as well
[Samba/ekacnet.git] / source4 / torture / rpc / remact.c
blob12132faa26fc966b7654baa0ddf1fd52d58ccf60
1 /*
2 Unix SMB/CIFS implementation.
3 test suite for remoteactivation operations
5 Copyright (C) Jelmer Vernooij 2004
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include "includes.h"
22 #include "librpc/gen_ndr/ndr_remact_c.h"
23 #include "librpc/gen_ndr/ndr_epmapper_c.h"
24 #include "torture/rpc/rpc.h"
26 #define CLSID_IMAGEDOC "02B01C80-E03D-101A-B294-00DD010F2BF9"
27 #define DCERPC_IUNKNOWN_UUID "00000000-0000-0000-c000-000000000046"
28 #define DCERPC_ICLASSFACTORY_UUID "00000001-0000-0000-c000-000000000046"
30 static bool test_RemoteActivation(struct torture_context *tctx,
31 struct dcerpc_pipe *p)
33 struct RemoteActivation r;
34 NTSTATUS status;
35 struct GUID iids[1];
36 uint16_t protseq[3] = { EPM_PROTOCOL_TCP, EPM_PROTOCOL_NCALRPC, EPM_PROTOCOL_UUID };
38 ZERO_STRUCT(r.in);
39 r.in.this_object.version.MajorVersion = 5;
40 r.in.this_object.version.MinorVersion = 1;
41 r.in.this_object.cid = GUID_random();
42 GUID_from_string(CLSID_IMAGEDOC, &r.in.Clsid);
43 r.in.ClientImpLevel = RPC_C_IMP_LEVEL_IDENTIFY;
44 r.in.num_protseqs = 3;
45 r.in.protseq = protseq;
46 r.in.Interfaces = 1;
47 GUID_from_string(DCERPC_IUNKNOWN_UUID, &iids[0]);
48 r.in.pIIDs = iids;
50 status = dcerpc_RemoteActivation(p, tctx, &r);
51 torture_assert_ntstatus_ok(tctx, status, "RemoteActivation");
53 torture_assert_werr_ok(tctx, r.out.result, "RemoteActivation");
55 torture_assert_werr_ok(tctx, *r.out.hr, "RemoteActivation");
57 torture_assert_werr_ok(tctx, r.out.results[0], "RemoteActivation");
59 GUID_from_string(DCERPC_ICLASSFACTORY_UUID, &iids[0]);
60 r.in.Interfaces = 1;
61 r.in.Mode = MODE_GET_CLASS_OBJECT;
63 status = dcerpc_RemoteActivation(p, tctx, &r);
64 torture_assert_ntstatus_ok(tctx, status,
65 "RemoteActivation(GetClassObject)");
67 torture_assert_werr_ok(tctx, r.out.result,
68 "RemoteActivation(GetClassObject)");
70 torture_assert_werr_ok(tctx, *r.out.hr, "RemoteActivation(GetClassObject)");
72 torture_assert_werr_ok(tctx, r.out.results[0],
73 "RemoteActivation(GetClassObject)");
75 return true;
78 struct torture_suite *torture_rpc_remact(TALLOC_CTX *mem_ctx)
80 struct torture_suite *suite = torture_suite_create(mem_ctx, "REMACT");
81 struct torture_rpc_tcase *tcase;
83 tcase = torture_suite_add_rpc_iface_tcase(suite, "remact", &ndr_table_IRemoteActivation);
85 torture_rpc_tcase_add_test(tcase, "RemoteActivation", test_RemoteActivation);
87 return suite;