summaryrefslogtreecommitdiff
path: root/source4/torture/rpc/eventlog.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-01-20 19:01:43 +0100
committerGünther Deschner <gd@samba.org>2009-01-24 03:33:23 +0100
commitd3b8fdd71e16f2ed2f0c24b5d3ad1c22af3c0cc9 (patch)
tree201fbac8603eb25d69ea0d7e22e855dfeebc32a8 /source4/torture/rpc/eventlog.c
parentf1067c0ffcf00286332d44da54e2fbde40cc03df (diff)
downloadsamba-d3b8fdd71e16f2ed2f0c24b5d3ad1c22af3c0cc9.tar.gz
samba-d3b8fdd71e16f2ed2f0c24b5d3ad1c22af3c0cc9.tar.bz2
samba-d3b8fdd71e16f2ed2f0c24b5d3ad1c22af3c0cc9.zip
s4-smbtorture: add test_GetLogIntormation test.
Guenther
Diffstat (limited to 'source4/torture/rpc/eventlog.c')
-rw-r--r--source4/torture/rpc/eventlog.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/source4/torture/rpc/eventlog.c b/source4/torture/rpc/eventlog.c
index 5da205bcde..e1b6cd940f 100644
--- a/source4/torture/rpc/eventlog.c
+++ b/source4/torture/rpc/eventlog.c
@@ -282,6 +282,53 @@ static bool test_ClearEventLog(struct torture_context *tctx,
return true;
}
+static bool test_GetLogInformation(struct torture_context *tctx,
+ struct dcerpc_pipe *p)
+{
+ NTSTATUS status;
+ struct eventlog_GetLogIntormation r;
+ struct eventlog_CloseEventLog cr;
+ struct policy_handle handle;
+ uint32_t bytes_needed = 0;
+
+ if (!get_policy_handle(tctx, p, &handle))
+ return false;
+
+ r.in.handle = &handle;
+ r.in.level = 1;
+ r.in.buf_size = 0;
+ r.out.buffer = NULL;
+ r.out.bytes_needed = &bytes_needed;
+
+ status = dcerpc_eventlog_GetLogIntormation(p, tctx, &r);
+
+ torture_assert_ntstatus_equal(tctx, status, NT_STATUS_INVALID_LEVEL,
+ "GetLogInformation failed");
+
+ r.in.level = 0;
+
+ status = dcerpc_eventlog_GetLogIntormation(p, tctx, &r);
+
+ torture_assert_ntstatus_equal(tctx, status, NT_STATUS_BUFFER_TOO_SMALL,
+ "GetLogInformation failed");
+
+ r.in.buf_size = bytes_needed;
+ r.out.buffer = talloc_array(tctx, uint8_t, bytes_needed);
+
+ status = dcerpc_eventlog_GetLogIntormation(p, tctx, &r);
+
+ torture_assert_ntstatus_ok(tctx, status, "GetLogInformation failed");
+
+ cr.in.handle = cr.out.handle = &handle;
+
+ torture_assert_ntstatus_ok(tctx,
+ dcerpc_eventlog_CloseEventLog(p, tctx, &cr),
+ "CloseEventLog failed");
+
+ return true;
+}
+
+
static bool test_OpenEventLog(struct torture_context *tctx,
struct dcerpc_pipe *p)
{
@@ -318,6 +365,7 @@ struct torture_suite *torture_rpc_eventlog(TALLOC_CTX *mem_ctx)
torture_rpc_tcase_add_test(tcase, "ReadEventLog", test_ReadEventLog);
torture_rpc_tcase_add_test(tcase, "ReportEventLog", test_ReportEventLog);
torture_rpc_tcase_add_test(tcase, "FlushEventLog", test_FlushEventLog);
+ torture_rpc_tcase_add_test(tcase, "GetLogIntormation", test_GetLogInformation);
return suite;
}