1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/google/models/compute/server_tests.rb
Ferran Rodenas 918d9bc8d6 [google|compute] Update Servers support
- Add missing "Server" properties
- Remove unnecessary property aliases
- When destroying a "Server" asyncronously return the "Operation" model instead of the raw operation response
- If zone is not set on "all" and "get" methods, use the list aggregated servers request (1 API call) instead of fetching all zones
- Add "list_aggregated_servers" request
- Fix "attach_disk" request
- Fix "detach_disk" request
- Add "get_server_serial_port_output" request
- Add "reset_server" request
- Add "set_server_disk_auto_delete" request
- Add "set_server_scheduling" request
- Add "add_server_access_config" request
- Add "delete_server_access_config" request
- Fix "set_tags" request
2014-04-20 20:55:08 -07:00

31 lines
877 B
Ruby

Shindo.tests("Fog::Compute[:google] | server model", ['google']) do
@zone = 'us-central1-a'
@disk = create_test_disk(Fog::Compute[:google], @zone)
model_tests(Fog::Compute[:google].servers, {:name => 'fogservername', :zone_name => @zone, :machine_type => 'n1-standard-1', :disks => [@disk]})
tests('servers') do
@instance = nil
test('#bootstrap') do
attributes = Fog.mocking? ? {:public_key_path => nil, :private_key_path => nil} : {}
@instance = Fog::Compute[:google].servers.bootstrap(attributes)
@instance.ready?
end
test('#sshable?') do
@instance.wait_for { sshable? }
@instance.sshable?
end
test('#ssh') do
pending if Fog.mocking?
@instance.ssh("uname") == "Linux"
end
test('#destroy') do
response = @instance.destroy
response.operation_type == 'delete'
end
end
end