diff options
author | Günther Deschner <gd@samba.org> | 2007-12-04 10:20:13 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:48:09 +0100 |
commit | b466534a0dc592ad03a249228ef02d5ac339089f (patch) | |
tree | 0632ad00f36df47b52c0ea17ed0f8f06a3376306 /source4/torture/rpc | |
parent | 96b46e99072f0c31ade85a5fa539cafc021fb42c (diff) | |
download | samba-b466534a0dc592ad03a249228ef02d5ac339089f.tar.gz samba-b466534a0dc592ad03a249228ef02d5ac339089f.tar.bz2 samba-b466534a0dc592ad03a249228ef02d5ac339089f.zip |
r26286: IDL and torture test for netr_ServerTrustPasswordsGet().
Guenther
(This used to be commit 231fe8826b7d8b0f4307ffbb3cd71b4c7723a290)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r-- | source4/torture/rpc/netlogon.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index c0b26e0d87..74bc3a2bf7 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -468,6 +468,39 @@ static bool test_GetPassword(struct torture_context *tctx, return true; } + +static bool test_GetTrustPasswords(struct torture_context *tctx, + struct dcerpc_pipe *p, + struct cli_credentials *machine_credentials) +{ + struct netr_ServerTrustPasswordsGet r; + struct creds_CredentialState *creds; + struct netr_Authenticator credential; + NTSTATUS status; + struct netr_Authenticator return_authenticator; + struct samr_Password password, password2; + + if (!test_SetupCredentials(p, tctx, machine_credentials, &creds)) { + return false; + } + + creds_client_authenticator(creds, &credential); + + r.in.server_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); + r.in.account_name = talloc_asprintf(tctx, "%s$", TEST_MACHINE_NAME); + r.in.secure_channel_type = SEC_CHAN_BDC; + r.in.computer_name = TEST_MACHINE_NAME; + r.in.credential = &credential; + r.out.return_authenticator = &return_authenticator; + r.out.password = &password; + r.out.password2 = &password2; + + status = dcerpc_netr_ServerTrustPasswordsGet(p, tctx, &r); + torture_assert_ntstatus_ok(tctx, status, "ServerTrustPasswordsGet"); + + return true; +} + /* try a netlogon SamLogon */ @@ -1531,6 +1564,8 @@ struct torture_suite *torture_rpc_netlogon(TALLOC_CTX *mem_ctx) torture_rpc_tcase_add_test_creds(tcase, "SamLogon", test_SamLogon); torture_rpc_tcase_add_test_creds(tcase, "SetPassword", test_SetPassword); torture_rpc_tcase_add_test_creds(tcase, "SetPassword2", test_SetPassword2); + torture_rpc_tcase_add_test_creds(tcase, "GetPassword", test_GetPassword); + torture_rpc_tcase_add_test_creds(tcase, "GetTrustPasswords", test_GetTrustPasswords); torture_rpc_tcase_add_test_creds(tcase, "GetDomainInfo", test_GetDomainInfo); torture_rpc_tcase_add_test_creds(tcase, "DatabaseSync", test_DatabaseSync); torture_rpc_tcase_add_test_creds(tcase, "DatabaseDeltas", test_DatabaseDeltas); |