2011-01-03 13:34:08 -08:00
|
|
|
for provider, config in compute_providers
|
2012-05-08 16:56:23 +01:00
|
|
|
Shindo.tests("Fog::Compute[:#{provider}] | server", [provider.to_s]) do
|
2011-01-03 13:34:08 -08:00
|
|
|
|
2012-12-20 14:54:02 -06:00
|
|
|
provider_attributes = config[:provider_attributes] || {}
|
|
|
|
provider_attributes.merge!(:provider => provider)
|
|
|
|
server_tests(Fog::Compute.new(provider_attributes), (config[:server_attributes] || {}), config[:mocked]) do
|
2011-02-22 16:36:15 -08:00
|
|
|
|
2011-03-11 13:06:44 -08:00
|
|
|
if Fog.mocking? && !config[:mocked]
|
|
|
|
pending
|
|
|
|
else
|
|
|
|
responds_to(:public_ip_address)
|
|
|
|
responds_to(:scp)
|
|
|
|
responds_to(:ssh)
|
2011-02-24 16:55:18 -08:00
|
|
|
end
|
|
|
|
|
2014-01-22 11:38:31 -06:00
|
|
|
tests('ssh_ip_address') do
|
|
|
|
tests('defaults to public_ip_address').returns(true) do
|
|
|
|
@instance.ssh_ip_address == @instance.public_ip_address
|
|
|
|
end
|
2014-01-24 08:30:00 -06:00
|
|
|
tests('ssh_ip_address overrides default with Proc').returns(true) do
|
|
|
|
ip_address = '5.5.5.5'
|
|
|
|
@instance.ssh_ip_address = Proc.new {|server| ip_address }
|
|
|
|
@instance.ssh_ip_address == ip_address
|
|
|
|
end
|
|
|
|
tests('Proc yields server').returns(true) do
|
|
|
|
@instance.ssh_ip_address = Proc.new {|server| server }
|
|
|
|
@instance.ssh_ip_address == @instance
|
|
|
|
end
|
|
|
|
tests('ssh_ip_address overrides default with String').returns(true) do
|
2014-01-22 11:38:31 -06:00
|
|
|
ip_address = '5.5.5.5'
|
|
|
|
@instance.ssh_ip_address = ip_address
|
|
|
|
@instance.ssh_ip_address == ip_address
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-02-22 16:36:15 -08:00
|
|
|
end
|
2011-01-03 13:34:08 -08:00
|
|
|
|
|
|
|
end
|
|
|
|
end
|