1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

linked clone tests

This commit is contained in:
Eric Stonfer 2012-01-17 22:58:08 -05:00
parent cd682ba89c
commit a318c9a239

View file

@ -1,8 +1,11 @@
Shindo.tests("Fog::Compute[:vsphere] | vm_clone request", 'vsphere') do
#require 'guid'
template = "/Datacenters/Solutions/vm/Jeff/Templates/centos56gm2"
compute = Fog::Compute[:vsphere]
response = nil
response_linked = nil
template = "/Datacenters/Solutions/vm/Jeff/Templates/centos56gm2"
tests("Standard Clone | The return value should") do
response = compute.vm_clone('path' => template, 'name' => 'cloning_vm', 'wait' => 1)
test("be a kind of Hash") { response.kind_of? Hash }
@ -12,13 +15,13 @@ Shindo.tests("Fog::Compute[:vsphere] | vm_clone request", 'vsphere') do
end
template = "/Datacenters/Solutions/vm/Jeff/Templates/cloning_vm"
tests("Linked Clone | The return value should") do
response_linked = compute.vm_clone('path' => template, 'name' => 'cloning_vm', 'wait' => 1)
response_linked = compute.vm_clone('path' => template, 'name' => 'cloning_vm_linked', 'wait' => 1)
test("be a kind of Hash") { response_linked.kind_of? Hash }
%w{ vm_ref task_ref }.each do |key|
test("have a #{key} key") { response_linked.has_key? key }
end
end
## clean up afterward as in the aws tests. remove the source first and then the linked clone
## clean up afterward as in the aws tests.
compute.vm_power_off('uuid' => response_linked['vm_attributes']['uuid'], 'instance_uuid' => response_linked['vm_attributes']['instance_uuid'], 'force' => 1)
compute.vm_destroy('instance_uuid' => response_linked['vm_attributes']['instance_uuid'])
compute.vm_power_off('uuid' => response['vm_attributes']['uuid'], 'instance_uuid' => response['vm_attributes']['instance_uuid'], 'force' => 1)