Skip to content

Commit 3b7974f

Browse files
author
Dave Sims
committed
Test searching domain controllers with differen subdomains
1 parent 6078bdf commit 3b7974f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/forest_search_test.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,28 @@ def test_does_not_search_from_different_rootdn
9292
assert_equal results, ["entry1"]
9393
end
9494

95+
def test_searches_domain_controllers_from_differet_domains
96+
server1 = {:ncname => ["DC=ghe,DC=local"], :dnsroot => ["ghe.local"]}
97+
server2 = {:ncname => ["DC=ad,DC=ghe,DC=local"], :dnsroot => ["ad.ghe.local"]}
98+
server3 = {:ncname => ["DC=eng,DC=ad,DC=ghe,DC=local"], :dnsroot => ["eng.ad.ghe.local"]}
99+
mock_domains = [server1,server2,server3]
100+
101+
mock_domain_controller = Object.new
102+
@connection.expects(:search).returns(mock_domains)
103+
104+
mock_dc_connection1 = Object.new
105+
mock_dc_connection2 = Object.new
106+
mock_dc_connection3 = Object.new
107+
108+
Net::LDAP.expects(:new).returns(mock_dc_connection1)
109+
Net::LDAP.expects(:new).returns(mock_dc_connection2)
110+
Net::LDAP.expects(:new).returns(mock_dc_connection3)
111+
112+
mock_dc_connection1.expects(:search).once
113+
mock_dc_connection2.expects(:search).once
114+
mock_dc_connection3.expects(:search).once
115+
116+
base = "CN=user1,CN=Users,DC=eng,DC=ad,DC=ghe,DC=local"
117+
@forest_search.search({:base => base})
118+
end
95119
end

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy