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

Package-Manager: Portage-2.3.24, Repoman-2.3.6
This commit is contained in:
Sergei Trofimovich
2018-03-15 23:32:58 +00:00
parent 42bcef7f16
commit 775d10604b
3 changed files with 72 additions and 0 deletions

View 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() {

View File

@@ -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)

View File

@@ -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