[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-974-g9945d15

Günther Deschner gd at samba.org
Thu Apr 9 12:41:07 GMT 2009


The branch, master has been updated
       via  9945d15a5d184dc9a809072b7c01e5ddff96d26b (commit)
       via  544113f9dd97b183bb510b92cf7626d93ac9bcf8 (commit)
      from  65ad2ced6049f2901080cff61489fee7f4929c74 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 9945d15a5d184dc9a809072b7c01e5ddff96d26b
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 9 10:07:07 2009 +0200

    s4-smbtorture: add test_QueryServiceConfigW() to RPC-SVCCTL.
    
    Guenther

commit 544113f9dd97b183bb510b92cf7626d93ac9bcf8
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 9 10:01:02 2009 +0200

    s4-smbtorture: add test_QueryServiceStatus() to RPC-SVCCTL.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source4/torture/rpc/svcctl.c |   76 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 76 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/rpc/svcctl.c b/source4/torture/rpc/svcctl.c
index 375df9f..9c68268 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;
@@ -121,6 +151,48 @@ static bool test_QueryServiceStatusEx(struct torture_context *tctx, struct dcerp
 	return true;
 }
 
+static bool test_QueryServiceConfigW(struct torture_context *tctx,
+				     struct dcerpc_pipe *p)
+{
+	struct svcctl_QueryServiceConfigW r;
+	struct QUERY_SERVICE_CONFIG query;
+	struct policy_handle h, s;
+	NTSTATUS status;
+
+	uint32_t offered = 0;
+	uint32_t needed = 0;
+
+	if (!test_OpenSCManager(p, tctx, &h))
+		return false;
+
+	if (!test_OpenService(p, tctx, &h, "Netlogon", &s))
+		return false;
+
+	r.in.handle = &s;
+	r.in.offered = offered;
+	r.out.query = &query;
+	r.out.needed = &needed;
+
+	status = dcerpc_svcctl_QueryServiceConfigW(p, tctx, &r);
+	torture_assert_ntstatus_ok(tctx, status, "QueryServiceConfigW failed!");
+
+	if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
+		r.in.offered = needed;
+		status = dcerpc_svcctl_QueryServiceConfigW(p, tctx, &r);
+		torture_assert_ntstatus_ok(tctx, status, "QueryServiceConfigW failed!");
+	}
+
+	torture_assert_werr_ok(tctx, r.out.result, "QueryServiceConfigW failed!");
+
+	if (!test_CloseServiceHandle(p, tctx, &s))
+		return false;
+
+	if (!test_CloseServiceHandle(p, tctx, &h))
+		return false;
+
+	return true;
+}
+
 static bool test_QueryServiceConfig2W(struct torture_context *tctx, struct dcerpc_pipe *p)
 {
 	struct svcctl_QueryServiceConfig2W r;
@@ -285,8 +357,12 @@ 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, "QueryServiceConfigW",
+				   test_QueryServiceConfigW);
 	torture_rpc_tcase_add_test(tcase, "QueryServiceConfig2W",
 				   test_QueryServiceConfig2W);
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list