diff options
author | Volker Lendecke <vl@samba.org> | 2010-04-17 15:50:31 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-04-19 14:27:20 +0200 |
commit | 3aaa07afea4fa66e2767fd3fb8f06b0018aaefa8 (patch) | |
tree | b12b42eea91aa7c4853aa6775064670a385f4095 /nsswitch | |
parent | 496c459388f56f9c79a3ca1cc1a913946d4e62be (diff) | |
download | samba-3aaa07afea4fa66e2767fd3fb8f06b0018aaefa8.tar.gz samba-3aaa07afea4fa66e2767fd3fb8f06b0018aaefa8.tar.bz2 samba-3aaa07afea4fa66e2767fd3fb8f06b0018aaefa8.zip |
libwbclient: Test wbcChangeUserPassword
Diffstat (limited to 'nsswitch')
-rw-r--r-- | nsswitch/libwbclient/tests/wbclient.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/nsswitch/libwbclient/tests/wbclient.c b/nsswitch/libwbclient/tests/wbclient.c index 09f8fdbae7..1a00f9d423 100644 --- a/nsswitch/libwbclient/tests/wbclient.c +++ b/nsswitch/libwbclient/tests/wbclient.c @@ -574,6 +574,27 @@ static bool test_wbc_authenticate_user(struct torture_context *tctx) return test_wbc_authenticate_user_int(tctx, getenv("PASSWORD")); } +static bool test_wbc_change_password(struct torture_context *tctx) +{ + wbcErr ret; + + ret = wbcChangeUserPassword(getenv("USERNAME"), getenv("PASSWORD"), + "passW0rd"); + torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS, + "wbcChangeUserPassword failed"); + + if (!test_wbc_authenticate_user_int(tctx, "passW0rd")) { + return false; + } + + ret = wbcChangeUserPassword(getenv("USERNAME"), "passW0rd", + getenv("PASSWORD")); + torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS, + "wbcChangeUserPassword failed"); + + return test_wbc_authenticate_user_int(tctx, getenv("PASSWORD")); +} + static bool test_wbc_logon_user(struct torture_context *tctx) { struct wbcLogonUserParams params; @@ -697,6 +718,8 @@ struct torture_suite *torture_wbclient(void) test_wbc_authenticate_user); torture_suite_add_simple_test(suite, "wbcLogonUser", test_wbc_logon_user); + torture_suite_add_simple_test(suite, "wbcChangeUserPassword", + test_wbc_change_password); return suite; } |