dev-lang/crystal: disable tests that interfere with gentoo's sandbox
authorSergei Trofimovich <slyfox@gentoo.org>
Thu, 15 Mar 2018 23:32:58 +0000 (23:32 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Thu, 15 Mar 2018 23:33:14 +0000 (23:33 +0000)
Package-Manager: Portage-2.3.24, Repoman-2.3.6

dev-lang/crystal/crystal-0.24.2.ebuild
dev-lang/crystal/files/crystal-0.24.2-gentoo-tests-network-sandbox.patch [new file with mode: 0644]
dev-lang/crystal/files/crystal-0.24.2-gentoo-tests-sandbox.patch [new file with mode: 0644]

index 4a403f10264a54b5709a0534d222d8977c9d282a..84884cb69fb642a8036225f2328f349240e19e55 100644 (file)
@@ -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 (file)
index 0000000..12565c1
--- /dev/null
@@ -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 (file)
index 0000000..4bd779a
--- /dev/null
@@ -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