Use shorter filenames to avoid sockaddr_un size limitation.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2015-04-10 11:52:29 +00:00
parent 0ad3abe1f1
commit 6f636adad0

View File

@ -54,7 +54,7 @@ class TestFileExhaustive < Test::Unit::TestCase
end end
def make_tmp_filename(prefix) def make_tmp_filename(prefix)
"#{@dir}/#{prefix}#{File.basename(__FILE__)}.#{$$}.test" "#{@dir}/#{prefix}.#{$$}.test"
end end
def test_path def test_path
@ -173,7 +173,7 @@ class TestFileExhaustive < Test::Unit::TestCase
assert_file.not_socket?(@file) assert_file.not_socket?(@file)
assert_file.not_socket?(@nofile) assert_file.not_socket?(@nofile)
if defined? UNIXServer if defined? UNIXServer
socket = make_tmp_filename("socket") socket = make_tmp_filename("s")
UNIXServer.open(socket) {|sock| UNIXServer.open(socket) {|sock|
assert_file.socket?(socket) assert_file.socket?(socket)
} }
@ -1003,7 +1003,7 @@ class TestFileExhaustive < Test::Unit::TestCase
make_fifo fifo make_fifo fifo
end end
if defined? UNIXServer if defined? UNIXServer
socket = make_tmp_filename("socket") socket = make_tmp_filename("s")
UNIXServer.open(socket).close UNIXServer.open(socket).close
end end
[@dir, @file, @zerofile, @symlinkfile, @hardlinkfile, fifo, socket].compact.each do |f| [@dir, @file, @zerofile, @symlinkfile, @hardlinkfile, fifo, socket].compact.each do |f|
@ -1129,7 +1129,7 @@ class TestFileExhaustive < Test::Unit::TestCase
assert(!(File::Stat.new(@dir).socket?)) assert(!(File::Stat.new(@dir).socket?))
assert(!(File::Stat.new(@file).socket?)) assert(!(File::Stat.new(@file).socket?))
if defined? UNIXServer if defined? UNIXServer
socket = make_tmp_filename("socket") socket = make_tmp_filename("s")
UNIXServer.open(socket) {|sock| UNIXServer.open(socket) {|sock|
assert(File::Stat.new(socket).socket?) assert(File::Stat.new(socket).socket?)
} }