[DRE-commits] [ruby-rest-client] 01/03: add doko's patch to disable test with network access (Closes: #818459)

Cédric Boutillier boutil at moszumanska.debian.org
Mon Jun 6 22:49:49 UTC 2016


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

boutil pushed a commit to branch master
in repository ruby-rest-client.

commit 42e39ccba228124d2e9b9fae0b4e6ec3b275ceb0
Author: Cédric Boutillier <boutil at debian.org>
Date:   Tue Jun 7 00:47:12 2016 +0200

    add doko's patch to disable test with network access (Closes: #818459)
---
 debian/patches/disable-network-tests.patch | 106 +++++++++++++++++++++++++++++
 debian/patches/series                      |   1 +
 2 files changed, 107 insertions(+)

diff --git a/debian/patches/disable-network-tests.patch b/debian/patches/disable-network-tests.patch
new file mode 100644
index 0000000..5bd0d45
--- /dev/null
+++ b/debian/patches/disable-network-tests.patch
@@ -0,0 +1,106 @@
+From: Matthias Klose <doko at ubuntu.com>
+Last-Update: 2016-03-16
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818459
+Forwarded: no
+
+Index: b/spec/integration/request_spec.rb
+===================================================================
+--- a/spec/integration/request_spec.rb
++++ b/spec/integration/request_spec.rb
+@@ -10,95 +10,6 @@ describe RestClient::Request do
+   end
+ 
+   describe "ssl verification" do
+-    it "is successful with the correct ca_file" do
+-      request = RestClient::Request.new(
+-        :method => :get,
+-        :url => 'https://www.mozilla.org',
+-        :ssl_ca_file => File.join(File.dirname(__FILE__), "certs", "digicert.crt")
+-      )
+-      expect { request.execute }.to_not raise_error
+-    end
+-
+-    it "is successful with the correct ca_path" do
+-      request = RestClient::Request.new(
+-        :method => :get,
+-        :url => 'https://www.mozilla.org',
+-        :ssl_ca_path => File.join(File.dirname(__FILE__), "capath_digicert")
+-      )
+-      expect { request.execute }.to_not raise_error
+-    end
+-
+-    # TODO: deprecate and remove RestClient::SSLCertificateNotVerified and just
+-    # pass through OpenSSL::SSL::SSLError directly. See note in
+-    # lib/restclient/request.rb.
+-    #
+-    # On OS X, this test fails since Apple has patched OpenSSL to always fall
+-    # back on the system CA store.
+-    it "is unsuccessful with an incorrect ca_file", :unless => RestClient::Platform.mac_mri? do
+-      request = RestClient::Request.new(
+-        :method => :get,
+-        :url => 'https://www.mozilla.org',
+-        :ssl_ca_file => File.join(File.dirname(__FILE__), "certs", "verisign.crt")
+-      )
+-      expect { request.execute }.to raise_error(RestClient::SSLCertificateNotVerified)
+-    end
+-
+-    # On OS X, this test fails since Apple has patched OpenSSL to always fall
+-    # back on the system CA store.
+-    it "is unsuccessful with an incorrect ca_path", :unless => RestClient::Platform.mac_mri? do
+-      request = RestClient::Request.new(
+-        :method => :get,
+-        :url => 'https://www.mozilla.org',
+-        :ssl_ca_path => File.join(File.dirname(__FILE__), "capath_verisign")
+-      )
+-      expect { request.execute }.to raise_error(RestClient::SSLCertificateNotVerified)
+-    end
+-
+-    it "is successful using the default system cert store" do
+-      request = RestClient::Request.new(
+-        :method => :get,
+-        :url => 'https://www.mozilla.org',
+-        :verify_ssl => true,
+-      )
+-      expect {request.execute }.to_not raise_error
+-    end
+-
+-    it "executes the verify_callback" do
+-      ran_callback = false
+-      request = RestClient::Request.new(
+-        :method => :get,
+-        :url => 'https://www.mozilla.org',
+-        :verify_ssl => true,
+-        :ssl_verify_callback => lambda { |preverify_ok, store_ctx|
+-          ran_callback = true
+-          preverify_ok
+-        },
+-      )
+-      expect {request.execute }.to_not raise_error
+-      expect(ran_callback).to eq(true)
+-    end
+-
+-    it "fails verification when the callback returns false",
+-       :unless => RestClient::Platform.mac_mri? do
+-      request = RestClient::Request.new(
+-        :method => :get,
+-        :url => 'https://www.mozilla.org',
+-        :verify_ssl => true,
+-        :ssl_verify_callback => lambda { |preverify_ok, store_ctx| false },
+-      )
+-      expect { request.execute }.to raise_error(RestClient::SSLCertificateNotVerified)
+-    end
+-
+-    it "succeeds verification when the callback returns true",
+-       :unless => RestClient::Platform.mac_mri? do
+-      request = RestClient::Request.new(
+-        :method => :get,
+-        :url => 'https://www.mozilla.org',
+-        :verify_ssl => true,
+-        :ssl_ca_file => File.join(File.dirname(__FILE__), "certs", "verisign.crt"),
+-        :ssl_verify_callback => lambda { |preverify_ok, store_ctx| true },
+-      )
+-      expect { request.execute }.to_not raise_error
+-    end
++    # all removed; accessing the network
+   end
+ end
diff --git a/debian/patches/series b/debian/patches/series
index 70613b9..b755848 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 port-tests-rspec3.patch
+disable-network-tests.patch

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



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