summaryrefslogtreecommitdiff
path: root/nsswitch/libwbclient/tests
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-10-16 13:39:24 +0200
committerGünther Deschner <gd@samba.org>2009-10-19 18:44:51 +0200
commit71cfbf958cbb26dcc050bab9fd05b38556128d4f (patch)
treee1d7bb499488ee7100a2d80c24abb1c0992a9bd3 /nsswitch/libwbclient/tests
parentdbd03997e1af1e659507b1142f29d0463e8ad295 (diff)
downloadsamba-71cfbf958cbb26dcc050bab9fd05b38556128d4f.tar.gz
samba-71cfbf958cbb26dcc050bab9fd05b38556128d4f.tar.bz2
samba-71cfbf958cbb26dcc050bab9fd05b38556128d4f.zip
s4-smbtorture: test wbcLookupDomainController{Ex} in WINBIND-WBCLIENT.
Guenther
Diffstat (limited to 'nsswitch/libwbclient/tests')
-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 5a55a43ceb..23fad63025 100644
--- a/nsswitch/libwbclient/tests/wbclient.c
+++ b/nsswitch/libwbclient/tests/wbclient.c
@@ -268,6 +268,41 @@ static bool test_wbc_trusts(struct torture_context *tctx)
return true;
}
+static bool test_wbc_lookupdc(struct torture_context *tctx)
+{
+ const char *domain_name = NULL;
+ struct wbcInterfaceDetails *details;
+ struct wbcDomainControllerInfo *dc_info;
+
+ torture_assert_wbc_ok(tctx, wbcInterfaceDetails(&details),
+ "wbcInterfaceDetails failed");
+
+ domain_name = talloc_strdup(tctx, details->netbios_domain);
+ wbcFreeMemory(details);
+
+ torture_assert_wbc_ok(tctx, wbcLookupDomainController(domain_name, 0, &dc_info),
+ "wbcLookupDomainController failed");
+
+ return true;
+}
+
+static bool test_wbc_lookupdcex(struct torture_context *tctx)
+{
+ const char *domain_name = NULL;
+ struct wbcInterfaceDetails *details;
+ struct wbcDomainControllerInfoEx *dc_info;
+
+ torture_assert_wbc_ok(tctx, wbcInterfaceDetails(&details),
+ "wbcInterfaceDetails failed");
+
+ domain_name = talloc_strdup(tctx, details->netbios_domain);
+ wbcFreeMemory(details);
+
+ torture_assert_wbc_ok(tctx, wbcLookupDomainControllerEx(domain_name, NULL, NULL, 0, &dc_info),
+ "wbcLookupDomainControllerEx failed");
+
+ return true;
+}
struct torture_suite *torture_wbclient(void)
@@ -284,6 +319,8 @@ struct torture_suite *torture_wbclient(void)
torture_suite_add_simple_test(suite, "wbcListUsers", test_wbc_users);
torture_suite_add_simple_test(suite, "wbcListGroups", test_wbc_groups);
torture_suite_add_simple_test(suite, "wbcListTrusts", test_wbc_trusts);
+ torture_suite_add_simple_test(suite, "wbcLookupDomainController", test_wbc_lookupdc);
+ torture_suite_add_simple_test(suite, "wbcLookupDomainControllerEx", test_wbc_lookupdcex);
return suite;
}