summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-01-22 16:27:39 +0100
committerGünther Deschner <gd@samba.org>2010-01-25 11:20:06 +0100
commitb5d47263162856c423f484df44914271b76b1e53 (patch)
tree0606c1e725b1c3f7347b554895dcd9897504a6d6
parente16e75a4f0e8887b1cce35384d1157743270439e (diff)
downloadsamba-b5d47263162856c423f484df44914271b76b1e53.tar.gz
samba-b5d47263162856c423f484df44914271b76b1e53.tar.bz2
samba-b5d47263162856c423f484df44914271b76b1e53.zip
s4-smbtorture: test wbcResolveWinsByName/wbcResolveWinsByIP in WINBIND-WBCLIENT testsuite.
Guenther
-rw-r--r--nsswitch/libwbclient/tests/wbclient.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/nsswitch/libwbclient/tests/wbclient.c b/nsswitch/libwbclient/tests/wbclient.c
index e0b436962e..9e4c348cb6 100644
--- a/nsswitch/libwbclient/tests/wbclient.c
+++ b/nsswitch/libwbclient/tests/wbclient.c
@@ -314,6 +314,39 @@ static bool test_wbc_lookupdcex(struct torture_context *tctx)
return true;
}
+static bool test_wbc_resolve_winsbyname(struct torture_context *tctx)
+{
+ const char *name;
+ char *ip;
+ wbcErr ret;
+
+ name = torture_setting_string(tctx, "host", NULL);
+
+ ret = wbcResolveWinsByName(name, &ip);
+
+ if (is_ipaddress(name)) {
+ torture_assert_wbc_equal(tctx, ret, WBC_ERR_DOMAIN_NOT_FOUND, "wbcResolveWinsByName failed");
+ } else {
+ torture_assert_wbc_ok(tctx, ret, "wbcResolveWinsByName failed");
+ }
+
+ return true;
+}
+
+static bool test_wbc_resolve_winsbyip(struct torture_context *tctx)
+{
+ const char *ip;
+ char *name;
+ wbcErr ret;
+
+ ip = torture_setting_string(tctx, "host", NULL);
+
+ ret = wbcResolveWinsByIP(ip, &name);
+
+ torture_assert_wbc_ok(tctx, ret, "wbcResolveWinsByIP failed");
+
+ return true;
+}
struct torture_suite *torture_wbclient(void)
{
@@ -332,6 +365,8 @@ struct torture_suite *torture_wbclient(void)
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);
+ torture_suite_add_simple_test(suite, "wbcResolveWinsByName", test_wbc_resolve_winsbyname);
+ torture_suite_add_simple_test(suite, "wbcResolveWinsByIP", test_wbc_resolve_winsbyip);
return suite;
}