diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-12-10 14:02:18 +0000 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2014-12-19 13:15:12 +0100 |
commit | f80f585d959b03a41434e48ffa31cac842a76ade (patch) | |
tree | 7dc167500960abbba5bd7c8082104cd7de08af74 /nsswitch/libwbclient/tests | |
parent | a44e8a3249f644accc0c115ba0d2e305e3b69f10 (diff) | |
download | samba-f80f585d959b03a41434e48ffa31cac842a76ade.tar.gz |
nsswitch: allow passing the domain name to wbcPingDC[2]()
winbindd already supports this.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'nsswitch/libwbclient/tests')
-rw-r--r-- | nsswitch/libwbclient/tests/wbclient.c | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/nsswitch/libwbclient/tests/wbclient.c b/nsswitch/libwbclient/tests/wbclient.c index f40ce52dbee..5bce0aead88 100644 --- a/nsswitch/libwbclient/tests/wbclient.c +++ b/nsswitch/libwbclient/tests/wbclient.c @@ -57,24 +57,60 @@ static bool test_wbc_ping(struct torture_context *tctx) static bool test_wbc_pingdc(struct torture_context *tctx) { - torture_assert_wbc_equal(tctx, wbcPingDc("random_string", NULL), WBC_ERR_NOT_IMPLEMENTED, + struct wbcInterfaceDetails *details; + + torture_assert_wbc_equal(tctx, wbcPingDc("random_string", NULL), WBC_ERR_DOMAIN_NOT_FOUND, "%s", "wbcPingDc failed"); torture_assert_wbc_ok(tctx, wbcPingDc(NULL, NULL), "%s", "wbcPingDc failed"); + torture_assert_wbc_ok(tctx, wbcInterfaceDetails(&details), + "%s", "wbcInterfaceDetails failed"); + torture_assert(tctx, details, + "wbcInterfaceDetails returned NULL pointer"); + torture_assert(tctx, details->netbios_domain, + "wbcInterfaceDetails returned NULL netbios_domain"); + + torture_assert_wbc_ok(tctx, wbcPingDc(details->netbios_domain, NULL), + "wbcPingDc(%s) failed", details->netbios_domain); + + torture_assert_wbc_ok(tctx, wbcPingDc("BUILTIN", NULL), + "%s", "wbcPingDc(BUILTIN) failed"); + + wbcFreeMemory(details); return true; } static bool test_wbc_pingdc2(struct torture_context *tctx) { + struct wbcInterfaceDetails *details; char *name = NULL; torture_assert_wbc_equal(tctx, wbcPingDc2("random_string", NULL, &name), - WBC_ERR_NOT_IMPLEMENTED, "%s", + WBC_ERR_DOMAIN_NOT_FOUND, "%s", "wbcPingDc2 failed"); torture_assert_wbc_ok(tctx, wbcPingDc2(NULL, NULL, &name), "%s", "wbcPingDc2 failed"); + wbcFreeMemory(name); + + torture_assert_wbc_ok(tctx, wbcInterfaceDetails(&details), + "%s", "wbcInterfaceDetails failed"); + torture_assert(tctx, details, + "wbcInterfaceDetails returned NULL pointer"); + torture_assert(tctx, details->netbios_domain, + "wbcInterfaceDetails returned NULL netbios_domain"); + + torture_assert_wbc_ok(tctx, wbcPingDc2(details->netbios_domain, NULL, &name), + "wbcPingDc2(%s) failed", details->netbios_domain); + wbcFreeMemory(name); + + torture_assert_wbc_ok(tctx, wbcPingDc2("BUILTIN", NULL, &name), + "%s", "wbcPingDc2(BUILTIN) failed"); + wbcFreeMemory(name); + + wbcFreeMemory(details); + return true; } |