[DRE-commits] [ruby-rubydns] 01/01: updated ruby-tests with proper paths

Philippe Thierry pthierry-guest at moszumanska.debian.org
Sun Jul 16 09:54:29 UTC 2017


This is an automated email from the git hooks/post-receive script.

pthierry-guest pushed a commit to branch master
in repository ruby-rubydns.

commit 818af7a026d4d69b78c9259b09f019b3ceb93dee
Author: Philippe Thierry <phil at reseau-libre.net>
Date:   Sun Jul 16 11:27:50 2017 +0200

    updated ruby-tests with proper paths
---
 debian/patches/external-resolving-tests.patch | 415 ++++++++++++++++++++++++++
 debian/patches/series                         |   2 +
 debian/patches/tests_with_unmet_deps.patch    | 256 ++++++++++++++++
 debian/ruby-tests.rake                        |   2 +-
 4 files changed, 674 insertions(+), 1 deletion(-)

diff --git a/debian/patches/external-resolving-tests.patch b/debian/patches/external-resolving-tests.patch
new file mode 100644
index 0000000..625dd9f
--- /dev/null
+++ b/debian/patches/external-resolving-tests.patch
@@ -0,0 +1,415 @@
+Description: Cleaning tests making exteral (internet) resolution)
+ These tests fail when udp/53 to google (8.8.8.8) is dropped
+Author: Philippe Thierry
+Last-Update: 2017-07-16
+--- a/spec/rubydns/celluloid_bug_spec.rb
++++ /dev/null
+@@ -1,92 +0,0 @@
+-#!/usr/bin/env ruby
+-
+-# Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
+-# 
+-# Permission is hereby granted, free of charge, to any person obtaining a copy
+-# of this software and associated documentation files (the "Software"), to deal
+-# in the Software without restriction, including without limitation the rights
+-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+-# copies of the Software, and to permit persons to whom the Software is
+-# furnished to do so, subject to the following conditions:
+-# 
+-# The above copyright notice and this permission notice shall be included in
+-# all copies or substantial portions of the Software.
+-# 
+-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+-# THE SOFTWARE.
+-
+-require 'rubydns'
+-
+-module RubyDNS::CelluloidBugSpec
+-	describe RubyDNS::Resolver do
+-		context 'benchmark' do
+-			domains = %W(
+-				Facebook.com
+-				Twitter.com
+-				Google.com
+-				Youtube.com
+-				Wordpress.org
+-				Adobe.com
+-				Blogspot.com
+-				Wikipedia.org
+-				Linkedin.com
+-				Wordpress.com
+-				Yahoo.com
+-				Amazon.com
+-				Flickr.com
+-				Pinterest.com
+-				Tumblr.com
+-				W3.org
+-				Apple.com
+-				Myspace.com
+-				Vimeo.com
+-				Microsoft.com
+-				Youtu.be
+-				Qq.com
+-				Digg.com
+-				Baidu.com
+-				Stumbleupon.com
+-				Addthis.com
+-				Statcounter.com
+-				Feedburner.com
+-				TradeMe.co.nz
+-				Delicious.com
+-				Nytimes.com
+-				Reddit.com
+-				Weebly.com
+-				Bbc.co.uk
+-				Blogger.com
+-				Msn.com
+-				Macromedia.com
+-				Goo.gl
+-				Instagram.com
+-				Gov.uk
+-				Icio.us
+-				Yandex.ru
+-				Cnn.com
+-				Webs.com
+-				Google.de
+-				T.co
+-				Livejournal.com
+-				Imdb.com
+-				Mail.ru
+-				Jimdo.com
+-			)
+-			
+-			it 'should be faster than native resolver' do
+-				Celluloid.logger.level = Logger::ERROR
+-				
+-				resolver = RubyDNS::Resolver.new([[:udp, "8.8.8.8", 53], [:tcp, "8.8.8.8", 53]], timeout: 0.1)
+-				
+-				futures = domains.map { |domain| resolver.future.addresses_for(domain) }
+-				
+-				futures.map { |future| future.value }
+-			end
+-		end
+-	end
+-end
+--- a/spec/rubydns/passthrough_spec.rb
++++ b/spec/rubydns/passthrough_spec.rb
+@@ -50,29 +50,5 @@
+ 				end
+ 			end
+ 		end
+-	
+-		it "should resolve domain correctly" do
+-			resolver = RubyDNS::Resolver.new(SERVER_PORTS)
+-		
+-			response = resolver.query("google.com")
+-			expect(response.ra).to be == 1
+-		
+-			answer = response.answer.first
+-			expect(answer).not_to be == nil
+-			expect(answer.count).to be > 0
+-		
+-			addresses = answer.select {|record| record.kind_of? Resolv::DNS::Resource::IN::A}
+-			expect(addresses.size).to be > 0
+-		end
+-	
+-		it "should resolve prefixed domain correctly" do
+-			resolver = RubyDNS::Resolver.new(SERVER_PORTS)
+-		
+-			response = resolver.query("a-slashdot.org")
+-			answer = response.answer.first
+-		
+-			expect(answer).not_to be == nil
+-			expect(answer.count).to be > 0
+-		end
+ 	end
+ end
+--- a/spec/rubydns/resolver_performance_spec.rb
++++ /dev/null
+@@ -1,110 +0,0 @@
+-#!/usr/bin/env ruby
+-
+-# Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
+-# 
+-# Permission is hereby granted, free of charge, to any person obtaining a copy
+-# of this software and associated documentation files (the "Software"), to deal
+-# in the Software without restriction, including without limitation the rights
+-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+-# copies of the Software, and to permit persons to whom the Software is
+-# furnished to do so, subject to the following conditions:
+-# 
+-# The above copyright notice and this permission notice shall be included in
+-# all copies or substantial portions of the Software.
+-# 
+-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+-# THE SOFTWARE.
+-
+-require 'rubydns'
+-
+-module RubyDNS::ResolverPerformanceSpec
+-	describe RubyDNS::Resolver do
+-		context 'benchmark' do
+-			domains = %W{
+-				Facebook.com
+-				Twitter.com
+-				Google.com
+-				Youtube.com
+-				Wordpress.org
+-				Adobe.com
+-				Blogspot.com
+-				Wikipedia.org
+-				Linkedin.com
+-				Wordpress.com
+-				Yahoo.com
+-				Amazon.com
+-				Flickr.com
+-				Pinterest.com
+-				Tumblr.com
+-				W3.org
+-				Apple.com
+-				Myspace.com
+-				Vimeo.com
+-				Microsoft.com
+-				Youtu.be
+-				Qq.com
+-				Digg.com
+-				Baidu.com
+-				Stumbleupon.com
+-				Addthis.com
+-				Statcounter.com
+-				Feedburner.com
+-				TradeMe.co.nz
+-				Delicious.com
+-				Nytimes.com
+-				Reddit.com
+-				Weebly.com
+-				Bbc.co.uk
+-				Blogger.com
+-				Msn.com
+-				Macromedia.com
+-				Goo.gl
+-				Instagram.com
+-				Gov.uk
+-				Icio.us
+-				Yandex.ru
+-				Cnn.com
+-				Webs.com
+-				Google.de
+-				T.co
+-				Livejournal.com
+-				Imdb.com
+-				Mail.ru
+-				Jimdo.com
+-			}
+-		
+-			before do
+-				require 'benchmark'
+-			end
+-		
+-			it 'should be faster than native resolver' do
+-				Celluloid.logger.level = Logger::ERROR
+-			
+-				Benchmark.bm(20) do |x|
+-					a = x.report("RubyDNS::Resolver") do
+-						resolver = RubyDNS::Resolver.new([[:udp, "8.8.8.8", 53], [:tcp, "8.8.8.8", 53]])
+-					
+-						futures = domains.collect{|domain| resolver.future.addresses_for(domain)}
+-					
+-						futures.collect{|future| future.value}
+-					end
+-			
+-					b = x.report("Resolv::DNS") do
+-						resolver = Resolv::DNS.new(:nameserver => "8.8.8.8")
+-				
+-						resolved = domains.collect do |domain|
+-							[domain, resolver.getaddresses(domain)]
+-						end
+-					end
+-				
+-					expect(a.real).to be < b.real
+-				end
+-			end
+-		end
+-	end
+-end
+--- a/spec/rubydns/resolver_spec.rb
++++ b/spec/rubydns/resolver_spec.rb
+@@ -82,23 +82,6 @@
+ 			JunkTCPServer.supervise
+ 		end
+ 
+-		it "should result in non-existent domain" do
+-			resolver = RubyDNS::Resolver.new([[:udp, "8.8.8.8", 53], [:tcp, "8.8.8.8", 53]])
+-	
+-			response = resolver.query('foobar.oriontransfer.org')
+-	
+-			expect(response.rcode).to be == Resolv::DNS::RCode::NXDomain
+-		end
+-
+-		it "should result in some answers" do
+-			resolver = RubyDNS::Resolver.new([[:udp, "8.8.8.8", 53], [:tcp, "8.8.8.8", 53]])
+-	
+-			response = resolver.query('google.com')
+-	
+-			expect(response.class).to be == RubyDNS::Message
+-			expect(response.answer.size).to be > 0
+-		end
+-
+ 		it "should return no results" do
+ 			resolver = RubyDNS::Resolver.new([])
+ 	
+@@ -129,24 +112,5 @@
+ 			expect(response).to be == nil
+ 		end
+ 
+-		it "should return some IPv4 and IPv6 addresses" do
+-			resolver = RubyDNS::Resolver.new([[:udp, "8.8.8.8", 53], [:tcp, "8.8.8.8", 53]])
+-	
+-			addresses = resolver.addresses_for("www.google.com.")
+-	
+-			expect(addresses.size).to be > 0
+-	
+-			addresses.each do |address|
+-				expect(address).to be_kind_of(Resolv::IPv4) | be_kind_of(Resolv::IPv6)
+-			end
+-		end
+-		
+-		it "should recursively resolve CNAME records" do
+-			resolver = RubyDNS::Resolver.new([[:udp, "8.8.8.8", 53], [:tcp, "8.8.8.8", 53]])
+-			
+-			addresses = resolver.addresses_for('www.baidu.com')
+-			
+-			expect(addresses.size).to be > 0
+-		end
+ 	end
+ end
+--- a/spec/rubydns/system_spec.rb
++++ b/spec/rubydns/system_spec.rb
+@@ -29,19 +29,6 @@
+ 			Celluloid.shutdown
+ 			Celluloid.boot
+ 		end
+-	
+-		it "should have at least one namesever" do
+-			expect(RubyDNS::System::nameservers.length).to be > 0
+-		end
+-	
+-		it "should respond to query for google.com" do
+-			resolver = RubyDNS::Resolver.new(RubyDNS::System::nameservers)
+-		
+-			response = resolver.query('google.com')
+-		
+-			expect(response.class).to be == RubyDNS::Message
+-			expect(response.rcode).to be == Resolv::DNS::RCode::NoError
+-		end
+ 	end
+ 
+ 	describe RubyDNS::System::Hosts do
+--- a/spec/rubydns/transaction_spec.rb
++++ b/spec/rubydns/transaction_spec.rb
+@@ -43,40 +43,6 @@
+ 			expect(transaction.response.answer[0][2].address.to_s).to be == "1.2.3.4"
+ 		end
+ 		
+-		it "should passthrough the request" do
+-			transaction = RubyDNS::Transaction.new(server, query, question, IN::A, response)
+-			
+-			expect(transaction.response.answer.size).to be 0
+-			
+-			transaction.passthrough!(resolver)
+-			
+-			expect(transaction.response.answer.size).to be > 0
+-		end
+-		
+-		it "should return a response on passthrough" do
+-			transaction = RubyDNS::Transaction.new(server, query, question, IN::A, response)
+-			
+-			expect(transaction.response.answer.size).to be 0
+-			
+-			response = transaction.passthrough(resolver)
+-			
+-			expect(response.answer.length).to be > 0
+-		end
+-		
+-		it "should call the block with the response when invoking passthrough!" do
+-			transaction = RubyDNS::Transaction.new(server, query, question, IN::A, response)
+-			
+-			expect(transaction.response.answer.size).to be 0
+-			
+-			passthrough_response = nil
+-			
+-			transaction.passthrough!(resolver) do |response|
+-				passthrough_response = response
+-			end
+-			
+-			expect(passthrough_response.answer.length).to be > 0
+-		end
+-		
+ 		it "should fail the request" do
+ 			transaction = RubyDNS::Transaction.new(server, query, question, IN::A, response)
+ 			
+@@ -85,54 +51,5 @@
+ 			expect(transaction.response.rcode).to be Resolv::DNS::RCode::NXDomain
+ 		end
+ 		
+-		it "should return AAAA record" do
+-			transaction = RubyDNS::Transaction.new(server, query, question, IN::AAAA, response)
+-			
+-			expect(transaction.response.answer.size).to be 0
+-			
+-			transaction.passthrough!(resolver)
+-			
+-			expect(transaction.response.answer.first[2]).to be_kind_of IN::AAAA
+-		end
+-		
+-		it "should return MX record" do
+-			transaction = RubyDNS::Transaction.new(server,query,"google.com",IN::MX, response)
+-			
+-			expect(transaction.response.answer.size).to be 0
+-			
+-			transaction.passthrough!(resolver)
+-			
+-			expect(transaction.response.answer.first[2]).to be_kind_of IN::MX
+-		end
+-		
+-		it "should return NS record" do
+-			transaction = RubyDNS::Transaction.new(server, query, "google.com", IN::NS, response)
+-			
+-			expect(transaction.response.answer.size).to be 0
+-			
+-			transaction.passthrough!(resolver)
+-			
+-			expect(transaction.response.answer.first[2]).to be_kind_of IN::NS
+-		end
+-		
+-		it "should return PTR record" do
+-			transaction = RubyDNS::Transaction.new(server, query, "8.8.8.8.in-addr.arpa", IN::PTR, response)
+-			
+-			expect(transaction.response.answer.size).to be 0
+-			
+-			transaction.passthrough!(resolver)
+-			
+-			expect(transaction.response.answer.first[2]).to be_kind_of IN::PTR
+-		end
+-		
+-		it "should return SOA record" do
+-			transaction = RubyDNS::Transaction.new(server, query, "google.com", IN::SOA, response)
+-			
+-			expect(transaction.response.answer.size).to be 0
+-			
+-			transaction.passthrough!(resolver)
+-			
+-			expect(transaction.response.answer.first[2]).to be_kind_of IN::SOA
+-		end
+ 	end
+ end
diff --git a/debian/patches/series b/debian/patches/series
index ad74aba..39e2912 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,4 @@
+tests_with_unmet_deps.patch
 debian_patches_drop-git-ls-files.patch
 debian_patches_fix-test.patch
+external-resolving-tests.patch
diff --git a/debian/patches/tests_with_unmet_deps.patch b/debian/patches/tests_with_unmet_deps.patch
new file mode 100644
index 0000000..49ec7d3
--- /dev/null
+++ b/debian/patches/tests_with_unmet_deps.patch
@@ -0,0 +1,256 @@
+Description: deleting tests with dependancy on unpackaged ruby module
+ These tests requires process/daemon, which is not packaged in Debian
+Author: Philippe Thierry
+Last-Update: 2017-07-16
+--- a/spec/rubydns/daemon_spec.rb
++++ /dev/null
+@@ -1,110 +0,0 @@
+-#!/usr/bin/env ruby
+-
+-# Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
+-# 
+-# Permission is hereby granted, free of charge, to any person obtaining a copy
+-# of this software and associated documentation files (the "Software"), to deal
+-# in the Software without restriction, including without limitation the rights
+-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+-# copies of the Software, and to permit persons to whom the Software is
+-# furnished to do so, subject to the following conditions:
+-# 
+-# The above copyright notice and this permission notice shall be included in
+-# all copies or substantial portions of the Software.
+-# 
+-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+-# THE SOFTWARE.
+-
+-require 'rubydns'
+-require 'process/daemon'
+-
+-class BasicTestServer < Process::Daemon
+-	SERVER_PORTS = [[:udp, '127.0.0.1', 5350], [:tcp, '127.0.0.1', 5350]]
+-
+-	IN = Resolv::DNS::Resource::IN
+-
+-	def working_directory
+-		File.expand_path("../tmp", __FILE__)
+-	end
+-
+-	def startup
+-		Celluloid.boot
+-		
+-		# Start the RubyDNS server
+-		RubyDNS::run_server(:listen => SERVER_PORTS) do
+-			match("test.local", IN::A) do |transaction|
+-				transaction.respond!("192.168.1.1")
+-			end
+-
+-			match(/foo.*/, IN::A) do |transaction|
+-				transaction.respond!("192.168.1.2")
+-			end
+-
+-			match(/peername/, IN::A) do |transaction|
+-				transaction.respond!(transaction[:peer])
+-			end
+-
+-			# Default DNS handler
+-			otherwise do |transaction|
+-				transaction.fail!(:NXDomain)
+-			end
+-		end
+-	end
+-end
+-
+-describe "RubyDNS Daemonized Server" do
+-	before(:all) do
+-		Celluloid.shutdown
+-		
+-		# Trying to fork with Celluloid running is a recipe for disaster.
+-		# BasicTestServer.controller output: $stderr
+-		BasicTestServer.start
+-		
+-		Celluloid.boot
+-	end
+-	
+-	after(:all) do
+-		BasicTestServer.stop
+-	end
+-	
+-	it "should resolve local domain correctly" do
+-		expect(BasicTestServer.status).to be == :running
+-		
+-		resolver = RubyDNS::Resolver.new(BasicTestServer::SERVER_PORTS, search_domain: '')
+-	
+-		response = resolver.query("test.local")
+-		
+-		answer = response.answer.first
+-		
+-		expect(answer[0].to_s).to be == "test.local."
+-		expect(answer[2].address.to_s).to be == "192.168.1.1"
+-	end
+-	
+-	it "should pattern match correctly" do
+-		expect(BasicTestServer.status).to be == :running
+-		
+-		resolver = RubyDNS::Resolver.new(BasicTestServer::SERVER_PORTS)
+-
+-		response = resolver.query("foobar")
+-		answer = response.answer.first
+-		
+-		expect(answer[0]).to be == resolver.fully_qualified_name("foobar")
+-		expect(answer[2].address.to_s).to be == "192.168.1.2"
+-	end
+-	
+-	it "should give peer ip address" do
+-		expect(BasicTestServer.status).to be == :running
+-		
+-		resolver = RubyDNS::Resolver.new(BasicTestServer::SERVER_PORTS)
+-
+-		response = resolver.query("peername")
+-		answer = response.answer.first
+-		
+-		expect(answer[2].address.to_s).to be == "127.0.0.1"
+-	end
+-end
+--- a/spec/rubydns/server_performance_spec.rb
++++ /dev/null
+@@ -1,136 +0,0 @@
+-#!/usr/bin/env ruby
+-
+-# Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
+-# 
+-# Permission is hereby granted, free of charge, to any person obtaining a copy
+-# of this software and associated documentation files (the "Software"), to deal
+-# in the Software without restriction, including without limitation the rights
+-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+-# copies of the Software, and to permit persons to whom the Software is
+-# furnished to do so, subject to the following conditions:
+-# 
+-# The above copyright notice and this permission notice shall be included in
+-# all copies or substantial portions of the Software.
+-# 
+-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+-# THE SOFTWARE.
+-
+-require 'rubydns'
+-require 'benchmark'
+-require 'process/daemon'
+-
+-module RubyDNS::ServerPerformanceSpec
+-	describe RubyDNS::Server do
+-		context 'benchmark' do
+-			class ServerPerformanceRubyDNS < Process::Daemon
+-				IN = Resolv::DNS::Resource::IN
+-	
+-				def working_directory
+-					File.expand_path("../tmp", __FILE__)
+-				end
+-	
+-				def startup
+-					puts "Booting celluloid..."
+-					Celluloid.boot
+-				
+-					million = {}
+-		
+-					puts "Generating domains..."
+-					(1..5_000).each do |i|
+-						domain = "domain#{i}.local"
+-	
+-						million[domain] = "#{69}.#{(i >> 16)%256}.#{(i >> 8)%256}.#{i%256}"
+-					end
+-		
+-					puts "Starting DNS server..."
+-					RubyDNS::run_server(:listen => [[:udp, '0.0.0.0', 5300]]) do
+-						@logger.level = Logger::WARN
+-			
+-						match(//, IN::A) do |transaction|
+-							puts "Responding to #{transaction.name}"
+-							transaction.respond!(million[transaction.name])
+-						end
+-		
+-						# Default DNS handler
+-						otherwise do |transaction|
+-							transaction.fail!(:NXDomain)
+-						end
+-					end
+-				end
+-			end
+-
+-			class ServerPerformanceBind9 < Process::Daemon
+-				def working_directory
+-					File.expand_path("../server/bind9", __FILE__)
+-				end
+-	
+-				def startup
+-					exec(self.class.named_executable, "-c", "named.conf", "-f", "-p", "5400", "-g")
+-				end
+-	
+-				def self.named_executable
+-					# Check if named executable is available:
+-					@named ||= `which named`.chomp
+-				end
+-			end
+-		
+-			before do
+-				Celluloid.shutdown
+-			
+-				@servers = []
+-				@servers << ["RubyDNS::Server", 5300]
+-			
+-				@domains = (1..1000).collect do |i|
+-					"domain#{i}.local"
+-				end
+-			
+-				ServerPerformanceRubyDNS.start
+-			
+-				unless ServerPerformanceBind9.named_executable.empty?
+-					ServerPerformanceBind9.start
+-					@servers << ["Bind9", 5400]
+-				end
+-				
+-				sleep 2
+-				
+-				Celluloid.boot
+-			end
+-		
+-			after do
+-				ServerPerformanceRubyDNS.stop
+-			
+-				unless ServerPerformanceBind9.named_executable.empty?
+-					ServerPerformanceBind9.stop
+-				end
+-			end
+-		
+-			it 'it takes time' do
+-				Celluloid.logger.level = Logger::ERROR
+-			
+-				Benchmark.bm(20) do |x|
+-					@servers.each do |name, port|
+-						resolver = RubyDNS::Resolver.new([[:udp, '127.0.0.1', port]])
+-					
+-						x.report(name) do
+-							# Number of requests remaining since this is an asynchronous event loop:
+-							5.times do
+-								pending = @domains.size
+-							
+-								futures = @domains.collect{|domain| resolver.future.addresses_for(domain)}
+-							
+-								futures.collect do |future|
+-									expect(future.value).to_not be nil
+-								end
+-							end
+-						end
+-					end
+-				end
+-			end
+-		end
+-	end
+-end
diff --git a/debian/ruby-tests.rake b/debian/ruby-tests.rake
index 99987ae..dcc1601 100644
--- a/debian/ruby-tests.rake
+++ b/debian/ruby-tests.rake
@@ -1,7 +1,7 @@
 require 'rspec/core/rake_task'
 
 RSpec::Core::RakeTask.new(:spec) do |spec|
-  spec.pattern = './spec/*_spec.rb'
+  spec.pattern = './spec/**/*_spec.rb'
 end
 
 task :default => :spec

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-rubydns.git



More information about the Pkg-ruby-extras-commits mailing list