summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-11-02 15:43:09 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:44:11 +0100
commitb7e733e5011c82502590ac468240f9f590dfa594 (patch)
treedb791a2336e84c966482d0d5cb3d6b70c4f8ce5e
parent952eecb6164b3768add5f4bf89c992e9baa778e0 (diff)
downloadsamba-b7e733e5011c82502590ac468240f9f590dfa594.tar.gz
samba-b7e733e5011c82502590ac468240f9f590dfa594.tar.bz2
samba-b7e733e5011c82502590ac468240f9f590dfa594.zip
r25817: Add very basic FRSAPI InfoW test. Again, this is surely not correct but at least
displays a lot of very useful information. Guenther (This used to be commit 361744b89cfd1e727dba01c1512b1ba9c919e6ac)
-rw-r--r--source4/torture/rpc/frsapi.c47
1 files changed, 46 insertions, 1 deletions
diff --git a/source4/torture/rpc/frsapi.c b/source4/torture/rpc/frsapi.c
index 9ea139bf40..72aae3c196 100644
--- a/source4/torture/rpc/frsapi.c
+++ b/source4/torture/rpc/frsapi.c
@@ -207,6 +207,50 @@ static bool test_ForceReplication(struct torture_context *tctx,
return true;
}
+static bool test_InfoW(struct torture_context *tctx,
+ struct dcerpc_pipe *p)
+{
+ int i;
+
+ for (i=0; i<10; i++) {
+
+ struct frsapi_InfoW r;
+ struct frsapi_Info *info;
+ int d;
+ DATA_BLOB blob;
+
+ ZERO_STRUCT(r);
+
+ info = talloc_zero(tctx, struct frsapi_Info);
+
+ r.in.length = 0x1000;
+ r.in.info = r.out.info = info;
+
+ info->length = r.in.length;
+ info->length2 = r.in.length;
+ info->level = i;
+ info->offset = 0x2c;
+ info->blob_len = 0x2c;
+
+ torture_assert_ntstatus_ok(tctx,
+ dcerpc_frsapi_InfoW(p, tctx, &r),
+ "InfoW failed");
+
+ torture_assert_werr_ok(tctx, r.out.result, "InfoW failed");
+
+ /* display the formatted blob text */
+ blob = r.out.info->blob;
+ for (d = 0; d < blob.length; d++) {
+ if (blob.data[d]) {
+ printf("%c", blob.data[d]);
+ }
+ }
+ printf("\n");
+ }
+
+ return true;
+}
+
struct torture_suite *torture_rpc_frsapi(TALLOC_CTX *mem_ctx)
{
struct torture_rpc_tcase *tcase;
@@ -225,6 +269,7 @@ struct torture_suite *torture_rpc_frsapi(TALLOC_CTX *mem_ctx)
test = torture_rpc_tcase_add_test(tcase, "ForceReplication",
test_ForceReplication);
-
+ test = torture_rpc_tcase_add_test(tcase, "InfoW",
+ test_InfoW);
return suite;
}