summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-04-09 10:01:02 +0200
committerGünther Deschner <gd@samba.org>2009-04-09 14:33:28 +0200
commit544113f9dd97b183bb510b92cf7626d93ac9bcf8 (patch)
tree0be6ca262e7da5377bafaf3d9015459aeb104c7b
parent65ad2ced6049f2901080cff61489fee7f4929c74 (diff)
downloadsamba-544113f9dd97b183bb510b92cf7626d93ac9bcf8.tar.gz
samba-544113f9dd97b183bb510b92cf7626d93ac9bcf8.tar.bz2
samba-544113f9dd97b183bb510b92cf7626d93ac9bcf8.zip
s4-smbtorture: add test_QueryServiceStatus() to RPC-SVCCTL.
Guenther
-rw-r--r--source4/torture/rpc/svcctl.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/source4/torture/rpc/svcctl.c b/source4/torture/rpc/svcctl.c
index 375df9f647..b57ba1a8ba 100644
--- a/source4/torture/rpc/svcctl.c
+++ b/source4/torture/rpc/svcctl.c
@@ -74,6 +74,36 @@ static bool test_OpenService(struct dcerpc_pipe *p, struct torture_context *tctx
}
+static bool test_QueryServiceStatus(struct torture_context *tctx,
+ struct dcerpc_pipe *p)
+{
+ struct svcctl_QueryServiceStatus r;
+ struct policy_handle h, s;
+ struct SERVICE_STATUS service_status;
+ NTSTATUS status;
+
+ if (!test_OpenSCManager(p, tctx, &h))
+ return false;
+
+ if (!test_OpenService(p, tctx, &h, "Netlogon", &s))
+ return false;
+
+ r.in.handle = &s;
+ r.out.service_status = &service_status;
+
+ status = dcerpc_svcctl_QueryServiceStatus(p, tctx, &r);
+ torture_assert_ntstatus_ok(tctx, status, "QueryServiceStatus failed!");
+ torture_assert_werr_ok(tctx, r.out.result, "QueryServiceStatus failed!");
+
+ if (!test_CloseServiceHandle(p, tctx, &s))
+ return false;
+
+ if (!test_CloseServiceHandle(p, tctx, &h))
+ return false;
+
+ return true;
+}
+
static bool test_QueryServiceStatusEx(struct torture_context *tctx, struct dcerpc_pipe *p)
{
struct svcctl_QueryServiceStatusEx r;
@@ -285,6 +315,8 @@ struct torture_suite *torture_rpc_svcctl(TALLOC_CTX *mem_ctx)
test_SCManager);
torture_rpc_tcase_add_test(tcase, "EnumServicesStatus",
test_EnumServicesStatus);
+ torture_rpc_tcase_add_test(tcase, "QueryServiceStatus",
+ test_QueryServiceStatus);
torture_rpc_tcase_add_test(tcase, "QueryServiceStatusEx",
test_QueryServiceStatusEx);
torture_rpc_tcase_add_test(tcase, "QueryServiceConfig2W",