mirror of
https://github.com/samba-team/samba.git
synced 2025-03-11 16:58:40 +03:00
s4-torture: add test for svcctl_ControlServiceExW()
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
51c21f72af
commit
fd319adcc1
@ -253,6 +253,8 @@
|
||||
^samba3.rpc.svcctl.svcctl.ChangeServiceConfigW\(nt4_dc\)
|
||||
^samba3.rpc.svcctl.svcctl.QueryServiceConfigEx\(ad_dc\)
|
||||
^samba3.rpc.svcctl.svcctl.QueryServiceConfigEx\(nt4_dc\)
|
||||
^samba3.rpc.svcctl.svcctl.ControlServiceExW\(ad_dc\)
|
||||
^samba3.rpc.svcctl.svcctl.ControlServiceExW\(nt4_dc\)
|
||||
#
|
||||
# This makes less sense when not running against an AD DC
|
||||
#
|
||||
|
@ -505,6 +505,55 @@ static bool test_ControlService(struct torture_context *tctx,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_ControlServiceExW(struct torture_context *tctx,
|
||||
struct dcerpc_pipe *p)
|
||||
{
|
||||
struct svcctl_ControlServiceExW r;
|
||||
struct policy_handle h, s;
|
||||
struct dcerpc_binding_handle *b = p->binding_handle;
|
||||
union SC_RPC_SERVICE_CONTROL_IN_PARAMSW ControlInParams;
|
||||
union SC_RPC_SERVICE_CONTROL_OUT_PARAMSW ControlOutParams;
|
||||
struct SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS psrOutParams;
|
||||
struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW psrInParams;
|
||||
|
||||
if (!test_OpenSCManager(b, tctx, &h))
|
||||
return false;
|
||||
|
||||
if (!test_OpenService(b, tctx, &h, TORTURE_DEFAULT_SERVICE, &s))
|
||||
return false;
|
||||
|
||||
ZERO_STRUCT(psrInParams);
|
||||
ZERO_STRUCT(psrOutParams);
|
||||
|
||||
psrInParams.dwReason = SERVICE_STOP_CUSTOM |
|
||||
SERVICE_STOP_REASON_MAJOR_APPLICATION |
|
||||
SERVICE_STOP_REASON_MINOR_ENVIRONMENT;
|
||||
psrInParams.pszComment = "wurst";
|
||||
|
||||
ControlInParams.psrInParams = &psrInParams;
|
||||
ControlOutParams.psrOutParams = &psrOutParams;
|
||||
|
||||
r.in.hService = s;
|
||||
r.in.dwControl = SVCCTL_CONTROL_STOP;
|
||||
r.in.dwInfoLevel = 1;
|
||||
r.in.pControlInParams = &ControlInParams;
|
||||
r.out.pControlOutParams = &ControlOutParams;
|
||||
|
||||
torture_assert_ntstatus_ok(tctx,
|
||||
dcerpc_svcctl_ControlServiceExW_r(b, tctx, &r),
|
||||
"ControlServiceExW failed!");
|
||||
torture_assert_werr_equal(tctx, r.out.result, WERR_INVALID_PARAMETER,
|
||||
"ControlServiceExW failed!");
|
||||
|
||||
if (!test_CloseServiceHandle(b, tctx, &s))
|
||||
return false;
|
||||
|
||||
if (!test_CloseServiceHandle(b, tctx, &h))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_EnumServicesStatus(struct torture_context *tctx, struct dcerpc_pipe *p)
|
||||
{
|
||||
struct svcctl_EnumServicesStatusW r;
|
||||
@ -770,6 +819,8 @@ struct torture_suite *torture_rpc_svcctl(TALLOC_CTX *mem_ctx)
|
||||
test_StartServiceW);
|
||||
torture_rpc_tcase_add_test(tcase, "ControlService",
|
||||
test_ControlService);
|
||||
torture_rpc_tcase_add_test(tcase, "ControlServiceExW",
|
||||
test_ControlServiceExW);
|
||||
torture_rpc_tcase_add_test(tcase, "ChangeServiceConfigW",
|
||||
test_ChangeServiceConfigW);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user