summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-04-10 15:53:07 +0200
committerVolker Lendecke <vl@samba.org>2010-04-19 14:27:17 +0200
commit9e353a917bd2aca572ac8c249dd4690ab2de94fd (patch)
treedda4a66016f511861d42c8cea3dac9e728f90caf
parent4f5100bcb2d720351d7ba1cc721e234236e69ea3 (diff)
downloadsamba-9e353a917bd2aca572ac8c249dd4690ab2de94fd.tar.gz
samba-9e353a917bd2aca572ac8c249dd4690ab2de94fd.tar.bz2
samba-9e353a917bd2aca572ac8c249dd4690ab2de94fd.zip
libwbclient: Test wbcGetSidAliases
-rw-r--r--nsswitch/libwbclient/tests/wbclient.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/nsswitch/libwbclient/tests/wbclient.c b/nsswitch/libwbclient/tests/wbclient.c
index f998746c41..9fc1a162b1 100644
--- a/nsswitch/libwbclient/tests/wbclient.c
+++ b/nsswitch/libwbclient/tests/wbclient.c
@@ -488,6 +488,41 @@ static bool test_wbc_lookup_rids(struct torture_context *tctx)
return true;
}
+static bool test_wbc_get_sidaliases(struct torture_context *tctx)
+{
+ struct wbcDomainSid builtin;
+ struct wbcDomainInfo *info;
+ struct wbcInterfaceDetails *details;
+ struct wbcDomainSid sids[2];
+ uint32_t *rids;
+ uint32_t num_rids;
+ wbcErr ret;
+
+ torture_assert_wbc_ok(tctx, wbcInterfaceDetails(&details),
+ "wbcInterfaceDetails failed");
+ torture_assert_wbc_ok(
+ tctx, wbcDomainInfo(details->netbios_domain, &info),
+ "wbcDomainInfo failed");
+ wbcFreeMemory(details);
+
+ sids[0] = info->sid;
+ sids[0].sub_auths[sids[0].num_auths++] = 500;
+ sids[1] = info->sid;
+ sids[1].sub_auths[sids[1].num_auths++] = 512;
+ wbcFreeMemory(info);
+
+ torture_assert_wbc_ok(
+ tctx, wbcStringToSid("S-1-5-32", &builtin),
+ "wbcStringToSid failed");
+
+ ret = wbcGetSidAliases(&builtin, sids, 2, &rids, &num_rids);
+ torture_assert_wbc_ok(tctx, ret, "wbcGetSidAliases failed");
+
+ wbcFreeMemory(rids);
+
+ return true;
+}
+
struct torture_suite *torture_wbclient(void)
{
struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "WBCLIENT");
@@ -511,6 +546,8 @@ struct torture_suite *torture_wbclient(void)
torture_suite_add_simple_test(suite, "wbcResolveWinsByIP", test_wbc_resolve_winsbyip);
torture_suite_add_simple_test(suite, "wbcLookupRids",
test_wbc_lookup_rids);
+ torture_suite_add_simple_test(suite, "wbcGetSidAliases",
+ test_wbc_get_sidaliases);
return suite;
}