1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/digitalocean/models/compute/server_tests.rb
Paul Thornthwaite f08b2e0277 Disable ALL DigitalOcean tests until fixed
There appears to be a glitch in the test suite such that running
`bundle exec rake travis` passes locally without executing the DO tests
but they are running on Travis itself.

So fed up playing whackamole with failures. They are off until the
broken code is fixed.

See https://github.com/fog/fog/pull/3304

This reverts commit 9b7b8fd490.
This reverts commit fa9254ba8d.
2014-12-10 09:59:57 +00:00

93 lines
2 KiB
Ruby

Shindo.tests("Fog::Compute[:digitalocean] | server model", ['digitalocean', 'compute']) do
server = fog_test_server
tests('The server model should') do
tests('have the action') do
test('reload') { server.respond_to? 'reload' }
%w{
shutdown
reboot
power_cycle
stop
start
}.each do |action|
test(action) { server.respond_to? action }
end
end
tests('have attributes') do
model_attribute_hash = server.attributes
attributes = [
:id,
:name,
:state,
:backups_active,
:public_ip_address,
:private_ip_address,
:flavor_id,
:region_id,
:image_id,
:created_at,
:ssh_keys=
]
tests("The server model should respond to") do
attributes.each do |attribute|
test("#{attribute}") { server.respond_to? attribute }
end
end
end
test('#reboot') do
pending if Fog.mocking?
server.reboot
server.wait_for { server.state == 'off' }
server.state == 'off'
end
test('#power_cycle') do
pending if Fog.mocking?
server.wait_for { server.ready? }
server.power_cycle
server.wait_for { server.state == 'off' }
server.state == 'off'
end
test('#stop') do
server.stop
server.wait_for { server.state == 'off' }
server.state == 'off'
end
test('#start') do
server.start
server.wait_for { ready? }
server.ready?
end
# DigitalOcean shutdown is unreliable
# so disable it in real mode for now
test('#shutdown') do
pending unless Fog.mocking?
server.start
server.wait_for { server.ready? }
server.shutdown
server.wait_for { server.state == 'off' }
server.state == 'off'
end
test('#update') do
begin
server.update
rescue NotImplementedError => e
true
end
end
end
# restore server state
server.start
server.wait_for { ready? }
end