mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
92ccbb9e10
* Allows specifying public_key and private_key rather than public_key_path and private_key_path. Useful for Heroku where you don't have direct access to the filesystem and need to specify keys in environment variables.
36 lines
1.2 KiB
Ruby
36 lines
1.2 KiB
Ruby
Shindo.tests('Fog::Compute[:digitalocean] | servers collection', ['digitalocean']) do
|
|
service = Fog::Compute[:digitalocean]
|
|
|
|
options = {
|
|
:name => "#{fog_server_name}-#{Time.now.to_i.to_s}"
|
|
}.merge fog_test_server_attributes
|
|
|
|
public_key_path = File.join(File.dirname(__FILE__), '../../fixtures/id_rsa.pub')
|
|
private_key_path = File.join(File.dirname(__FILE__), '../../fixtures/id_rsa')
|
|
|
|
collection_tests(service.servers, options, true) do
|
|
@instance.wait_for { ready? }
|
|
end
|
|
|
|
tests("#bootstrap with public/private_key_path").succeeds do
|
|
pending if Fog.mocking?
|
|
@server = service.servers.bootstrap({
|
|
:public_key_path => public_key_path,
|
|
:private_key_path => private_key_path
|
|
}.merge(options))
|
|
@server.destroy
|
|
end
|
|
|
|
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
|
|
end
|