summaryrefslogtreecommitdiff
path: root/nsswitch/libwbclient/tests
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-04-17 20:16:14 +0200
committerVolker Lendecke <vl@samba.org>2010-04-19 14:27:22 +0200
commitac8860d83d85ee80db510fe214abbfdc2bfdbef8 (patch)
treeeab1edbbe481ea70ab6b9557503c1fe5f73dc2d5 /nsswitch/libwbclient/tests
parentfc2cca5c28a603dc656b405019f82cafbe0c1d6a (diff)
downloadsamba-ac8860d83d85ee80db510fe214abbfdc2bfdbef8.tar.gz
samba-ac8860d83d85ee80db510fe214abbfdc2bfdbef8.tar.bz2
samba-ac8860d83d85ee80db510fe214abbfdc2bfdbef8.zip
libwbclient: Test wbcGetGroups
Diffstat (limited to 'nsswitch/libwbclient/tests')
-rw-r--r--nsswitch/libwbclient/tests/wbclient.c15
1 files changed, 15 insertions, 0 deletions
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;
}