summaryrefslogtreecommitdiff
path: root/source4/torture/rpc/remact.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-08-28 16:24:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:03:02 -0500
commit18302e7030e568d23f13717cb006193490e4213d (patch)
treec1c5985f584a25e7e2798f8a5d179847c4bd5d09 /source4/torture/rpc/remact.c
parent0e6773525fa9d3fe9b7559ab4067e088f8a934d8 (diff)
downloadsamba-18302e7030e568d23f13717cb006193490e4213d.tar.gz
samba-18302e7030e568d23f13717cb006193490e4213d.tar.bz2
samba-18302e7030e568d23f13717cb006193490e4213d.zip
r24751: Run more tests, remove empty testsuites, more small improvements.
(This used to be commit 2a5a0819eea86ba322434306e062d13893b5722e)
Diffstat (limited to 'source4/torture/rpc/remact.c')
-rw-r--r--source4/torture/rpc/remact.c78
1 files changed, 22 insertions, 56 deletions
diff --git a/source4/torture/rpc/remact.c b/source4/torture/rpc/remact.c
index d1294f429d..1fc3c1376b 100644
--- a/source4/torture/rpc/remact.c
+++ b/source4/torture/rpc/remact.c
@@ -28,7 +28,8 @@
#define DCERPC_IUNKNOWN_UUID "00000000-0000-0000-c000-000000000046"
#define DCERPC_ICLASSFACTORY_UUID "00000001-0000-0000-c000-000000000046"
-static int test_RemoteActivation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
+static bool test_RemoteActivation(struct torture_context *tctx,
+ struct dcerpc_pipe *p)
{
struct RemoteActivation r;
NTSTATUS status;
@@ -47,77 +48,42 @@ static int test_RemoteActivation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
GUID_from_string(DCERPC_IUNKNOWN_UUID, &iids[0]);
r.in.pIIDs = iids;
- status = dcerpc_RemoteActivation(p, mem_ctx, &r);
- if(NT_STATUS_IS_ERR(status)) {
- printf("RemoteActivation: %s\n", nt_errstr(status));
- return 0;
- }
+ status = dcerpc_RemoteActivation(p, tctx, &r);
+ torture_assert_ntstatus_ok(tctx, status, "RemoteActivation");
- if(!W_ERROR_IS_OK(r.out.result)) {
- printf("RemoteActivation: %s\n", win_errstr(r.out.result));
- return 0;
- }
+ torture_assert_werr_ok(tctx, r.out.result, "RemoteActivation");
- if(!W_ERROR_IS_OK(*r.out.hr)) {
- printf("RemoteActivation: %s\n", win_errstr(*r.out.hr));
- return 0;
- }
+ torture_assert_werr_ok(tctx, *r.out.hr, "RemoteActivation");
- if(!W_ERROR_IS_OK(r.out.results[0])) {
- printf("RemoteActivation: %s\n", win_errstr(r.out.results[0]));
- return 0;
- }
+ torture_assert_werr_ok(tctx, r.out.results[0], "RemoteActivation");
GUID_from_string(DCERPC_ICLASSFACTORY_UUID, &iids[0]);
r.in.Interfaces = 1;
r.in.Mode = MODE_GET_CLASS_OBJECT;
- status = dcerpc_RemoteActivation(p, mem_ctx, &r);
- if(NT_STATUS_IS_ERR(status)) {
- printf("RemoteActivation(GetClassObject): %s\n", nt_errstr(status));
- return 0;
- }
+ status = dcerpc_RemoteActivation(p, tctx, &r);
+ torture_assert_ntstatus_ok(tctx, status,
+ "RemoteActivation(GetClassObject)");
- if(!W_ERROR_IS_OK(r.out.result)) {
- printf("RemoteActivation(GetClassObject): %s\n", win_errstr(r.out.result));
- return 0;
- }
+ torture_assert_werr_ok(tctx, r.out.result,
+ "RemoteActivation(GetClassObject)");
- if(!W_ERROR_IS_OK(*r.out.hr)) {
- printf("RemoteActivation(GetClassObject): %s\n", win_errstr(*r.out.hr));
- return 0;
- }
+ torture_assert_werr_ok(tctx, *r.out.hr, "RemoteActivation(GetClassObject)");
- if(!W_ERROR_IS_OK(r.out.results[0])) {
- printf("RemoteActivation(GetClassObject): %s\n", win_errstr(r.out.results[0]));
- return 0;
- }
+ torture_assert_werr_ok(tctx, r.out.results[0],
+ "RemoteActivation(GetClassObject)");
- return 1;
+ return true;
}
-BOOL torture_rpc_remact(struct torture_context *torture)
+struct torture_suite *torture_rpc_remact(TALLOC_CTX *mem_ctx)
{
- NTSTATUS status;
- struct dcerpc_pipe *p;
- TALLOC_CTX *mem_ctx;
- BOOL ret = True;
-
- mem_ctx = talloc_init("torture_rpc_remact");
-
- status = torture_rpc_connection(torture,
- &p,
- &ndr_table_IRemoteActivation);
-
- if (!NT_STATUS_IS_OK(status)) {
- talloc_free(mem_ctx);
- return False;
- }
+ struct torture_suite *suite = torture_suite_create(mem_ctx, "REMACT");
+ struct torture_rpc_tcase *tcase;
- if(!test_RemoteActivation(p, mem_ctx))
- ret = False;
+ tcase = torture_suite_add_rpc_iface_tcase(suite, "remact", &ndr_table_IRemoteActivation);
- talloc_free(mem_ctx);
+ torture_rpc_tcase_add_test(tcase, "RemoteActivation", test_RemoteActivation);
- return ret;
+ return suite;
}