diff options
author | Günther Deschner <gd@samba.org> | 2009-04-10 21:10:07 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2009-04-28 09:11:19 +0200 |
commit | 2bf4ec443a1fafab6507a81b2597ad3160f61ca1 (patch) | |
tree | 5c73b0c960640eb1e558a91f5c8972d0b1dc7850 | |
parent | b7305e3955e8be75fffa1f9bde2f56259464270d (diff) | |
download | samba-2bf4ec443a1fafab6507a81b2597ad3160f61ca1.tar.gz |
s4-smbtorture: add test_ControlService() to RPC-SVCCTL.
Guenther
(cherry picked from commit a263eaca499cf2b8a89c3ab04c6ef5e7e9aea396)
(cherry picked from commit d9d4e769a4d4a2978656ef77e9e91308152a9483)
-rw-r--r-- | source4/torture/rpc/svcctl.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/source4/torture/rpc/svcctl.c b/source4/torture/rpc/svcctl.c index ca1874480fc..ad27060659d 100644 --- a/source4/torture/rpc/svcctl.c +++ b/source4/torture/rpc/svcctl.c @@ -345,6 +345,38 @@ static bool test_StartServiceW(struct torture_context *tctx, return true; } +static bool test_ControlService(struct torture_context *tctx, + struct dcerpc_pipe *p) +{ + struct svcctl_ControlService r; + struct policy_handle h, s; + struct SERVICE_STATUS service_status; + + if (!test_OpenSCManager(p, tctx, &h)) + return false; + + if (!test_OpenService(p, tctx, &h, TORTURE_DEFAULT_SERVICE, &s)) + return false; + + r.in.handle = &s; + r.in.control = 0; + r.out.service_status = &service_status; + + torture_assert_ntstatus_ok(tctx, + dcerpc_svcctl_ControlService(p, tctx, &r), + "ControlService failed!"); + torture_assert_werr_equal(tctx, r.out.result, WERR_INVALID_PARAM, + "ControlService failed!"); + + if (!test_CloseServiceHandle(p, tctx, &s)) + return false; + + if (!test_CloseServiceHandle(p, tctx, &h)) + return false; + + return true; +} + static bool test_EnumServicesStatus(struct torture_context *tctx, struct dcerpc_pipe *p) { struct svcctl_EnumServicesStatusW r; @@ -524,6 +556,8 @@ struct torture_suite *torture_rpc_svcctl(TALLOC_CTX *mem_ctx) test_QueryServiceObjectSecurity); torture_rpc_tcase_add_test(tcase, "StartServiceW", test_StartServiceW); + torture_rpc_tcase_add_test(tcase, "ControlService", + test_ControlService); return suite; } |