From ac8860d83d85ee80db510fe214abbfdc2bfdbef8 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 17 Apr 2010 20:16:14 +0200 Subject: libwbclient: Test wbcGetGroups --- nsswitch/libwbclient/tests/wbclient.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'nsswitch') diff --git a/nsswitch/libwbclient/tests/wbclient.c b/nsswitch/libwbclient/tests/wbclient.c index 1a00f9d423..5be1fad56a 100644 --- a/nsswitch/libwbclient/tests/wbclient.c +++ b/nsswitch/libwbclient/tests/wbclient.c @@ -689,6 +689,19 @@ static bool test_wbc_logon_user(struct torture_context *tctx) return true; } +static bool test_wbc_getgroups(struct torture_context *tctx) +{ + wbcErr ret; + uint32_t num_groups; + gid_t *groups; + + ret = wbcGetGroups(getenv("USERNAME"), &num_groups, &groups); + torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS, + "wbcGetGroups failed"); + wbcFreeMemory(groups); + return true; +} + struct torture_suite *torture_wbclient(void) { struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "WBCLIENT"); @@ -720,6 +733,8 @@ struct torture_suite *torture_wbclient(void) test_wbc_logon_user); torture_suite_add_simple_test(suite, "wbcChangeUserPassword", test_wbc_change_password); + torture_suite_add_simple_test(suite, "wbcGetGroups", + test_wbc_getgroups); return suite; } -- cgit