commit:     775d10604baa00e1ffd0d5bf232348c3990ec4e9
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 15 23:32:58 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Thu Mar 15 23:33:14 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=775d1060

dev-lang/crystal: disable tests that interfere with gentoo's sandbox

Package-Manager: Portage-2.3.24, Repoman-2.3.6

 dev-lang/crystal/crystal-0.24.2.ebuild             |  2 ++
 ...ystal-0.24.2-gentoo-tests-network-sandbox.patch | 33 +++++++++++++++++++
 .../crystal-0.24.2-gentoo-tests-sandbox.patch      | 37 ++++++++++++++++++++++
 3 files changed, 72 insertions(+)

diff --git a/dev-lang/crystal/crystal-0.24.2.ebuild 
b/dev-lang/crystal/crystal-0.24.2.ebuild
index 4a403f10264..84884cb69fb 100644
--- a/dev-lang/crystal/crystal-0.24.2.ebuild
+++ b/dev-lang/crystal/crystal-0.24.2.ebuild
@@ -40,6 +40,8 @@ RDEPEND="${DEPEND}
 
 PATCHES=(
        "${FILESDIR}"/${PN}-0.24.0-verbose-LDFLAGS.patch
+       "${FILESDIR}"/${PN}-0.24.2-gentoo-tests-sandbox.patch
+       "${FILESDIR}"/${PN}-0.24.2-gentoo-tests-network-sandbox.patch
 )
 
 src_prepare() {

diff --git 
a/dev-lang/crystal/files/crystal-0.24.2-gentoo-tests-network-sandbox.patch 
b/dev-lang/crystal/files/crystal-0.24.2-gentoo-tests-network-sandbox.patch
new file mode 100644
index 00000000000..12565c1d839
--- /dev/null
+++ b/dev-lang/crystal/files/crystal-0.24.2-gentoo-tests-network-sandbox.patch
@@ -0,0 +1,33 @@
+diff --git a/spec/std/socket_spec.cr b/spec/std/socket_spec.cr
+index 0caa51a..f21b3b3 100644
+--- a/spec/std/socket_spec.cr
++++ b/spec/std/socket_spec.cr
+@@ -537,13 +537,15 @@ describe TCPSocket do
+     end
+   end
+ 
+-  it "fails when host doesn't exist" do
++  # gentoo's FEATURES=network-sandbox blocks DNS
++  pending "fails when host doesn't exist" do
+     expect_raises(Socket::Error, /No address/i) do
+       TCPSocket.new("doesnotexist.example.org.", 12345)
+     end
+   end
+ 
+-  it "fails (rather than segfault on darwin) when host doesn't exist and port 
is 0" do
++  # gentoo's FEATURES=network-sandbox blocks DNS
++  pending "fails (rather than segfault on darwin) when host doesn't exist and 
port is 0" do
+     expect_raises(Socket::Error, /No address/i) do
+       TCPSocket.new("doesnotexist.example.org.", 0)
+     end
+@@ -634,7 +636,9 @@ describe UDPSocket do
+     client.close
+   end
+ 
+-  it "broadcasts messages" do
++  # gentoo's FEATURES=network-sandbox blocks external network:
++  #   connect: Network is unreachable
++  pending "broadcasts messages" do
+     port = free_udp_socket_port
+ 
+     client = UDPSocket.new(Socket::Family::INET)

diff --git a/dev-lang/crystal/files/crystal-0.24.2-gentoo-tests-sandbox.patch 
b/dev-lang/crystal/files/crystal-0.24.2-gentoo-tests-sandbox.patch
new file mode 100644
index 00000000000..4bd779a834c
--- /dev/null
+++ b/dev-lang/crystal/files/crystal-0.24.2-gentoo-tests-sandbox.patch
@@ -0,0 +1,37 @@
+diff --git a/spec/std/file_spec.cr b/spec/std/file_spec.cr
+index 4a08b7d..cb1b28c 100644
+--- a/spec/std/file_spec.cr
++++ b/spec/std/file_spec.cr
+@@ -1026,7 +1026,8 @@ describe "File" do
+       end
+     end
+ 
+-    it "raises if file cannot be accessed" do
++    # On linux it's "Permission denied", not "Operation not permitted"
++    pending "raises if file cannot be accessed" do
+       expect_raises Errno, "Operation not permitted" do
+         File.touch("/bin/ls")
+       end
+diff --git a/spec/std/process_spec.cr b/spec/std/process_spec.cr
+index 4a36f18..0cd63a8 100644
+--- a/spec/std/process_spec.cr
++++ b/spec/std/process_spec.cr
+@@ -115,14 +115,16 @@ describe Process do
+   end
+ 
+   describe "environ" do
+-    it "clears the environment" do
++    #gentoo's sandbox keeps sandbox environment
++    pending "clears the environment" do
+       value = Process.run("env", clear_env: true) do |proc|
+         proc.output.gets_to_end
+       end
+       value.should eq("")
+     end
+ 
+-    it "sets an environment variable" do
++    #gentoo's sandbox keeps sandbox environment
++    pending "sets an environment variable" do
+       env = {"FOO" => "bar"}
+       value = Process.run("env", clear_env: true, env: env) do |proc|
+         proc.output.gets_to_end

Reply via email to