net-ldap 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of net-ldap might be problematic. Click here for more details.
- data/COPYING +272 -0
- data/History.txt +96 -0
- data/LICENSE +55 -0
- data/Manifest.txt +30 -0
- data/README.txt +62 -0
- data/Rakefile +18 -0
- data/Release-Announcement +95 -0
- data/lib/net/ber.rb +557 -0
- data/lib/net/ldap.rb +1613 -0
- data/lib/net/ldap/dataset.rb +108 -0
- data/lib/net/ldap/entry.rb +269 -0
- data/lib/net/ldap/filter.rb +499 -0
- data/lib/net/ldap/pdu.rb +258 -0
- data/lib/net/ldap/psw.rb +64 -0
- data/lib/net/ldif.rb +39 -0
- data/lib/net/snmp.rb +297 -0
- data/pre-setup.rb +45 -0
- data/setup.rb +1366 -0
- data/test/common.rb +7 -0
- data/test/test_ber.rb +100 -0
- data/test/test_entry.rb +7 -0
- data/test/test_filter.rb +83 -0
- data/test/test_ldif.rb +59 -0
- data/test/test_password.rb +17 -0
- data/test/test_snmp.rb +130 -0
- data/test/testdata.ldif +101 -0
- data/tests/NOTICE.txt +6 -0
- data/tests/testldap.rb +190 -0
- data/testserver/ldapserver.rb +229 -0
- data/testserver/testdata.ldif +101 -0
- metadata +105 -0
data/test/common.rb
ADDED
data/test/test_ber.rb
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
# $Id: testber.rb 230 2006-12-19 18:27:57Z blackhedd $
|
2
|
+
|
3
|
+
require 'common'
|
4
|
+
|
5
|
+
class TestBer < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def test_encode_boolean
|
8
|
+
assert_equal( "\x01\x01\x01", true.to_ber ) # should actually be: 01 01 ff
|
9
|
+
assert_equal( "\x01\x01\x00", false.to_ber )
|
10
|
+
end
|
11
|
+
|
12
|
+
#def test_encode_nil
|
13
|
+
# assert_equal( "\x05\x00", nil.to_ber )
|
14
|
+
#end
|
15
|
+
|
16
|
+
def test_encode_integer
|
17
|
+
|
18
|
+
# Fixnum
|
19
|
+
#
|
20
|
+
#assert_equal( "\x02\x02\x96\x46", -27_066.to_ber )
|
21
|
+
#assert_equal( "\x02\x02\xFF\x7F", -129.to_ber )
|
22
|
+
#assert_equal( "\x02\x01\x80", -128.to_ber )
|
23
|
+
#assert_equal( "\x02\x01\xFF", -1.to_ber )
|
24
|
+
|
25
|
+
assert_equal( "\x02\x01\x00", 0.to_ber )
|
26
|
+
assert_equal( "\x02\x01\x01", 1.to_ber )
|
27
|
+
assert_equal( "\x02\x01\x7F", 127.to_ber )
|
28
|
+
assert_equal( "\x02\x02\x00\x80", 128.to_ber )
|
29
|
+
assert_equal( "\x02\x02\x00\xFF", 255.to_ber )
|
30
|
+
|
31
|
+
assert_equal( "\x02\x02\x01\x00", 256.to_ber )
|
32
|
+
assert_equal( "\x02\x03\x00\xFF\xFF", 65535.to_ber )
|
33
|
+
|
34
|
+
assert_equal( "\x02\x03\x01\x00\x00", 65536.to_ber )
|
35
|
+
assert_equal( "\x02\x04\x00\xFF\xFF\xFF", 16_777_215.to_ber )
|
36
|
+
|
37
|
+
assert_equal( "\x02\x04\x01\x00\x00\x00", 0x01000000.to_ber )
|
38
|
+
assert_equal( "\x02\x04\x3F\xFF\xFF\xFF", 0x3FFFFFFF.to_ber )
|
39
|
+
|
40
|
+
# Bignum
|
41
|
+
#
|
42
|
+
assert_equal( "\x02\x04\x4F\xFF\xFF\xFF", 0x4FFFFFFF.to_ber )
|
43
|
+
#assert_equal( "\x02\x05\x00\xFF\xFF\xFF\xFF", 0xFFFFFFFF.to_ber )
|
44
|
+
end
|
45
|
+
|
46
|
+
# TOD Add some much bigger numbers
|
47
|
+
# 5000000000 is a Bignum, which hits different code.
|
48
|
+
def test_ber_integers
|
49
|
+
assert_equal( "\002\001\005", 5.to_ber )
|
50
|
+
assert_equal( "\002\002\001\364", 500.to_ber )
|
51
|
+
assert_equal( "\002\003\0\303P", 50000.to_ber )
|
52
|
+
assert_equal( "\002\005\001*\005\362\000", 5000000000.to_ber )
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_ber_bignums
|
56
|
+
# Some of these values are Fixnums and some are Bignums. Different BER code.
|
57
|
+
[
|
58
|
+
5,
|
59
|
+
50,
|
60
|
+
500,
|
61
|
+
5000,
|
62
|
+
50000,
|
63
|
+
500000,
|
64
|
+
5000000,
|
65
|
+
50000000,
|
66
|
+
500000000,
|
67
|
+
1000000000,
|
68
|
+
2000000000,
|
69
|
+
3000000000,
|
70
|
+
4000000000,
|
71
|
+
5000000000
|
72
|
+
].each {|val|
|
73
|
+
assert_equal( val, val.to_ber.read_ber )
|
74
|
+
}
|
75
|
+
end
|
76
|
+
|
77
|
+
def test_ber_parsing
|
78
|
+
assert_equal( 6, "\002\001\006".read_ber( Net::LDAP::AsnSyntax ))
|
79
|
+
assert_equal( "testing", "\004\007testing".read_ber( Net::LDAP::AsnSyntax ))
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_ber_parser_on_ldap_bind_request
|
83
|
+
require 'stringio'
|
84
|
+
|
85
|
+
s = StringIO.new(
|
86
|
+
"0$\002\001\001`\037\002\001\003\004\rAdministrator\200\vad_is_bogus" )
|
87
|
+
|
88
|
+
assert_equal(
|
89
|
+
[1, [3, "Administrator", "ad_is_bogus"]],
|
90
|
+
s.read_ber( Net::LDAP::AsnSyntax ))
|
91
|
+
end
|
92
|
+
|
93
|
+
def test_oid
|
94
|
+
oid = Net::BER::BerIdentifiedOid.new( [1,3,6,1,2,1,1,1,0] )
|
95
|
+
assert_equal( "\006\b+\006\001\002\001\001\001\000", oid.to_ber )
|
96
|
+
|
97
|
+
oid = Net::BER::BerIdentifiedOid.new( "1.3.6.1.2.1.1.1.0" )
|
98
|
+
assert_equal( "\006\b+\006\001\002\001\001\001\000", oid.to_ber )
|
99
|
+
end
|
100
|
+
end
|
data/test/test_entry.rb
ADDED
data/test/test_filter.rb
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
# $Id: testfilter.rb 245 2007-05-05 02:44:32Z blackhedd $
|
2
|
+
|
3
|
+
require 'common'
|
4
|
+
|
5
|
+
class TestFilter < Test::Unit::TestCase
|
6
|
+
|
7
|
+
# Note that the RFC doesn't define either less-than or greater-than.
|
8
|
+
def test_rfc_2254
|
9
|
+
Net::LDAP::Filter.from_rfc2254( " ( uid=george* ) " )
|
10
|
+
Net::LDAP::Filter.from_rfc2254( "uid!=george*" )
|
11
|
+
Net::LDAP::Filter.from_rfc2254( "uid <= george*" )
|
12
|
+
Net::LDAP::Filter.from_rfc2254( "uid>=george*" )
|
13
|
+
Net::LDAP::Filter.from_rfc2254( "uid!=george*" )
|
14
|
+
|
15
|
+
Net::LDAP::Filter.from_rfc2254( "(& (uid!=george* ) (mail=*))" )
|
16
|
+
Net::LDAP::Filter.from_rfc2254( "(| (uid!=george* ) (mail=*))" )
|
17
|
+
Net::LDAP::Filter.from_rfc2254( "(! (mail=*))" )
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_filters_from_ber
|
21
|
+
[
|
22
|
+
Net::LDAP::Filter.eq( "objectclass", "*" ),
|
23
|
+
Net::LDAP::Filter.pres( "objectclass" ),
|
24
|
+
Net::LDAP::Filter.eq( "objectclass", "ou" ),
|
25
|
+
Net::LDAP::Filter.ge( "uid", "500" ),
|
26
|
+
Net::LDAP::Filter.le( "uid", "500" ),
|
27
|
+
(~ Net::LDAP::Filter.pres( "objectclass" )),
|
28
|
+
(Net::LDAP::Filter.pres( "objectclass" ) & Net::LDAP::Filter.pres( "ou" )),
|
29
|
+
(Net::LDAP::Filter.pres( "objectclass" ) & Net::LDAP::Filter.pres( "ou" ) & Net::LDAP::Filter.pres("sn")),
|
30
|
+
(Net::LDAP::Filter.pres( "objectclass" ) | Net::LDAP::Filter.pres( "ou" ) | Net::LDAP::Filter.pres("sn")),
|
31
|
+
|
32
|
+
Net::LDAP::Filter.eq( "objectclass", "*aaa" ),
|
33
|
+
Net::LDAP::Filter.eq( "objectclass", "*aaa*bbb" ),
|
34
|
+
Net::LDAP::Filter.eq( "objectclass", "*aaa*bbb*ccc" ),
|
35
|
+
Net::LDAP::Filter.eq( "objectclass", "aaa*bbb" ),
|
36
|
+
Net::LDAP::Filter.eq( "objectclass", "aaa*bbb*ccc" ),
|
37
|
+
Net::LDAP::Filter.eq( "objectclass", "abc*def*1111*22*g" ),
|
38
|
+
Net::LDAP::Filter.eq( "objectclass", "*aaa*" ),
|
39
|
+
Net::LDAP::Filter.eq( "objectclass", "*aaa*bbb*" ),
|
40
|
+
Net::LDAP::Filter.eq( "objectclass", "*aaa*bbb*ccc*" ),
|
41
|
+
Net::LDAP::Filter.eq( "objectclass", "aaa*" ),
|
42
|
+
Net::LDAP::Filter.eq( "objectclass", "aaa*bbb*" ),
|
43
|
+
Net::LDAP::Filter.eq( "objectclass", "aaa*bbb*ccc*" ),
|
44
|
+
].each {|ber|
|
45
|
+
f = Net::LDAP::Filter.parse_ber( ber.to_ber.read_ber( Net::LDAP::AsnSyntax) )
|
46
|
+
assert( f == ber )
|
47
|
+
assert_equal( f.to_ber, ber.to_ber )
|
48
|
+
}
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_ber_from_rfc2254_filter
|
53
|
+
[
|
54
|
+
Net::LDAP::Filter.construct( "objectclass=*" ),
|
55
|
+
Net::LDAP::Filter.construct("objectclass=ou" ),
|
56
|
+
Net::LDAP::Filter.construct("uid >= 500" ),
|
57
|
+
Net::LDAP::Filter.construct("uid <= 500" ),
|
58
|
+
Net::LDAP::Filter.construct("(!(uid=*))" ),
|
59
|
+
Net::LDAP::Filter.construct("(&(uid=*)(objectclass=*))" ),
|
60
|
+
Net::LDAP::Filter.construct("(&(uid=*)(objectclass=*)(sn=*))" ),
|
61
|
+
Net::LDAP::Filter.construct("(|(uid=*)(objectclass=*))" ),
|
62
|
+
Net::LDAP::Filter.construct("(|(uid=*)(objectclass=*)(sn=*))" ),
|
63
|
+
|
64
|
+
Net::LDAP::Filter.construct("objectclass=*aaa"),
|
65
|
+
Net::LDAP::Filter.construct("objectclass=*aaa*bbb"),
|
66
|
+
Net::LDAP::Filter.construct("objectclass=*aaa*bbb*ccc"),
|
67
|
+
Net::LDAP::Filter.construct("objectclass=aaa*bbb"),
|
68
|
+
Net::LDAP::Filter.construct("objectclass=aaa*bbb*ccc"),
|
69
|
+
Net::LDAP::Filter.construct("objectclass=abc*def*1111*22*g"),
|
70
|
+
Net::LDAP::Filter.construct("objectclass=*aaa*"),
|
71
|
+
Net::LDAP::Filter.construct("objectclass=*aaa*bbb*"),
|
72
|
+
Net::LDAP::Filter.construct("objectclass=*aaa*bbb*ccc*"),
|
73
|
+
Net::LDAP::Filter.construct("objectclass=aaa*"),
|
74
|
+
Net::LDAP::Filter.construct("objectclass=aaa*bbb*"),
|
75
|
+
Net::LDAP::Filter.construct("objectclass=aaa*bbb*ccc*"),
|
76
|
+
].each {|ber|
|
77
|
+
f = Net::LDAP::Filter.parse_ber( ber.to_ber.read_ber( Net::LDAP::AsnSyntax) )
|
78
|
+
assert( f == ber )
|
79
|
+
assert_equal( f.to_ber, ber.to_ber )
|
80
|
+
}
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
data/test/test_ldif.rb
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# $Id: testldif.rb 61 2006-04-18 20:55:55Z blackhedd $
|
2
|
+
|
3
|
+
require 'common'
|
4
|
+
|
5
|
+
require 'net/ldif'
|
6
|
+
require 'digest/sha1'
|
7
|
+
require 'base64'
|
8
|
+
|
9
|
+
class TestLdif < Test::Unit::TestCase
|
10
|
+
|
11
|
+
TestLdifFilename = "#{File.dirname(__FILE__)}/testdata.ldif"
|
12
|
+
|
13
|
+
def test_empty_ldif
|
14
|
+
ds = Net::LDAP::Dataset::read_ldif( StringIO.new )
|
15
|
+
assert_equal( true, ds.empty? )
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_ldif_with_comments
|
19
|
+
str = ["# Hello from LDIF-land", "# This is an unterminated comment"]
|
20
|
+
io = StringIO.new( str[0] + "\r\n" + str[1] )
|
21
|
+
ds = Net::LDAP::Dataset::read_ldif( io )
|
22
|
+
assert_equal( str, ds.comments )
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_ldif_with_password
|
26
|
+
psw = "goldbricks"
|
27
|
+
hashed_psw = "{SHA}" + Base64::encode64(Digest::SHA1.digest(psw)).chomp
|
28
|
+
|
29
|
+
ldif_encoded = Base64::encode64( hashed_psw ).chomp
|
30
|
+
ds = Net::LDAP::Dataset::read_ldif( StringIO.new( "dn: Goldbrick\r\nuserPassword:: #{ldif_encoded}\r\n\r\n" ))
|
31
|
+
recovered_psw = ds["Goldbrick"][:userpassword].shift
|
32
|
+
assert_equal( hashed_psw, recovered_psw )
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_ldif_with_continuation_lines
|
36
|
+
ds = Net::LDAP::Dataset::read_ldif( StringIO.new( "dn: abcdefg\r\n hijklmn\r\n\r\n" ))
|
37
|
+
assert_equal( true, ds.has_key?( "abcdefg hijklmn" ))
|
38
|
+
end
|
39
|
+
|
40
|
+
# TODO, INADEQUATE. We need some more tests
|
41
|
+
# to verify the content.
|
42
|
+
def test_ldif
|
43
|
+
File.open( TestLdifFilename, "r" ) {|f|
|
44
|
+
ds = Net::LDAP::Dataset::read_ldif( f )
|
45
|
+
assert_equal( 13, ds.length )
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
# TODO, need some tests.
|
50
|
+
# Must test folded lines and base64-encoded lines as well as normal ones.
|
51
|
+
#def test_to_ldif
|
52
|
+
# File.open( TestLdifFilename, "r" ) {|f|
|
53
|
+
# ds = Net::LDAP::Dataset::read_ldif( f )
|
54
|
+
# ds.to_ldif
|
55
|
+
# assert_equal( true, false ) # REMOVE WHEN WE HAVE SOME TESTS HERE.
|
56
|
+
# }
|
57
|
+
#end
|
58
|
+
|
59
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# $Id: testpsw.rb 72 2006-04-24 21:58:14Z blackhedd $
|
2
|
+
|
3
|
+
require 'common'
|
4
|
+
|
5
|
+
class TestPassword < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def test_psw
|
8
|
+
assert_equal(
|
9
|
+
"{MD5}xq8jwrcfibi0sZdZYNkSng==",
|
10
|
+
Net::LDAP::Password.generate( :md5, "cashflow" ))
|
11
|
+
|
12
|
+
assert_equal(
|
13
|
+
"{SHA}YE4eGkN4BvwNN1f5R7CZz0kFn14=",
|
14
|
+
Net::LDAP::Password.generate( :sha, "cashflow" ))
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
data/test/test_snmp.rb
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
# $Id: testsnmp.rb 231 2006-12-21 15:09:29Z blackhedd $
|
2
|
+
|
3
|
+
require 'common'
|
4
|
+
require 'net/snmp'
|
5
|
+
|
6
|
+
class TestSnmp < Test::Unit::TestCase
|
7
|
+
|
8
|
+
SnmpGetRequest = "0'\002\001\000\004\006public\240\032\002\002?*\002\001\000\002\001\0000\0160\f\006\b+\006\001\002\001\001\001\000\005\000"
|
9
|
+
SnmpGetResponse = "0+\002\001\000\004\006public\242\036\002\002'\017\002\001\000\002\001\0000\0220\020\006\b+\006\001\002\001\001\001\000\004\004test"
|
10
|
+
|
11
|
+
SnmpGetRequestXXX = "0'\002\001\000\004\006xxxxxx\240\032\002\002?*\002\001\000\002\001\0000\0160\f\006\b+\006\001\002\001\001\001\000\005\000"
|
12
|
+
|
13
|
+
|
14
|
+
def setup
|
15
|
+
end
|
16
|
+
|
17
|
+
def teardown
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_invalid_packet
|
21
|
+
data = "xxxx"
|
22
|
+
assert_raise( Net::BER::BerError ) {
|
23
|
+
ary = data.read_ber(Net::SNMP::AsnSyntax)
|
24
|
+
}
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
# The method String#read_ber! added by Net::BER consumes a well-formed BER object
|
29
|
+
# from the head of a string. If it doesn't find a complete, well-formed BER object,
|
30
|
+
# it returns nil and leaves the string unchanged. If it finds an object, it returns
|
31
|
+
# the object and removes it from the head of the string. This is good for handling
|
32
|
+
# partially-received data streams, such as from network connections.
|
33
|
+
def test_consume_string
|
34
|
+
data = "xxx"
|
35
|
+
assert_equal( nil, data.read_ber! )
|
36
|
+
assert_equal( "xxx", data )
|
37
|
+
|
38
|
+
data = SnmpGetRequest + "!!!"
|
39
|
+
ary = data.read_ber!( Net::SNMP::AsnSyntax )
|
40
|
+
assert_equal( "!!!", data )
|
41
|
+
assert ary.is_a?(Array)
|
42
|
+
assert ary.is_a?(Net::BER::BerIdentifiedArray)
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_weird_packet
|
46
|
+
assert_raise( Net::SnmpPdu::Error ) {
|
47
|
+
Net::SnmpPdu.parse("aaaaaaaaaaaaaa")
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_get_request
|
52
|
+
data = SnmpGetRequest.dup
|
53
|
+
pkt = data.read_ber(Net::SNMP::AsnSyntax)
|
54
|
+
assert pkt.is_a?(Net::BER::BerIdentifiedArray)
|
55
|
+
assert_equal( 48, pkt.ber_identifier) # Constructed [0], signifies GetRequest
|
56
|
+
|
57
|
+
pdu = Net::SnmpPdu.parse(pkt)
|
58
|
+
assert_equal(:get_request, pdu.pdu_type )
|
59
|
+
assert_equal(16170, pdu.request_id ) # whatever was in the test data. 16170 is not magic.
|
60
|
+
assert_equal( [[[1,3,6,1,2,1,1,1,0],nil]], pdu.variables )
|
61
|
+
|
62
|
+
assert_equal( pdu.to_ber_string, SnmpGetRequest )
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_empty_pdu
|
66
|
+
pdu = Net::SnmpPdu.new
|
67
|
+
assert_raise( Net::SnmpPdu::Error ) {
|
68
|
+
pdu.to_ber_string
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_malformations
|
73
|
+
pdu = Net::SnmpPdu.new
|
74
|
+
pdu.version = 0
|
75
|
+
pdu.version = 2
|
76
|
+
assert_raise( Net::SnmpPdu::Error ) {
|
77
|
+
pdu.version = 100
|
78
|
+
}
|
79
|
+
|
80
|
+
pdu.pdu_type = :get_request
|
81
|
+
pdu.pdu_type = :get_next_request
|
82
|
+
pdu.pdu_type = :get_response
|
83
|
+
pdu.pdu_type = :set_request
|
84
|
+
pdu.pdu_type = :trap
|
85
|
+
assert_raise( Net::SnmpPdu::Error ) {
|
86
|
+
pdu.pdu_type = :something_else
|
87
|
+
}
|
88
|
+
end
|
89
|
+
|
90
|
+
def test_make_response
|
91
|
+
pdu = Net::SnmpPdu.new
|
92
|
+
pdu.version = 0
|
93
|
+
pdu.community = "public"
|
94
|
+
pdu.pdu_type = :get_response
|
95
|
+
pdu.request_id = 9999
|
96
|
+
pdu.error_status = 0
|
97
|
+
pdu.error_index = 0
|
98
|
+
pdu.add_variable_binding [1,3,6,1,2,1,1,1,0], "test"
|
99
|
+
|
100
|
+
assert_equal( SnmpGetResponse, pdu.to_ber_string )
|
101
|
+
end
|
102
|
+
|
103
|
+
def test_make_bad_response
|
104
|
+
pdu = Net::SnmpPdu.new
|
105
|
+
assert_raise(Net::SnmpPdu::Error) {pdu.to_ber_string}
|
106
|
+
pdu.pdu_type = :get_response
|
107
|
+
pdu.request_id = 999
|
108
|
+
pdu.to_ber_string
|
109
|
+
# Not specifying variables doesn't create an error. (Maybe it should?)
|
110
|
+
end
|
111
|
+
|
112
|
+
def test_snmp_integers
|
113
|
+
c32 = Net::SNMP::Counter32.new(100)
|
114
|
+
assert_equal( "A\001d", c32.to_ber )
|
115
|
+
g32 = Net::SNMP::Gauge32.new(100)
|
116
|
+
assert_equal( "B\001d", g32.to_ber )
|
117
|
+
t32 = Net::SNMP::TimeTicks32.new(100)
|
118
|
+
assert_equal( "C\001d", t32.to_ber )
|
119
|
+
end
|
120
|
+
|
121
|
+
def test_community
|
122
|
+
data = SnmpGetRequestXXX.dup
|
123
|
+
ary = data.read_ber(Net::SNMP::AsnSyntax)
|
124
|
+
pdu = Net::SnmpPdu.parse( ary )
|
125
|
+
assert_equal( "xxxxxx", pdu.community )
|
126
|
+
end
|
127
|
+
|
128
|
+
end
|
129
|
+
|
130
|
+
|
data/test/testdata.ldif
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
# $Id: testdata.ldif 50 2006-04-17 17:57:33Z blackhedd $
|
2
|
+
#
|
3
|
+
# This is test-data for an LDAP server in LDIF format.
|
4
|
+
#
|
5
|
+
dn: dc=bayshorenetworks,dc=com
|
6
|
+
objectClass: dcObject
|
7
|
+
objectClass: organization
|
8
|
+
o: Bayshore Networks LLC
|
9
|
+
dc: bayshorenetworks
|
10
|
+
|
11
|
+
dn: cn=Manager,dc=bayshorenetworks,dc=com
|
12
|
+
objectClass: organizationalrole
|
13
|
+
cn: Manager
|
14
|
+
|
15
|
+
dn: ou=people,dc=bayshorenetworks,dc=com
|
16
|
+
objectClass: organizationalunit
|
17
|
+
ou: people
|
18
|
+
|
19
|
+
dn: ou=privileges,dc=bayshorenetworks,dc=com
|
20
|
+
objectClass: organizationalunit
|
21
|
+
ou: privileges
|
22
|
+
|
23
|
+
dn: ou=roles,dc=bayshorenetworks,dc=com
|
24
|
+
objectClass: organizationalunit
|
25
|
+
ou: roles
|
26
|
+
|
27
|
+
dn: ou=office,dc=bayshorenetworks,dc=com
|
28
|
+
objectClass: organizationalunit
|
29
|
+
ou: office
|
30
|
+
|
31
|
+
dn: mail=nogoodnik@steamheat.net,ou=people,dc=bayshorenetworks,dc=com
|
32
|
+
cn: Bob Fosse
|
33
|
+
mail: nogoodnik@steamheat.net
|
34
|
+
sn: Fosse
|
35
|
+
ou: people
|
36
|
+
objectClass: top
|
37
|
+
objectClass: inetorgperson
|
38
|
+
objectClass: authorizedperson
|
39
|
+
hasAccessRole: uniqueIdentifier=engineer,ou=roles
|
40
|
+
hasAccessRole: uniqueIdentifier=ldapadmin,ou=roles
|
41
|
+
hasAccessRole: uniqueIdentifier=ldapsuperadmin,ou=roles
|
42
|
+
hasAccessRole: uniqueIdentifier=ogilvy_elephant_user,ou=roles
|
43
|
+
hasAccessRole: uniqueIdentifier=ogilvy_eagle_user,ou=roles
|
44
|
+
hasAccessRole: uniqueIdentifier=greenplug_user,ou=roles
|
45
|
+
hasAccessRole: uniqueIdentifier=brandplace_logging_user,ou=roles
|
46
|
+
hasAccessRole: uniqueIdentifier=brandplace_report_user,ou=roles
|
47
|
+
hasAccessRole: uniqueIdentifier=workorder_user,ou=roles
|
48
|
+
hasAccessRole: uniqueIdentifier=bayshore_eagle_user,ou=roles
|
49
|
+
hasAccessRole: uniqueIdentifier=bayshore_eagle_superuser,ou=roles
|
50
|
+
hasAccessRole: uniqueIdentifier=kledaras_user,ou=roles
|
51
|
+
|
52
|
+
dn: mail=elephant@steamheat.net,ou=people,dc=bayshorenetworks,dc=com
|
53
|
+
cn: Gwen Verdon
|
54
|
+
mail: elephant@steamheat.net
|
55
|
+
sn: Verdon
|
56
|
+
ou: people
|
57
|
+
objectClass: top
|
58
|
+
objectClass: inetorgperson
|
59
|
+
objectClass: authorizedperson
|
60
|
+
hasAccessRole: uniqueIdentifier=brandplace_report_user,ou=roles
|
61
|
+
hasAccessRole: uniqueIdentifier=engineer,ou=roles
|
62
|
+
hasAccessRole: uniqueIdentifier=ogilvy_elephant_user,ou=roles
|
63
|
+
hasAccessRole: uniqueIdentifier=ldapsuperadmin,ou=roles
|
64
|
+
hasAccessRole: uniqueIdentifier=ldapadmin,ou=roles
|
65
|
+
|
66
|
+
dn: uniqueIdentifier=engineering,ou=privileges,dc=bayshorenetworks,dc=com
|
67
|
+
uniqueIdentifier: engineering
|
68
|
+
ou: privileges
|
69
|
+
objectClass: accessPrivilege
|
70
|
+
|
71
|
+
dn: uniqueIdentifier=engineer,ou=roles,dc=bayshorenetworks,dc=com
|
72
|
+
uniqueIdentifier: engineer
|
73
|
+
ou: roles
|
74
|
+
objectClass: accessRole
|
75
|
+
hasAccessPrivilege: uniqueIdentifier=engineering,ou=privileges
|
76
|
+
|
77
|
+
dn: uniqueIdentifier=ldapadmin,ou=roles,dc=bayshorenetworks,dc=com
|
78
|
+
uniqueIdentifier: ldapadmin
|
79
|
+
ou: roles
|
80
|
+
objectClass: accessRole
|
81
|
+
|
82
|
+
dn: uniqueIdentifier=ldapsuperadmin,ou=roles,dc=bayshorenetworks,dc=com
|
83
|
+
uniqueIdentifier: ldapsuperadmin
|
84
|
+
ou: roles
|
85
|
+
objectClass: accessRole
|
86
|
+
|
87
|
+
dn: mail=catperson@steamheat.net,ou=people,dc=bayshorenetworks,dc=com
|
88
|
+
cn: Sid Sorokin
|
89
|
+
mail: catperson@steamheat.net
|
90
|
+
sn: Sorokin
|
91
|
+
ou: people
|
92
|
+
objectClass: top
|
93
|
+
objectClass: inetorgperson
|
94
|
+
objectClass: authorizedperson
|
95
|
+
hasAccessRole: uniqueIdentifier=engineer,ou=roles
|
96
|
+
hasAccessRole: uniqueIdentifier=ogilvy_elephant_user,ou=roles
|
97
|
+
hasAccessRole: uniqueIdentifier=ldapsuperadmin,ou=roles
|
98
|
+
hasAccessRole: uniqueIdentifier=ogilvy_eagle_user,ou=roles
|
99
|
+
hasAccessRole: uniqueIdentifier=greenplug_user,ou=roles
|
100
|
+
hasAccessRole: uniqueIdentifier=workorder_user,ou=roles
|
101
|
+
|