dnsruby 1.40 → 1.41

Sign up to get free protection for your applications and to get access to all the features.
data/test/tc_resolver.rb CHANGED
@@ -147,14 +147,14 @@ class TestResolver < Test::Unit::TestCase
147
147
  rescue ResolvTimeout
148
148
  stop=Time.now
149
149
  time = stop-start
150
- assert(time <= expected *1.2 && time >= expected *0.9, "Wrong time take, expected #{expected}, took #{time}")
150
+ assert(time <= expected *1.3 && time >= expected *0.9, "Wrong time take, expected #{expected}, took #{time}")
151
151
  end
152
152
  end
153
153
  end
154
154
 
155
155
  def test_packet_timeout
156
- if (!RUBY_PLATFORM=~/darwin/)
157
- res = Resolver.new({:nameserver => "10.0.1.128"})
156
+ res = Resolver.new({:nameserver => []})
157
+ # res = Resolver.new({:nameserver => "10.0.1.128"})
158
158
  start=stop=0
159
159
  retry_times = retry_delay = packet_timeout= 10
160
160
  query_timeout=2
@@ -171,13 +171,12 @@ class TestResolver < Test::Unit::TestCase
171
171
  rescue ResolvTimeout
172
172
  stop=Time.now
173
173
  time = stop-start
174
- assert(time <= expected *1.1 && time >= expected *0.9, "Wrong time take, expected #{expected}, took #{time}")
174
+ assert(time <= expected *1.3 && time >= expected *0.9, "Wrong time take, expected #{expected}, took #{time}")
175
175
  end #
176
176
  end
177
- end
178
177
 
179
178
  def test_queue_packet_timeout
180
- if (!RUBY_PLATFORM=~/darwin/)
179
+ # if (!RUBY_PLATFORM=~/darwin/)
181
180
  res = Resolver.new({:nameserver => "10.0.1.128"})
182
181
  # bad = SingleResolver.new("localhost")
183
182
  res.add_server("localhost")
@@ -192,8 +191,8 @@ class TestResolver < Test::Unit::TestCase
192
191
  assert(ret==nil)
193
192
  assert(err.class == ResolvTimeout, "#{err.class}, #{err}")
194
193
  time = stop-start
195
- assert(time <= expected *1.2 && time >= expected *0.9, "Wrong time take, expected #{expected}, took #{time}")
196
- end
194
+ assert(time <= expected *1.3 && time >= expected *0.9, "Wrong time take, expected #{expected}, took #{time}")
195
+ # end
197
196
  end
198
197
 
199
198
  def test_illegal_src_port
data/test/tc_rr.rb CHANGED
@@ -241,7 +241,7 @@ class TestRR < Test::Unit::TestCase
241
241
 
242
242
  assert(rr, "#{type} - RR defined");
243
243
  assert_equal(name, rr.name.to_s, "#{type} - name() correct");
244
- assert_equal(klass, Classes.to_string(rr.class::ClassValue), "#{type} - class() correct");
244
+ assert_equal(klass, rr.klass.to_s, "#{type} - class() correct");
245
245
  assert_equal(ttl, rr.ttl, "#{type} - ttl() correct");
246
246
 
247
247
  # foreach my $meth (keys %{data}) {
data/test/tc_rrsig.rb CHANGED
@@ -46,6 +46,11 @@ class RrsigTest < Test::Unit::TestCase
46
46
  assert(rrsig2.to_s == rrsig.to_s)
47
47
  end
48
48
 
49
+ def test_unknown_types
50
+ rr = Dnsruby::RR.create("a.unknown.rr.org. 16070400 IN RRSIG TYPE731 7 4 16070400 20110220190432 20091112142325 59079 unknown.rr.org. a/iqriTleD/pkiXhH2HunBzbJ113JliHu8MrN30hwR5U8uR+FQ9UwoyqFVKmMFvhr66Q+Bn2leJhszJVLHM0GZpEP3yU9Kiux5z2sWxdNZY1phuVfe7vQhzPCG9a/gaNtOd/p42OaQRIvDpdp7Ey4m+2Lq/PfovuAa8jl1HBBSxYbt2sZ4Qh9IrP7qkabGzuF3iK8Kf+QTV+ty9enMRhv2zbGVJv0/KjfeOmLBpDnLxDtNN23ObqO2y31Ci434bWYbHRZJMofUWw/0cJHdw4qlnfraLHiXQSW/tT71mS/7CgHJcSZ89hdDFv8drAy/8py0MLT9nLrsvzH5F/knU/oA== ;{id = 59079}")
51
+ assert(rr.type_covered == Dnsruby::Types.TYPE731)
52
+ end
53
+
49
54
  def test_string_with_comments
50
55
  r = Dnsruby::RR.create("tjeb.nl. 3600 IN RRSIG NSEC3PARAM 7 2 3600 20090630164649 20090602164649 53177 tjeb.nl. Fw70WQMviRFGyeze3MUpfafaAcWIvHRpnq4ZK3lxexrR1p+rLxK5C4qVKU71XYrPYR7XEBxgUG1oyKNOhFOVyx31EjC462dz7Vxn6UDpD1LIwNnD28+oHfS9AFzGKcn4zUZqT+8IvOO1jiS9c3Y8WAkOloN9AwGIIKWU8zAp1n4= ;{id = 53177}")
51
56
  assert_equal("Fw70WQMviRFGyeze3MUpfafaAcWIvHRpnq4ZK3lxexrR1p+rLxK5C4qVKU71XYrPYR7XEBxgUG1oyKNOhFOVyx31EjC462dz7Vxn6UDpD1LIwNnD28+oHfS9AFzGKcn4zUZqT+8IvOO1jiS9c3Y8WAkOloN9AwGIIKWU8zAp1n4=", ([r.signature].pack("m*")).gsub(/\n/,"").chomp)
data/test/tc_update.rb CHANGED
@@ -31,7 +31,7 @@ class TestUpdate < Test::Unit::TestCase
31
31
 
32
32
  zone = "example.com";
33
33
  name = "foo.example.com";
34
- klass = "HS";
34
+ klass = Classes.CLASS32;
35
35
  klass2 = Classes.CH;
36
36
  type = Types.A;
37
37
  ttl = 43200;
@@ -48,7 +48,7 @@ class TestUpdate < Test::Unit::TestCase
48
48
  assert(update, 'new() returned packet'); #2
49
49
  assert_equal(update.header.opcode, OpCode.UPDATE, 'header opcode correct'); #3
50
50
  assert_equal(z.zname.to_s, zone, 'zname correct'); #4
51
- assert_equal(z.zclass.to_s, klass, 'zclass correct'); #5
51
+ assert_equal(z.zclass.to_s, klass.to_s, 'zclass correct'); #5
52
52
  assert_equal(z.ztype, Types.SOA, 'ztype correct'); #6
53
53
 
54
54
  #------------------------------------------------------------------------------
data/test/tc_verifier.rb CHANGED
@@ -19,7 +19,24 @@ require 'dnsruby'
19
19
 
20
20
  class VerifierTest < Test::Unit::TestCase
21
21
 
22
- def test_sha256
22
+ def test_sha2
23
+ # @TODO@ Check if OpenSSL supports SHA2
24
+ have_sha2 = false
25
+ begin
26
+ OpenSSL::Digest::SHA256.new
27
+ have_sha2 = true
28
+ rescue Exception
29
+ end
30
+ if (have_sha2)
31
+ # print "OpenSSL supports SHA2\n"
32
+ do_test_sha256
33
+ do_test_sha512
34
+ else
35
+ print "OpenSSL doesn't support SHA2 - disabling SHA256/SHA512 tests. DNSSEC validation will not work with these type of signatures.\n"
36
+ end
37
+ end
38
+
39
+ def do_test_sha256
23
40
  key256 = Dnsruby::RR.create("example.net. 3600 IN DNSKEY (256 3 8 AwEAAcFcGsaxxdgiuuGmCkVI
24
41
  my4h99CqT7jwY3pexPGcnUFtR2Fh36BponcwtkZ4cAgtvd4Qs8P
25
42
  kxUdp6p/DlUmObdk= );{id = 9033 (zsk), size = 512b}")
@@ -34,7 +51,7 @@ class VerifierTest < Test::Unit::TestCase
34
51
  verifier.verify_rrset(rrset, key256)
35
52
  end
36
53
 
37
- def test_sha512
54
+ def do_test_sha512
38
55
  key512 = Dnsruby::RR.create("example.net. 3600 IN DNSKEY (256 3 10 AwEAAdHoNTOW+et86KuJOWRD
39
56
  p1pndvwb6Y83nSVXXyLA3DLroROUkN6X0O6pnWnjJQujX/AyhqFD
40
57
  xj13tOnD9u/1kTg7cV6rklMrZDtJCQ5PCl/D7QNPsgVsMu1J2Q8g
data/test/ts_offline.rb CHANGED
@@ -40,6 +40,7 @@ require "test/tc_nsec.rb"
40
40
  require "test/tc_nsec3.rb"
41
41
  require "test/tc_nsec3param.rb"
42
42
  require "test/tc_ipseckey.rb"
43
+ require "test/tc_naptr.rb"
43
44
 
44
45
  begin
45
46
  require "openssl"
data/test/ts_online.rb CHANGED
@@ -52,6 +52,7 @@ if (online)
52
52
  # require "test/tc_queue.rb"
53
53
  require "test/tc_recur.rb"
54
54
  # require "test/tc_soak.rb"
55
+ require "test/tc_cache.rb"
55
56
 
56
57
  # Check if we can contact the server - if we can't, then abort the test
57
58
  # (but tell user that test has not been run due to connectivity problems)
@@ -112,4 +113,4 @@ if (online)
112
113
  # require 'test/tc_event_machine_deferrable.rb'
113
114
  # end
114
115
  end
115
- end
116
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dnsruby
3
3
  version: !ruby/object:Gem::Version
4
- version: "1.40"
4
+ version: "1.41"
5
5
  platform: ruby
6
6
  authors:
7
7
  - AlexD
@@ -9,7 +9,7 @@ autorequire: dnsruby
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-12 00:00:00 +00:00
12
+ date: 2009-12-02 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -41,6 +41,7 @@ files:
41
41
  - test/tc_itar.rb
42
42
  - test/tc_misc.rb
43
43
  - test/tc_name.rb
44
+ - test/tc_naptr.rb
44
45
  - test/tc_nsec.rb
45
46
  - test/tc_nsec3.rb
46
47
  - test/tc_nsec3param.rb
@@ -73,7 +74,6 @@ files:
73
74
  - test/ts_dnsruby.rb
74
75
  - test/ts_offline.rb
75
76
  - test/ts_online.rb
76
- - lib/Dnsruby
77
77
  - lib/Dnsruby/Cache.rb
78
78
  - lib/Dnsruby/code_mapper.rb
79
79
  - lib/Dnsruby/Config.rb
@@ -89,7 +89,6 @@ files:
89
89
  - lib/Dnsruby/PacketSender.rb
90
90
  - lib/Dnsruby/Recursor.rb
91
91
  - lib/Dnsruby/Resolver.rb
92
- - lib/Dnsruby/resource
93
92
  - lib/Dnsruby/resource/A.rb
94
93
  - lib/Dnsruby/resource/AAAA.rb
95
94
  - lib/Dnsruby/resource/AFSDB.rb
@@ -154,6 +153,8 @@ files:
154
153
  - EVENTMACHINE
155
154
  has_rdoc: true
156
155
  homepage: http://rubyforge.org/projects/dnsruby/
156
+ licenses: []
157
+
157
158
  post_install_message:
158
159
  rdoc_options: []
159
160
 
@@ -174,9 +175,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
175
  requirements: []
175
176
 
176
177
  rubyforge_project: dnsruby
177
- rubygems_version: 1.3.1
178
+ rubygems_version: 1.3.5
178
179
  signing_key:
179
- specification_version: 2
180
+ specification_version: 3
180
181
  summary: Ruby DNS(SEC) implementation
181
182
  test_files:
182
183
  - test/ts_offline.rb