Skip to content

Remove Solaris platform #1254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions core/dir/home_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,7 @@
end

describe "when called with the current user name" do
platform_is :solaris do
it "returns the named user's home directory from the user database" do
Dir.home(ENV['USER']).should == `getent passwd #{ENV['USER']}|cut -d: -f6`.chomp
end
end

platform_is_not :windows, :solaris, :android, :wasi do
platform_is_not :windows, :android, :wasi do
it "returns the named user's home directory, from the user database" do
Dir.home(ENV['USER']).should == `echo ~#{ENV['USER']}`.chomp
end
Expand Down
18 changes: 4 additions & 14 deletions core/dir/shared/delete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,10 @@
Dir.send(@method, p)
end

platform_is_not :solaris do
it "raises an Errno::ENOTEMPTY when trying to remove a nonempty directory" do
-> do
Dir.send @method, DirSpecs.mock_rmdir("nonempty")
end.should raise_error(Errno::ENOTEMPTY)
end
end

platform_is :solaris do
it "raises an Errno::EEXIST when trying to remove a nonempty directory" do
-> do
Dir.send @method, DirSpecs.mock_rmdir("nonempty")
end.should raise_error(Errno::EEXIST)
end
it "raises an Errno::ENOTEMPTY when trying to remove a nonempty directory" do
-> do
Dir.send @method, DirSpecs.mock_rmdir("nonempty")
end.should raise_error(Errno::ENOTEMPTY)
end

it "raises an Errno::ENOENT when trying to remove a non-existing directory" do
Expand Down
6 changes: 0 additions & 6 deletions core/file/empty_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,4 @@
describe "File.empty?" do
it_behaves_like :file_zero, :empty?, File
it_behaves_like :file_zero_missing, :empty?, File

platform_is :solaris do
it "returns false for /dev/null" do
File.empty?('/dev/null').should == true
end
end
end
32 changes: 0 additions & 32 deletions core/file/flock_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,35 +72,3 @@
end
end
end

platform_is :solaris do
describe "File#flock on Solaris" do
before :each do
@name = tmp("flock_test")
touch(@name)

@read_file = File.open @name, "r"
@write_file = File.open @name, "w"
end

after :each do
@read_file.flock File::LOCK_UN
@read_file.close
@write_file.flock File::LOCK_UN
@write_file.close
rm_r @name
end

it "fails with EBADF acquiring exclusive lock on read-only File" do
-> do
@read_file.flock File::LOCK_EX
end.should raise_error(Errno::EBADF)
end

it "fails with EBADF acquiring shared lock on read-only File" do
-> do
@write_file.flock File::LOCK_SH
end.should raise_error(Errno::EBADF)
end
end
end
2 changes: 1 addition & 1 deletion core/file/lchmod_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'

describe "File.lchmod" do
platform_is_not :linux, :windows, :openbsd, :solaris, :aix do
platform_is_not :linux, :windows, :openbsd, :aix do
before :each do
@fname = tmp('file_chmod_test')
@lname = @fname + '.lnk'
Expand Down
4 changes: 0 additions & 4 deletions core/file/setuid_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@

platform_is_not :windows do
it "returns true when the gid bit is set" do
platform_is :solaris do
# Solaris requires execute bit before setting suid
system "chmod u+x #{@name}"
end
system "chmod u+s #{@name}"

File.setuid?(@name).should == true
Expand Down
13 changes: 3 additions & 10 deletions core/file/stat/rdev_major_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,12 @@

describe "File::Stat#rdev_major" do
before :each do
platform_is :solaris do
@name = "/dev/zfs"
end
platform_is_not :solaris do
@name = tmp("file.txt")
touch(@name)
end
@name = tmp("file.txt")
touch(@name)
end

after :each do
platform_is_not :solaris do
rm_r @name
end
rm_r @name
end

platform_is_not :windows do
Expand Down
13 changes: 3 additions & 10 deletions core/file/stat/rdev_minor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,12 @@

describe "File::Stat#rdev_minor" do
before :each do
platform_is :solaris do
@name = "/dev/zfs"
end
platform_is_not :solaris do
@name = tmp("file.txt")
touch(@name)
end
@name = tmp("file.txt")
touch(@name)
end

after :each do
platform_is_not :solaris do
rm_r @name
end
rm_r @name
end

platform_is_not :windows do
Expand Down
6 changes: 0 additions & 6 deletions core/file/zero_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,4 @@
describe "File.zero?" do
it_behaves_like :file_zero, :zero?, File
it_behaves_like :file_zero_missing, :zero?, File

platform_is :solaris do
it "returns false for /dev/null" do
File.zero?('/dev/null').should == true
end
end
end
6 changes: 0 additions & 6 deletions core/filetest/zero_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,4 @@
describe "FileTest.zero?" do
it_behaves_like :file_zero, :zero?, FileTest
it_behaves_like :file_zero_missing, :zero?, FileTest

platform_is :solaris do
it "returns false for /dev/null" do
File.zero?('/dev/null').should == true
end
end
end
2 changes: 1 addition & 1 deletion core/process/fixtures/clocks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module ProcessSpecs
def self.clock_constants
clocks = []

platform_is_not :windows, :solaris do
platform_is_not :windows do
clocks += Process.constants.select { |c| c.to_s.start_with?('CLOCK_') }

# These require CAP_WAKE_ALARM and are not documented in
Expand Down
28 changes: 12 additions & 16 deletions core/process/setrlimit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,18 @@
Process.setrlimit(:STACK, *Process.getrlimit(Process::RLIMIT_STACK)).should be_nil
end

platform_is_not :solaris, :aix do
platform_is_not :aix do
it "coerces :MEMLOCK into RLIMIT_MEMLOCK" do
Process.setrlimit(:MEMLOCK, *Process.getrlimit(Process::RLIMIT_MEMLOCK)).should be_nil
end
end

platform_is_not :solaris do
it "coerces :NPROC into RLIMIT_NPROC" do
Process.setrlimit(:NPROC, *Process.getrlimit(Process::RLIMIT_NPROC)).should be_nil
end
it "coerces :NPROC into RLIMIT_NPROC" do
Process.setrlimit(:NPROC, *Process.getrlimit(Process::RLIMIT_NPROC)).should be_nil
end

it "coerces :RSS into RLIMIT_RSS" do
Process.setrlimit(:RSS, *Process.getrlimit(Process::RLIMIT_RSS)).should be_nil
end
it "coerces :RSS into RLIMIT_RSS" do
Process.setrlimit(:RSS, *Process.getrlimit(Process::RLIMIT_RSS)).should be_nil
end

platform_is :netbsd, :freebsd do
Expand Down Expand Up @@ -155,20 +153,18 @@
Process.setrlimit("STACK", *Process.getrlimit(Process::RLIMIT_STACK)).should be_nil
end

platform_is_not :solaris, :aix do
platform_is_not :aix do
it "coerces 'MEMLOCK' into RLIMIT_MEMLOCK" do
Process.setrlimit("MEMLOCK", *Process.getrlimit(Process::RLIMIT_MEMLOCK)).should be_nil
end
end

platform_is_not :solaris do
it "coerces 'NPROC' into RLIMIT_NPROC" do
Process.setrlimit("NPROC", *Process.getrlimit(Process::RLIMIT_NPROC)).should be_nil
end
it "coerces 'NPROC' into RLIMIT_NPROC" do
Process.setrlimit("NPROC", *Process.getrlimit(Process::RLIMIT_NPROC)).should be_nil
end

it "coerces 'RSS' into RLIMIT_RSS" do
Process.setrlimit("RSS", *Process.getrlimit(Process::RLIMIT_RSS)).should be_nil
end
it "coerces 'RSS' into RLIMIT_RSS" do
Process.setrlimit("RSS", *Process.getrlimit(Process::RLIMIT_RSS)).should be_nil
end

platform_is :netbsd, :freebsd do
Expand Down
8 changes: 3 additions & 5 deletions core/rational/exponent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,9 @@
-> { Rational(0, 1) ** Rational(-3, 2) }.should raise_error(ZeroDivisionError, "divided by 0")
end

platform_is_not :solaris do # See https://github.com/ruby/spec/issues/134
it "returns Infinity for Rational(0, 1) passed a negative Float" do
[-1.0, -3.0, -3.14].each do |exponent|
(Rational(0, 1) ** exponent).infinite?.should == 1
end
it "returns Infinity for Rational(0, 1) passed a negative Float" do
[-1.0, -3.0, -3.14].each do |exponent|
(Rational(0, 1) ** exponent).infinite?.should == 1
end
end
end
16 changes: 6 additions & 10 deletions library/socket/addrinfo/getaddrinfo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,15 @@
end
end

platform_is_not :'solaris2.10' do # i386-solaris
it 'sets a custom socket protocol of the Addrinfo instances' do
array = Addrinfo.getaddrinfo('127.0.0.1', 80, nil, nil, Socket::IPPROTO_UDP)
it 'sets a custom socket protocol of the Addrinfo instances' do
array = Addrinfo.getaddrinfo('127.0.0.1', 80, nil, nil, Socket::IPPROTO_UDP)

array[0].protocol.should == Socket::IPPROTO_UDP
end
array[0].protocol.should == Socket::IPPROTO_UDP
end

platform_is_not :solaris do
it 'sets the canonical name when AI_CANONNAME is given as a flag' do
array = Addrinfo.getaddrinfo('localhost', 80, nil, nil, nil, Socket::AI_CANONNAME)
it 'sets the canonical name when AI_CANONNAME is given as a flag' do
array = Addrinfo.getaddrinfo('localhost', 80, nil, nil, nil, Socket::AI_CANONNAME)

array[0].canonname.should be_an_instance_of(String)
end
array[0].canonname.should be_an_instance_of(String)
end
end
6 changes: 3 additions & 3 deletions library/socket/addrinfo/initialize_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
end
end

platform_is_not :windows, :aix, :solaris do
platform_is_not :windows, :aix do
(Socket.constants.grep(/^IPPROTO/) - valid).each do |type|
it "raises SocketError when using #{type}" do
value = Socket.const_get(type)
Expand Down Expand Up @@ -390,7 +390,7 @@
end
end

platform_is_not :windows, :aix, :solaris do
platform_is_not :windows, :aix do
(Socket.constants.grep(/^IPPROTO/) - valid).each do |type|
it "raises SocketError when using #{type}" do
value = Socket.const_get(type)
Expand Down Expand Up @@ -495,7 +495,7 @@
end
end

platform_is_not :windows, :aix, :solaris do
platform_is_not :windows, :aix do
(Socket.constants.grep(/^IPPROTO/) - valid).each do |type|
it "raises SocketError when using #{type}" do
value = Socket.const_get(type)
Expand Down
6 changes: 2 additions & 4 deletions library/socket/addrinfo/marshal_dump_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@
@array[3].should == 'SOCK_STREAM'
end

platform_is_not :'solaris2.10' do # i386-solaris
it 'includes the protocol as the 5th value' do
@array[4].should == 'IPPROTO_TCP'
end
it 'includes the protocol as the 5th value' do
@array[4].should == 'IPPROTO_TCP'
end

it 'includes the canonical name as the 6th value' do
Expand Down
6 changes: 2 additions & 4 deletions library/socket/addrinfo/udp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@
Addrinfo.udp(ip_address, 80).socktype.should == Socket::SOCK_DGRAM
end

platform_is_not :solaris do
it 'sets the socket protocol' do
Addrinfo.udp(ip_address, 80).protocol.should == Socket::IPPROTO_UDP
end
it 'sets the socket protocol' do
Addrinfo.udp(ip_address, 80).protocol.should == Socket::IPPROTO_UDP
end
end
end
2 changes: 1 addition & 1 deletion library/socket/ancillarydata/initialize_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
Socket::AncillaryData.new(:INET, :SOCKET, :RIGHTS, '').type.should == Socket::SCM_RIGHTS
end

platform_is_not :"solaris2.10", :aix do
platform_is_not :aix do
it 'sets the type to SCM_TIMESTAMP when using :TIMESTAMP as the type argument' do
Socket::AncillaryData.new(:INET, :SOCKET, :TIMESTAMP, '').type.should == Socket::SCM_TIMESTAMP
end
Expand Down
2 changes: 1 addition & 1 deletion library/socket/ancillarydata/unix_rights_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
-> { data.unix_rights }.should raise_error(TypeError)
end

platform_is_not :"solaris2.10", :aix do
platform_is_not :aix do
it 'raises TypeError when the type is not SCM_RIGHTS' do
data = Socket::AncillaryData.new(:INET, :SOCKET, :TIMESTAMP, '')

Expand Down
36 changes: 17 additions & 19 deletions library/socket/basicsocket/recv_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,26 @@
ScratchPad.recorded.should == 'hello'
end

platform_is_not :solaris do
it "accepts flags to specify unusual receiving behaviour" do
t = Thread.new do
client = @server.accept
it "accepts flags to specify unusual receiving behaviour" do
t = Thread.new do
client = @server.accept

# in-band data (TCP), doesn't receive the flag.
ScratchPad.record client.recv(10)
# in-band data (TCP), doesn't receive the flag.
ScratchPad.record client.recv(10)

# this recv is important (TODO: explain)
client.recv(10)
client.close
end
Thread.pass while t.status and t.status != "sleep"
t.status.should_not be_nil

socket = TCPSocket.new('127.0.0.1', @port)
socket.send('helloU', Socket::MSG_OOB)
socket.shutdown(1)
t.join
socket.close
ScratchPad.recorded.should == 'hello'
# this recv is important (TODO: explain)
client.recv(10)
client.close
end
Thread.pass while t.status and t.status != "sleep"
t.status.should_not be_nil

socket = TCPSocket.new('127.0.0.1', @port)
socket.send('helloU', Socket::MSG_OOB)
socket.shutdown(1)
t.join
socket.close
ScratchPad.recorded.should == 'hello'
end

it "gets lines delimited with a custom separator" do
Expand Down
Loading