summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-04-10 20:55:10 +0200
committerGünther Deschner <gd@samba.org>2009-04-24 13:36:47 +0200
commitf926a4e390e7108dad36ecfffaddb628b23436c0 (patch)
tree595edd9a70bfc748ee78718b2a7e2f4a5ba9d847
parentae5dd1219a14e939cb1e3674e6daba7885cc9d51 (diff)
downloadsamba-f926a4e390e7108dad36ecfffaddb628b23436c0.tar.gz
samba-f926a4e390e7108dad36ecfffaddb628b23436c0.tar.bz2
samba-f926a4e390e7108dad36ecfffaddb628b23436c0.zip
s4-smbtorture: add test_StartServiceW() to RPC-SVCCTL.
Guenther
-rw-r--r--source4/torture/rpc/svcctl.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/source4/torture/rpc/svcctl.c b/source4/torture/rpc/svcctl.c
index 13b522c3f9..ca1874480f 100644
--- a/source4/torture/rpc/svcctl.c
+++ b/source4/torture/rpc/svcctl.c
@@ -313,6 +313,38 @@ static bool test_QueryServiceObjectSecurity(struct torture_context *tctx,
return true;
}
+static bool test_StartServiceW(struct torture_context *tctx,
+ struct dcerpc_pipe *p)
+{
+ struct svcctl_StartServiceW r;
+ struct policy_handle h, s;
+
+ 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.NumArgs = 0;
+ r.in.Arguments = NULL;
+
+ torture_assert_ntstatus_ok(tctx,
+ dcerpc_svcctl_StartServiceW(p, tctx, &r),
+ "StartServiceW failed!");
+ torture_assert_werr_equal(tctx, r.out.result,
+ WERR_SERVICE_ALREADY_RUNNING,
+ "StartServiceW 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;
@@ -490,6 +522,8 @@ struct torture_suite *torture_rpc_svcctl(TALLOC_CTX *mem_ctx)
test_QueryServiceConfig2W);
torture_rpc_tcase_add_test(tcase, "QueryServiceObjectSecurity",
test_QueryServiceObjectSecurity);
+ torture_rpc_tcase_add_test(tcase, "StartServiceW",
+ test_StartServiceW);
return suite;
}