mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add platform guards for AIX
* Most of these seem OS bugs. * See https://rubyci.org/logs/rubyci.s3.amazonaws.com/aix71_ppc/ruby-trunk/log/20180905T103302Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a140f157b9
commit
ebff0059f4
6 changed files with 60 additions and 48 deletions
|
@ -2,11 +2,13 @@ require_relative '../spec_helper'
|
|||
|
||||
guard -> { SocketSpecs.ipv6_available? } do
|
||||
describe 'Addrinfo#ipv6_linklocal?' do
|
||||
it 'returns true for a link-local address' do
|
||||
Addrinfo.ip('fe80::').ipv6_linklocal?.should == true
|
||||
Addrinfo.ip('fe81::').ipv6_linklocal?.should == true
|
||||
Addrinfo.ip('fe8f::').ipv6_linklocal?.should == true
|
||||
Addrinfo.ip('fe80::1').ipv6_linklocal?.should == true
|
||||
platform_is_not :aix do
|
||||
it 'returns true for a link-local address' do
|
||||
Addrinfo.ip('fe80::').ipv6_linklocal?.should == true
|
||||
Addrinfo.ip('fe81::').ipv6_linklocal?.should == true
|
||||
Addrinfo.ip('fe8f::').ipv6_linklocal?.should == true
|
||||
Addrinfo.ip('fe80::1').ipv6_linklocal?.should == true
|
||||
end
|
||||
end
|
||||
|
||||
it 'returns false for a regular address' do
|
||||
|
|
|
@ -2,11 +2,13 @@ require_relative '../spec_helper'
|
|||
|
||||
guard -> { SocketSpecs.ipv6_available? } do
|
||||
describe 'Addrinfo#ipv6_sitelocal?' do
|
||||
it 'returns true for a site-local address' do
|
||||
Addrinfo.ip('feef::').ipv6_sitelocal?.should == true
|
||||
Addrinfo.ip('fee0::').ipv6_sitelocal?.should == true
|
||||
Addrinfo.ip('fee2::').ipv6_sitelocal?.should == true
|
||||
Addrinfo.ip('feef::1').ipv6_sitelocal?.should == true
|
||||
platform_is_not :aix do
|
||||
it 'returns true for a site-local address' do
|
||||
Addrinfo.ip('feef::').ipv6_sitelocal?.should == true
|
||||
Addrinfo.ip('fee0::').ipv6_sitelocal?.should == true
|
||||
Addrinfo.ip('fee2::').ipv6_sitelocal?.should == true
|
||||
Addrinfo.ip('feef::1').ipv6_sitelocal?.should == true
|
||||
end
|
||||
end
|
||||
|
||||
it 'returns false for a regular IPv6 address' do
|
||||
|
|
|
@ -11,31 +11,33 @@ guard -> { SocketSpecs.ipv6_available? } do
|
|||
addr.ip_address.should == '192.168.1.1'
|
||||
end
|
||||
|
||||
it 'returns an Addrinfo for ::0.0.1.1' do
|
||||
addr = Addrinfo.ip('::0.0.1.1').ipv6_to_ipv4
|
||||
platform_is_not :aix do
|
||||
it 'returns an Addrinfo for ::0.0.1.1' do
|
||||
addr = Addrinfo.ip('::0.0.1.1').ipv6_to_ipv4
|
||||
|
||||
addr.should be_an_instance_of(Addrinfo)
|
||||
addr.should be_an_instance_of(Addrinfo)
|
||||
|
||||
addr.afamily.should == Socket::AF_INET
|
||||
addr.ip_address.should == '0.0.1.1'
|
||||
end
|
||||
addr.afamily.should == Socket::AF_INET
|
||||
addr.ip_address.should == '0.0.1.1'
|
||||
end
|
||||
|
||||
it 'returns an Addrinfo for ::0.0.1.0' do
|
||||
addr = Addrinfo.ip('::0.0.1.0').ipv6_to_ipv4
|
||||
it 'returns an Addrinfo for ::0.0.1.0' do
|
||||
addr = Addrinfo.ip('::0.0.1.0').ipv6_to_ipv4
|
||||
|
||||
addr.should be_an_instance_of(Addrinfo)
|
||||
addr.should be_an_instance_of(Addrinfo)
|
||||
|
||||
addr.afamily.should == Socket::AF_INET
|
||||
addr.ip_address.should == '0.0.1.0'
|
||||
end
|
||||
addr.afamily.should == Socket::AF_INET
|
||||
addr.ip_address.should == '0.0.1.0'
|
||||
end
|
||||
|
||||
it 'returns an Addrinfo for ::0.1.0.0' do
|
||||
addr = Addrinfo.ip('::0.1.0.0').ipv6_to_ipv4
|
||||
it 'returns an Addrinfo for ::0.1.0.0' do
|
||||
addr = Addrinfo.ip('::0.1.0.0').ipv6_to_ipv4
|
||||
|
||||
addr.should be_an_instance_of(Addrinfo)
|
||||
addr.should be_an_instance_of(Addrinfo)
|
||||
|
||||
addr.afamily.should == Socket::AF_INET
|
||||
addr.ip_address.should == '0.1.0.0'
|
||||
addr.afamily.should == Socket::AF_INET
|
||||
addr.ip_address.should == '0.1.0.0'
|
||||
end
|
||||
end
|
||||
|
||||
it 'returns an Addrinfo for ::ffff:192.168.1.1' do
|
||||
|
|
|
@ -95,21 +95,23 @@ describe 'Socket#connect_address' do
|
|||
end
|
||||
|
||||
with_feature :unix_socket do
|
||||
describe 'using an unbound UNIX socket' do
|
||||
before do
|
||||
@path = SocketSpecs.socket_path
|
||||
@server = UNIXServer.new(@path)
|
||||
@client = UNIXSocket.new(@path)
|
||||
end
|
||||
platform_is_not :aix do
|
||||
describe 'using an unbound UNIX socket' do
|
||||
before do
|
||||
@path = SocketSpecs.socket_path
|
||||
@server = UNIXServer.new(@path)
|
||||
@client = UNIXSocket.new(@path)
|
||||
end
|
||||
|
||||
after do
|
||||
@client.close
|
||||
@server.close
|
||||
rm_r(@path)
|
||||
end
|
||||
after do
|
||||
@client.close
|
||||
@server.close
|
||||
rm_r(@path)
|
||||
end
|
||||
|
||||
it 'raises SocketError' do
|
||||
lambda { @client.connect_address }.should raise_error(SocketError)
|
||||
it 'raises SocketError' do
|
||||
lambda { @client.connect_address }.should raise_error(SocketError)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ describe 'Socket.gethostbyaddr' do
|
|||
end
|
||||
end
|
||||
|
||||
guard -> { SocketSpecs.ipv6_available? } do
|
||||
guard -> { SocketSpecs.ipv6_available? && platform_is_not(:aix) } do
|
||||
describe 'using an IPv6 address' do
|
||||
before do
|
||||
@addr = IPAddr.new('::1').hton
|
||||
|
|
|
@ -21,20 +21,24 @@ with_feature :unix_socket do
|
|||
end
|
||||
|
||||
describe 'the returned Addrinfo' do
|
||||
it 'uses AF_UNIX as the address family' do
|
||||
@client.local_address.afamily.should == Socket::AF_UNIX
|
||||
end
|
||||
platform_is_not :aix do
|
||||
it 'uses AF_UNIX as the address family' do
|
||||
@client.local_address.afamily.should == Socket::AF_UNIX
|
||||
end
|
||||
|
||||
it 'uses PF_UNIX as the protocol family' do
|
||||
@client.local_address.pfamily.should == Socket::PF_UNIX
|
||||
it 'uses PF_UNIX as the protocol family' do
|
||||
@client.local_address.pfamily.should == Socket::PF_UNIX
|
||||
end
|
||||
end
|
||||
|
||||
it 'uses SOCK_STREAM as the socket type' do
|
||||
@client.local_address.socktype.should == Socket::SOCK_STREAM
|
||||
end
|
||||
|
||||
it 'uses an empty socket path' do
|
||||
@client.local_address.unix_path.should == ''
|
||||
platform_is_not :aix do
|
||||
it 'uses an empty socket path' do
|
||||
@client.local_address.unix_path.should == ''
|
||||
end
|
||||
end
|
||||
|
||||
it 'uses 0 as the protocol' do
|
||||
|
|
Loading…
Reference in a new issue