s4-smbtorture: test wbcResolveWinsByName/wbcResolveWinsByIP in WINBIND-WBCLIENT tests...
authorGünther Deschner <gd@samba.org>
Fri, 22 Jan 2010 15:27:39 +0000 (16:27 +0100)
committerGünther Deschner <gd@samba.org>
Mon, 25 Jan 2010 10:20:06 +0000 (11:20 +0100)
Guenther

nsswitch/libwbclient/tests/wbclient.c

index e0b436962e04bd9d5e9d6678ddf86de9bf3ddc6b..9e4c348cb66b0b1c6a57fef259ad7ade2e5f44a2 100644 (file)
@@ -314,6 +314,39 @@ static bool test_wbc_lookupdcex(struct torture_context *tctx)
        return true;
 }
 
        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)
 {
 
 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, "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;
 }
 
        return suite;
 }