2013-02-26 13:40:42 -05:00
|
|
|
Shindo.tests('Fog::Compute[:digitalocean] | servers collection', ['digitalocean']) do
|
2013-07-10 20:41:12 -04:00
|
|
|
service = Fog::Compute[:digitalocean]
|
2013-02-26 13:40:42 -05:00
|
|
|
|
2013-07-10 20:41:12 -04:00
|
|
|
options = {
|
|
|
|
:name => "#{fog_server_name}-#{Time.now.to_i.to_s}"
|
|
|
|
}.merge fog_test_server_attributes
|
2013-02-26 13:40:42 -05:00
|
|
|
|
2013-12-27 15:02:38 -05:00
|
|
|
public_key_path = File.join(File.dirname(__FILE__), '../../fixtures/id_rsa.pub')
|
|
|
|
private_key_path = File.join(File.dirname(__FILE__), '../../fixtures/id_rsa')
|
|
|
|
|
2014-03-12 13:41:58 -04:00
|
|
|
# Collection tests are consistently timing out on Travis wasting people's time and resources
|
|
|
|
pending if Fog.mocking?
|
|
|
|
|
2013-07-10 20:41:12 -04:00
|
|
|
collection_tests(service.servers, options, true) do
|
|
|
|
@instance.wait_for { ready? }
|
2013-02-26 13:40:42 -05:00
|
|
|
end
|
|
|
|
|
2013-12-27 15:02:38 -05:00
|
|
|
tests("#bootstrap with public/private_key_path").succeeds do
|
2013-07-21 14:09:53 -04:00
|
|
|
pending if Fog.mocking?
|
|
|
|
@server = service.servers.bootstrap({
|
2013-12-27 15:02:38 -05:00
|
|
|
:public_key_path => public_key_path,
|
|
|
|
:private_key_path => private_key_path
|
2013-07-21 14:09:53 -04:00
|
|
|
}.merge(options))
|
2013-12-27 15:02:38 -05:00
|
|
|
@server.destroy
|
2013-07-21 14:09:53 -04:00
|
|
|
end
|
|
|
|
|
2013-12-27 15:02:38 -05:00
|
|
|
tests("#bootstrap with public/private_key").succeeds do
|
|
|
|
pending if Fog.mocking?
|
|
|
|
@server = service.servers.bootstrap({
|
|
|
|
:public_key => File.read(public_key_path),
|
|
|
|
:private_key => File.read(private_key_path)
|
|
|
|
}.merge(options))
|
|
|
|
@server.destroy
|
|
|
|
end
|
|
|
|
|
|
|
|
tests("#bootstrap with no public/private keys") do
|
|
|
|
raises(ArgumentError, 'raises ArgumentError') { service.servers.bootstrap(options) }
|
|
|
|
end
|
2013-02-26 13:40:42 -05:00
|
|
|
end
|