fog 1.41.0 → 1.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/Rakefile +0 -3
- data/fog.gemspec +5 -6
- data/lib/fog/vcloud_director/requests/compute/post_power_on_vapp.rb +1 -1
- data/lib/fog/version.rb +1 -1
- data/lib/tasks/changelog_task.rb +2 -1
- data/lib/tasks/github_release_task.rb +1 -1
- data/tests/helpers/mock_helper.rb +0 -3
- metadata +19 -135
- data/lib/fog/bin/ovirt.rb +0 -28
- data/lib/fog/ovirt/compute.rb +0 -155
- data/lib/fog/ovirt/core.rb +0 -16
- data/lib/fog/ovirt/models/compute/affinity_group.rb +0 -25
- data/lib/fog/ovirt/models/compute/affinity_groups.rb +0 -20
- data/lib/fog/ovirt/models/compute/cluster.rb +0 -20
- data/lib/fog/ovirt/models/compute/clusters.rb +0 -20
- data/lib/fog/ovirt/models/compute/instance_type.rb +0 -39
- data/lib/fog/ovirt/models/compute/instance_types.rb +0 -20
- data/lib/fog/ovirt/models/compute/interface.rb +0 -19
- data/lib/fog/ovirt/models/compute/interfaces.rb +0 -29
- data/lib/fog/ovirt/models/compute/quota.rb +0 -16
- data/lib/fog/ovirt/models/compute/quotas.rb +0 -20
- data/lib/fog/ovirt/models/compute/server.rb +0 -175
- data/lib/fog/ovirt/models/compute/servers.rb +0 -27
- data/lib/fog/ovirt/models/compute/template.rb +0 -58
- data/lib/fog/ovirt/models/compute/templates.rb +0 -20
- data/lib/fog/ovirt/models/compute/volume.rb +0 -36
- data/lib/fog/ovirt/models/compute/volumes.rb +0 -28
- data/lib/fog/ovirt/requests/compute/add_interface.rb +0 -20
- data/lib/fog/ovirt/requests/compute/add_to_affinity_group.rb +0 -21
- data/lib/fog/ovirt/requests/compute/add_volume.rb +0 -21
- data/lib/fog/ovirt/requests/compute/attach_volume.rb +0 -22
- data/lib/fog/ovirt/requests/compute/create_affinity_group.rb +0 -18
- data/lib/fog/ovirt/requests/compute/create_vm.rb +0 -18
- data/lib/fog/ovirt/requests/compute/datacenters.rb +0 -20
- data/lib/fog/ovirt/requests/compute/destroy_affinity_group.rb +0 -19
- data/lib/fog/ovirt/requests/compute/destroy_interface.rb +0 -22
- data/lib/fog/ovirt/requests/compute/destroy_vm.rb +0 -19
- data/lib/fog/ovirt/requests/compute/destroy_volume.rb +0 -22
- data/lib/fog/ovirt/requests/compute/detach_volume.rb +0 -22
- data/lib/fog/ovirt/requests/compute/get_affinity_group.rb +0 -18
- data/lib/fog/ovirt/requests/compute/get_api_version.rb +0 -16
- data/lib/fog/ovirt/requests/compute/get_cluster.rb +0 -17
- data/lib/fog/ovirt/requests/compute/get_instance_type.rb +0 -17
- data/lib/fog/ovirt/requests/compute/get_quota.rb +0 -17
- data/lib/fog/ovirt/requests/compute/get_template.rb +0 -17
- data/lib/fog/ovirt/requests/compute/get_virtual_machine.rb +0 -17
- data/lib/fog/ovirt/requests/compute/list_affinity_group_vms.rb +0 -22
- data/lib/fog/ovirt/requests/compute/list_affinity_groups.rb +0 -20
- data/lib/fog/ovirt/requests/compute/list_clusters.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_instance_types.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_networks.rb +0 -16
- data/lib/fog/ovirt/requests/compute/list_quotas.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_template_interfaces.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_template_volumes.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_templates.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_virtual_machines.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_vm_interfaces.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_vm_volumes.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_volumes.rb +0 -19
- data/lib/fog/ovirt/requests/compute/mock_files/affinitygroup.xml +0 -8
- data/lib/fog/ovirt/requests/compute/mock_files/affinitygroup_vms.xml +0 -9
- data/lib/fog/ovirt/requests/compute/mock_files/affinitygroups.xml +0 -17
- data/lib/fog/ovirt/requests/compute/mock_files/cluster.xml +0 -20
- data/lib/fog/ovirt/requests/compute/mock_files/clusters.xml +0 -39
- data/lib/fog/ovirt/requests/compute/mock_files/data_centers.xml +0 -17
- data/lib/fog/ovirt/requests/compute/mock_files/disks.xml +0 -58
- data/lib/fog/ovirt/requests/compute/mock_files/instance_type.xml +0 -42
- data/lib/fog/ovirt/requests/compute/mock_files/instance_types.xml +0 -197
- data/lib/fog/ovirt/requests/compute/mock_files/nics.xml +0 -10
- data/lib/fog/ovirt/requests/compute/mock_files/quotas.xml +0 -7
- data/lib/fog/ovirt/requests/compute/mock_files/storage_domains.xml +0 -36
- data/lib/fog/ovirt/requests/compute/mock_files/template.xml +0 -39
- data/lib/fog/ovirt/requests/compute/mock_files/templates.xml +0 -110
- data/lib/fog/ovirt/requests/compute/mock_files/vm.xml +0 -52
- data/lib/fog/ovirt/requests/compute/mock_files/vms.xml +0 -152
- data/lib/fog/ovirt/requests/compute/mock_files/volumes.xml +0 -40
- data/lib/fog/ovirt/requests/compute/remove_from_affinity_group.rb +0 -21
- data/lib/fog/ovirt/requests/compute/storage_domains.rb +0 -20
- data/lib/fog/ovirt/requests/compute/update_interface.rb +0 -35
- data/lib/fog/ovirt/requests/compute/update_vm.rb +0 -18
- data/lib/fog/ovirt/requests/compute/update_volume.rb +0 -39
- data/lib/fog/ovirt/requests/compute/vm_action.rb +0 -22
- data/lib/fog/ovirt/requests/compute/vm_start_with_cloudinit.rb +0 -19
- data/lib/fog/ovirt/requests/compute/vm_ticket.rb +0 -17
- data/spec/fog/bin/ovirt_spec.rb +0 -10
- data/tests/ovirt/compute_tests.rb +0 -25
- data/tests/ovirt/models/compute/cluster_tests.rb +0 -31
- data/tests/ovirt/models/compute/clusters_tests.rb +0 -9
- data/tests/ovirt/models/compute/interface_tests.rb +0 -27
- data/tests/ovirt/models/compute/interfaces_tests.rb +0 -9
- data/tests/ovirt/models/compute/server_tests.rb +0 -51
- data/tests/ovirt/models/compute/servers_tests.rb +0 -14
- data/tests/ovirt/models/compute/template_tests.rb +0 -28
- data/tests/ovirt/models/compute/templates_tests.rb +0 -9
- data/tests/ovirt/requests/compute/create_vm_tests.rb +0 -26
- data/tests/ovirt/requests/compute/destroy_vm_tests.rb +0 -18
- data/tests/ovirt/requests/compute/list_datacenters_tests.rb +0 -13
- data/tests/ovirt/requests/compute/list_quotas_tests.rb +0 -12
- data/tests/ovirt/requests/compute/list_storage_domains_tests.rb +0 -13
- data/tests/ovirt/requests/compute/update_vm_tests.rb +0 -18
- data/tests/ovirt/requests/compute/update_volume_tests.rb +0 -20
data/spec/fog/bin/ovirt_spec.rb
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
Shindo.tests('Fog::Compute[:ovirt]', ['ovirt']) do
|
|
2
|
-
|
|
3
|
-
compute = Fog::Compute[:ovirt]
|
|
4
|
-
|
|
5
|
-
tests("Compute attributes") do
|
|
6
|
-
%w{ ovirt_attrs }.each do |attr|
|
|
7
|
-
test("it should respond to #{attr}") { compute.respond_to? attr }
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
tests("Compute collections") do
|
|
12
|
-
%w{ servers templates clusters interfaces }.each do |collection|
|
|
13
|
-
test("it should respond to #{collection}") { compute.respond_to? collection }
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
tests("Compute requests") do
|
|
18
|
-
%w{ add_interface create_vm datacenters destroy_interface destroy_vm get_cluster get_template
|
|
19
|
-
get_virtual_machine list_clusters list_networks list_template_interfaces list_templates
|
|
20
|
-
list_virtual_machines list_vm_interfaces storage_domains update_interface update_vm vm_action
|
|
21
|
-
api_version update_volume}.each do |collection|
|
|
22
|
-
test("it should respond to #{collection}") { compute.respond_to? collection }
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
Shindo.tests('Fog::Compute[:ovirt] | cluster model', ['ovirt']) do
|
|
2
|
-
|
|
3
|
-
clusters = Fog::Compute[:ovirt].clusters
|
|
4
|
-
cluster = clusters.last
|
|
5
|
-
|
|
6
|
-
tests('The cluster model should') do
|
|
7
|
-
tests('have the action') do
|
|
8
|
-
test('reload') { cluster.respond_to? 'reload' }
|
|
9
|
-
%w{ networks }.each do |action|
|
|
10
|
-
test(action) { cluster.respond_to? action }
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
tests('have attributes') do
|
|
14
|
-
model_attribute_hash = cluster.attributes
|
|
15
|
-
attributes = [ :id,
|
|
16
|
-
:name]
|
|
17
|
-
tests("The cluster model should respond to") do
|
|
18
|
-
attributes.each do |attribute|
|
|
19
|
-
test("#{attribute}") { cluster.respond_to? attribute }
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
tests("The attributes hash should have key") do
|
|
23
|
-
attributes.each do |attribute|
|
|
24
|
-
test("#{attribute}") { model_attribute_hash.key? attribute }
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
test('be a kind of Fog::Compute::Ovirt::Cluster') { cluster.kind_of? Fog::Compute::Ovirt::Cluster }
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
end
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
Shindo.tests('Fog::Compute[:ovirt] | clusters collection', ['ovirt']) do
|
|
2
|
-
|
|
3
|
-
clusters = Fog::Compute[:ovirt].clusters
|
|
4
|
-
|
|
5
|
-
tests('The clusters collection') do
|
|
6
|
-
test('should be a kind of Fog::Compute::Ovirt::Clusters') { clusters.kind_of? Fog::Compute::Ovirt::Clusters }
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
Shindo.tests('Fog::Compute[:ovirt] | interface model', ['ovirt']) do
|
|
2
|
-
|
|
3
|
-
interfaces = Fog::Compute[:ovirt].servers.last.interfaces
|
|
4
|
-
interface = interfaces.last
|
|
5
|
-
|
|
6
|
-
tests('The interface model should') do
|
|
7
|
-
tests('have the action') do
|
|
8
|
-
test('reload') { interface.respond_to? 'reload' }
|
|
9
|
-
end
|
|
10
|
-
tests('have attributes') do
|
|
11
|
-
model_attribute_hash = interface.attributes
|
|
12
|
-
attributes = [ :id, :name, :network]
|
|
13
|
-
tests("The interface model should respond to") do
|
|
14
|
-
attributes.each do |attribute|
|
|
15
|
-
test("#{attribute}") { interface.respond_to? attribute }
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
tests("The attributes hash should have key") do
|
|
19
|
-
attributes.each do |attribute|
|
|
20
|
-
test("#{attribute}") { model_attribute_hash.key? attribute }
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
test('be a kind of Fog::Compute::Ovirt::Interface') { interface.kind_of? Fog::Compute::Ovirt::Interface }
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
end
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
Shindo.tests('Fog::Compute[:ovirt] | interfaces collection', ['ovirt']) do
|
|
2
|
-
|
|
3
|
-
interfaces = Fog::Compute[:ovirt].interfaces
|
|
4
|
-
|
|
5
|
-
tests('The interfaces collection') do
|
|
6
|
-
test('should be a kind of Fog::Compute::Ovirt::Interfaces') { interfaces.kind_of? Fog::Compute::Ovirt::Interfaces }
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
end
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
Shindo.tests('Fog::Compute[:ovirt] | server model', ['ovirt']) do
|
|
2
|
-
|
|
3
|
-
servers = Fog::Compute[:ovirt].servers
|
|
4
|
-
server = servers.last
|
|
5
|
-
|
|
6
|
-
tests('The server model should') do
|
|
7
|
-
tests('have the action') do
|
|
8
|
-
test('reload') { server.respond_to? 'reload' }
|
|
9
|
-
%w{ start stop destroy reboot suspend }.each do |action|
|
|
10
|
-
test(action) { server.respond_to? action }
|
|
11
|
-
end
|
|
12
|
-
%w{ start reboot suspend stop }.each do |action|
|
|
13
|
-
test("#{action} returns successfully") {
|
|
14
|
-
begin
|
|
15
|
-
server.send(action.to_sym) ? true : false
|
|
16
|
-
rescue OVIRT::OvirtException
|
|
17
|
-
#ovirt exceptions are acceptable for the above actions.
|
|
18
|
-
true
|
|
19
|
-
end
|
|
20
|
-
}
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
tests('have attributes') do
|
|
24
|
-
model_attribute_hash = server.attributes
|
|
25
|
-
attributes = [ :id,
|
|
26
|
-
:name,
|
|
27
|
-
:description,
|
|
28
|
-
:profile,
|
|
29
|
-
:display,
|
|
30
|
-
:creation_time,
|
|
31
|
-
:os,
|
|
32
|
-
:status,
|
|
33
|
-
:cores,
|
|
34
|
-
:memory,
|
|
35
|
-
:cluster,
|
|
36
|
-
:template]
|
|
37
|
-
tests("The server model should respond to") do
|
|
38
|
-
attributes.each do |attribute|
|
|
39
|
-
test("#{attribute}") { server.respond_to? attribute }
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
tests("The attributes hash should have key") do
|
|
43
|
-
attributes.each do |attribute|
|
|
44
|
-
test("#{attribute}") { model_attribute_hash.key? attribute }
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
test('be a kind of Fog::Compute::Ovirt::Server') { server.kind_of? Fog::Compute::Ovirt::Server }
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
Shindo.tests('Fog::Compute[:ovirt] | servers collection', ['ovirt']) do
|
|
2
|
-
|
|
3
|
-
servers = Fog::Compute[:ovirt].servers
|
|
4
|
-
|
|
5
|
-
tests('The servers collection') do
|
|
6
|
-
test('should not be empty') { not servers.empty? }
|
|
7
|
-
test('should be a kind of Fog::Compute::Ovirt::Servers') { servers.kind_of? Fog::Compute::Ovirt::Servers }
|
|
8
|
-
tests('should be able to reload itself').succeeds { servers.reload }
|
|
9
|
-
tests('should be able to get a model') do
|
|
10
|
-
tests('by instance uuid').succeeds { servers.get servers.first.id }
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
Shindo.tests('Fog::Compute[:ovirt] | template model', ['ovirt']) do
|
|
2
|
-
|
|
3
|
-
templates = Fog::Compute[:ovirt].templates
|
|
4
|
-
template = templates.last
|
|
5
|
-
|
|
6
|
-
tests('The template model should') do
|
|
7
|
-
tests('have the action') do
|
|
8
|
-
test('reload') { template.respond_to? 'reload' }
|
|
9
|
-
end
|
|
10
|
-
tests('have attributes') do
|
|
11
|
-
model_attribute_hash = template.attributes
|
|
12
|
-
attributes = [ :id,
|
|
13
|
-
:name]
|
|
14
|
-
tests("The template model should respond to") do
|
|
15
|
-
attributes.each do |attribute|
|
|
16
|
-
test("#{attribute}") { template.respond_to? attribute }
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
tests("The attributes hash should have key") do
|
|
20
|
-
attributes.each do |attribute|
|
|
21
|
-
test("#{attribute}") { model_attribute_hash.key? attribute }
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
test('be a kind of Fog::Compute::Ovirt::Template') { template.kind_of? Fog::Compute::Ovirt::Template }
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
end
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
Shindo.tests('Fog::Compute[:ovirt] | templates collection', ['ovirt']) do
|
|
2
|
-
|
|
3
|
-
templates = Fog::Compute[:ovirt].templates
|
|
4
|
-
|
|
5
|
-
tests('The templates collection') do
|
|
6
|
-
test('should be a kind of Fog::Compute::Ovirt::Templates') { templates.kind_of? Fog::Compute::Ovirt::Templates }
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
end
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
Shindo.tests("Fog::Compute[:ovirt] | vm_create request", 'ovirt') do
|
|
2
|
-
|
|
3
|
-
compute = Fog::Compute[:ovirt]
|
|
4
|
-
name_base = Time.now.to_i
|
|
5
|
-
|
|
6
|
-
tests("Create VM") do
|
|
7
|
-
response = compute.create_vm(:name => 'fog-'+name_base.to_s, :cluster_name => 'Default')
|
|
8
|
-
test("should be a kind of OVIRT::VM") { response.kind_of? OVIRT::VM}
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
tests("Create VM from template (clone)") do
|
|
12
|
-
response = compute.create_vm(:name => 'fog-'+(name_base+ 1).to_s, :template_name => 'hwp_small', :cluster_name => 'Default')
|
|
13
|
-
test("should be a kind of OVIRT::VM") { response.kind_of? OVIRT::VM}
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
tests("Fail Creating VM") do
|
|
17
|
-
begin
|
|
18
|
-
response = compute.create_vm(:name => 'fog-'+name_base.to_s, :cluster_name => 'Default')
|
|
19
|
-
test("should be a kind of OVIRT::VM") { response.kind_of? OVIRT::VM} #mock never raise exceptions
|
|
20
|
-
rescue => e
|
|
21
|
-
#should raise vm name already exist exception.
|
|
22
|
-
test("error should be a kind of OVIRT::OvirtException") { e.kind_of? OVIRT::OvirtException}
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
Shindo.tests('Fog::Compute[:ovirt] | vm_destroy request', ['ovirt']) do
|
|
2
|
-
|
|
3
|
-
compute = Fog::Compute[:ovirt]
|
|
4
|
-
if compute.servers.all(:search => 'fog-*').empty?
|
|
5
|
-
compute.create_vm(:name => 'fog-'+Time.now.to_i.to_s, :cluster_name => 'Default')
|
|
6
|
-
end
|
|
7
|
-
vm_id = compute.servers.all(:search => 'fog-*').last.id
|
|
8
|
-
|
|
9
|
-
tests('The response should') do
|
|
10
|
-
response = compute.destroy_vm(:id => vm_id)
|
|
11
|
-
test('be a success') { response ? true: false }
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
tests('The expected options') do
|
|
15
|
-
raises(ArgumentError, 'raises ArgumentError when id option is missing') { compute.destroy_vm }
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
Shindo.tests('Fog::Compute[:ovirt] | datacenters request', ['ovirt']) do
|
|
2
|
-
|
|
3
|
-
compute = Fog::Compute[:ovirt]
|
|
4
|
-
|
|
5
|
-
tests("When listing all datacenters") do
|
|
6
|
-
|
|
7
|
-
response = compute.datacenters
|
|
8
|
-
tests("The response data format ...") do
|
|
9
|
-
test("it should be a kind of Array") { response.kind_of? Array }
|
|
10
|
-
test("be a kind of Hash") { response.first.kind_of? Hash }
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Shindo.tests('Fog::Compute[:ovirt] | quotas request', ['ovirt']) do
|
|
2
|
-
|
|
3
|
-
compute = Fog::Compute[:ovirt]
|
|
4
|
-
|
|
5
|
-
tests("When listing all quotas") do
|
|
6
|
-
|
|
7
|
-
response = compute.quotas
|
|
8
|
-
tests("The response data format ...") do
|
|
9
|
-
test("it should be a kind of Array") { response.kind_of? Array }
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
Shindo.tests('Fog::Compute[:ovirt] | storage_domains request', ['ovirt']) do
|
|
2
|
-
|
|
3
|
-
compute = Fog::Compute[:ovirt]
|
|
4
|
-
|
|
5
|
-
tests("When listing all storage_domains") do
|
|
6
|
-
|
|
7
|
-
response = compute.storage_domains
|
|
8
|
-
tests("The response data format ...") do
|
|
9
|
-
test("it should be a kind of Array") { response.kind_of? Array }
|
|
10
|
-
test("be a kind of OVIRT::StorageDomain") { response.first.kind_of? OVIRT::StorageDomain }
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
Shindo.tests('Fog::Compute[:ovirt] | vm_update request', ['ovirt']) do
|
|
2
|
-
|
|
3
|
-
compute = Fog::Compute[:ovirt]
|
|
4
|
-
if compute.servers.all(:search => 'fog-*').empty?
|
|
5
|
-
compute.create_vm(:name => 'fog-'+Time.now.to_i.to_s, :cluster_name => 'Default')
|
|
6
|
-
end
|
|
7
|
-
vm = compute.servers.all(:search => 'fog-*').last
|
|
8
|
-
|
|
9
|
-
tests('The response should') do
|
|
10
|
-
response = compute.update_vm(:id => vm.id, :name => vm.name + 'updated')
|
|
11
|
-
test("be a kind of OVIRT::VM") { response.kind_of? OVIRT::VM}
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
tests('The expected options') do
|
|
15
|
-
raises(ArgumentError, 'raises ArgumentError when id option is missing') { compute.update_vm }
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
end
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
Shindo.tests('Fog::Compute[:ovirt] | update_volume request', ['ovirt']) do
|
|
2
|
-
|
|
3
|
-
compute = Fog::Compute[:ovirt]
|
|
4
|
-
if compute.servers.all(:search => 'fog-*').empty?
|
|
5
|
-
compute.create_vm(:name => 'fog-'+Time.now.to_i.to_s, :cluster_name => 'Default')
|
|
6
|
-
end
|
|
7
|
-
vm_id = compute.servers.all(:search => 'fog-*').last
|
|
8
|
-
|
|
9
|
-
tests('The expected options') do
|
|
10
|
-
raises(ArgumentError, 'raises ArgumentError when vm id is missing') { compute.update_volume(nil, {:id => 1}) }
|
|
11
|
-
raises(ArgumentError, 'raises ArgumentError when disk_id option is missing') { compute.update_volume(1, {:any => 1}) }
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
tests('The response should') do
|
|
15
|
-
response = compute.update_volume(vm_id, :id => 1)
|
|
16
|
-
test('be a success') { response ? true: false }
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
end
|