From 496c459388f56f9c79a3ca1cc1a913946d4e62be Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 17 Apr 2010 14:05:57 +0200 Subject: libwbclient: Abstract out test_wbc_authenticate_user for reuse --- nsswitch/libwbclient/tests/wbclient.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'nsswitch/libwbclient') diff --git a/nsswitch/libwbclient/tests/wbclient.c b/nsswitch/libwbclient/tests/wbclient.c index 7047e09055..09f8fdbae7 100644 --- a/nsswitch/libwbclient/tests/wbclient.c +++ b/nsswitch/libwbclient/tests/wbclient.c @@ -529,21 +529,22 @@ static bool test_wbc_get_sidaliases(struct torture_context *tctx) return true; } -static bool test_wbc_authenticate_user(struct torture_context *tctx) +static bool test_wbc_authenticate_user_int(struct torture_context *tctx, + const char *correct_password) { struct wbcAuthUserParams params; struct wbcAuthUserInfo *info = NULL; struct wbcAuthErrorInfo *error = NULL; wbcErr ret; - ret = wbcAuthenticateUser(getenv("USERNAME"), getenv("PASSWORD")); + ret = wbcAuthenticateUser(getenv("USERNAME"), correct_password); torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS, "wbcAuthenticateUser failed"); ZERO_STRUCT(params); params.account_name = getenv("USERNAME"); params.level = WBC_AUTH_USER_LEVEL_PLAIN; - params.password.plaintext = getenv("PASSWORD"); + params.password.plaintext = correct_password; ret = wbcAuthenticateUserEx(¶ms, &info, &error); torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS, @@ -568,6 +569,11 @@ static bool test_wbc_authenticate_user(struct torture_context *tctx) return true; } +static bool test_wbc_authenticate_user(struct torture_context *tctx) +{ + return test_wbc_authenticate_user_int(tctx, getenv("PASSWORD")); +} + static bool test_wbc_logon_user(struct torture_context *tctx) { struct wbcLogonUserParams params; -- cgit