fog-ovirt 0.1.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +20 -0
- data/.rubocop_todo.yml +43 -0
- data/.travis.yml +3 -1
- data/Gemfile +1 -1
- data/Rakefile +15 -5
- data/fog-ovirt.gemspec +15 -14
- data/lib/fog/bin/ovirt.rb +1 -1
- data/lib/fog/ovirt.rb +1 -1
- data/lib/fog/ovirt/compute.rb +56 -112
- data/lib/fog/ovirt/compute/v3.rb +137 -0
- data/lib/fog/ovirt/core.rb +13 -4
- data/lib/fog/ovirt/models/compute/affinity_group.rb +2 -2
- data/lib/fog/ovirt/models/compute/affinity_groups.rb +2 -2
- data/lib/fog/ovirt/models/compute/clusters.rb +2 -2
- data/lib/fog/ovirt/models/compute/instance_types.rb +2 -2
- data/lib/fog/ovirt/models/compute/interfaces.rb +7 -5
- data/lib/fog/ovirt/models/compute/operating_systems.rb +3 -3
- data/lib/fog/ovirt/models/compute/quotas.rb +3 -3
- data/lib/fog/ovirt/models/compute/server.rb +37 -31
- data/lib/fog/ovirt/models/compute/servers.rb +2 -2
- data/lib/fog/ovirt/models/compute/template.rb +9 -9
- data/lib/fog/ovirt/models/compute/templates.rb +2 -2
- data/lib/fog/ovirt/models/compute/volume.rb +3 -3
- data/lib/fog/ovirt/models/compute/volumes.rb +6 -4
- data/lib/fog/ovirt/requests/compute/v3/activate_volume.rb +23 -0
- data/lib/fog/ovirt/requests/compute/v3/add_interface.rb +22 -0
- data/lib/fog/ovirt/requests/compute/v3/add_to_affinity_group.rb +23 -0
- data/lib/fog/ovirt/requests/compute/v3/add_volume.rb +23 -0
- data/lib/fog/ovirt/requests/compute/v3/attach_volume.rb +24 -0
- data/lib/fog/ovirt/requests/compute/v3/create_affinity_group.rb +20 -0
- data/lib/fog/ovirt/requests/compute/v3/create_vm.rb +20 -0
- data/lib/fog/ovirt/requests/compute/v3/datacenters.rb +22 -0
- data/lib/fog/ovirt/requests/compute/v3/deactivate_volume.rb +24 -0
- data/lib/fog/ovirt/requests/compute/v3/destroy_affinity_group.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/destroy_interface.rb +24 -0
- data/lib/fog/ovirt/requests/compute/v3/destroy_vm.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/destroy_volume.rb +24 -0
- data/lib/fog/ovirt/requests/compute/v3/detach_volume.rb +24 -0
- data/lib/fog/ovirt/requests/compute/v3/get_affinity_group.rb +20 -0
- data/lib/fog/ovirt/requests/compute/v3/get_api_version.rb +18 -0
- data/lib/fog/ovirt/requests/compute/v3/get_cluster.rb +19 -0
- data/lib/fog/ovirt/requests/compute/v3/get_instance_type.rb +19 -0
- data/lib/fog/ovirt/requests/compute/v3/get_quota.rb +19 -0
- data/lib/fog/ovirt/requests/compute/v3/get_template.rb +19 -0
- data/lib/fog/ovirt/requests/compute/v3/get_virtual_machine.rb +19 -0
- data/lib/fog/ovirt/requests/compute/v3/list_affinity_group_vms.rb +24 -0
- data/lib/fog/ovirt/requests/compute/v3/list_affinity_groups.rb +22 -0
- data/lib/fog/ovirt/requests/compute/v3/list_clusters.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_instance_types.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_networks.rb +18 -0
- data/lib/fog/ovirt/requests/compute/v3/list_operating_systems.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_quotas.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_template_interfaces.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_template_volumes.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_templates.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_virtual_machines.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_vm_interfaces.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_vm_volumes.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_volumes.rb +21 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/affinitygroup.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/affinitygroup_vms.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/affinitygroups.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/cluster.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/clusters.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/data_centers.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/disks.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/instance_type.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/instance_types.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/nics.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/operating_systems.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/quotas.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/storage_domains.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/template.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/templates.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/vm.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/vms.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/volumes.xml +0 -0
- data/lib/fog/ovirt/requests/compute/v3/remove_from_affinity_group.rb +23 -0
- data/lib/fog/ovirt/requests/compute/v3/storage_domains.rb +22 -0
- data/lib/fog/ovirt/requests/compute/v3/update_interface.rb +36 -0
- data/lib/fog/ovirt/requests/compute/v3/update_vm.rb +20 -0
- data/lib/fog/ovirt/requests/compute/v3/update_volume.rb +37 -0
- data/lib/fog/ovirt/requests/compute/v3/vm_action.rb +24 -0
- data/lib/fog/ovirt/requests/compute/v3/vm_start_with_cloudinit.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/vm_ticket.rb +19 -0
- data/lib/fog/ovirt/version.rb +1 -1
- data/tests/helper.rb +1 -1
- data/tests/helpers/mock_helper.rb +4 -6
- data/tests/helpers/succeeds_helper.rb +1 -1
- data/tests/ovirt/compute_tests.rb +5 -6
- data/tests/ovirt/models/compute/cluster_tests.rb +10 -13
- data/tests/ovirt/models/compute/clusters_tests.rb +3 -5
- data/tests/ovirt/models/compute/interface_tests.rb +9 -11
- data/tests/ovirt/models/compute/interfaces_tests.rb +3 -5
- data/tests/ovirt/models/compute/operating_system_tests.rb +7 -13
- data/tests/ovirt/models/compute/operating_systems_tests.rb +4 -6
- data/tests/ovirt/models/compute/server_tests.rb +29 -32
- data/tests/ovirt/models/compute/servers_tests.rb +7 -9
- data/tests/ovirt/models/compute/template_tests.rb +10 -12
- data/tests/ovirt/models/compute/templates_tests.rb +3 -5
- data/tests/ovirt/requests/compute/client_tests.rb +31 -0
- data/tests/ovirt/requests/compute/create_vm_tests.rb +7 -16
- data/tests/ovirt/requests/compute/destroy_vm_tests.rb +8 -10
- data/tests/ovirt/requests/compute/list_datacenters_tests.rb +3 -5
- data/tests/ovirt/requests/compute/list_quotas_tests.rb +2 -4
- data/tests/ovirt/requests/compute/list_storage_domains_tests.rb +3 -5
- data/tests/ovirt/requests/compute/update_vm_tests.rb +9 -11
- data/tests/ovirt/requests/compute/update_volume_tests.rb +9 -12
- metadata +70 -65
- data/lib/fog/ovirt/requests/compute/activate_volume.rb +0 -22
- 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/deactivate_volume.rb +0 -22
- 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_operating_systems.rb +0 -19
- 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/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
@@ -1,14 +1,12 @@
|
|
1
|
-
Shindo.tests(
|
2
|
-
|
1
|
+
Shindo.tests("Fog::Compute[:ovirt] | servers collection", ["ovirt"]) do
|
3
2
|
servers = Fog::Compute[:ovirt].servers
|
4
3
|
|
5
|
-
tests(
|
6
|
-
test(
|
7
|
-
test(
|
8
|
-
tests(
|
9
|
-
tests(
|
10
|
-
tests(
|
4
|
+
tests("The servers collection") do
|
5
|
+
test("should not be empty") { !servers.empty? }
|
6
|
+
test("should be a kind of Fog::Compute::Ovirt::Servers") { servers.is_a? Fog::Compute::Ovirt::Servers }
|
7
|
+
tests("should be able to reload itself").succeeds { servers.reload }
|
8
|
+
tests("should be able to get a model") do
|
9
|
+
tests("by instance uuid").succeeds { servers.get servers.first.id }
|
11
10
|
end
|
12
11
|
end
|
13
|
-
|
14
12
|
end
|
@@ -1,28 +1,26 @@
|
|
1
|
-
Shindo.tests(
|
2
|
-
|
1
|
+
Shindo.tests("Fog::Compute[:ovirt] | template model", ["ovirt"]) do
|
3
2
|
templates = Fog::Compute[:ovirt].templates
|
4
3
|
template = templates.last
|
5
4
|
|
6
|
-
tests(
|
7
|
-
tests(
|
8
|
-
test(
|
5
|
+
tests("The template model should") do
|
6
|
+
tests("have the action") do
|
7
|
+
test("reload") { template.respond_to? "reload" }
|
9
8
|
end
|
10
|
-
tests(
|
9
|
+
tests("have attributes") do
|
11
10
|
model_attribute_hash = template.attributes
|
12
|
-
attributes = [
|
13
|
-
|
11
|
+
attributes = %i[id name]
|
12
|
+
|
14
13
|
tests("The template model should respond to") do
|
15
14
|
attributes.each do |attribute|
|
16
|
-
test(
|
15
|
+
test(attribute.to_s) { template.respond_to? attribute }
|
17
16
|
end
|
18
17
|
end
|
19
18
|
tests("The attributes hash should have key") do
|
20
19
|
attributes.each do |attribute|
|
21
|
-
test(
|
20
|
+
test(attribute.to_s) { model_attribute_hash.key? attribute }
|
22
21
|
end
|
23
22
|
end
|
24
23
|
end
|
25
|
-
test(
|
24
|
+
test("be a kind of Fog::Compute::Ovirt::Template") { template.is_a? Fog::Compute::Ovirt::Template }
|
26
25
|
end
|
27
|
-
|
28
26
|
end
|
@@ -1,9 +1,7 @@
|
|
1
|
-
Shindo.tests(
|
2
|
-
|
1
|
+
Shindo.tests("Fog::Compute[:ovirt] | templates collection", ["ovirt"]) do
|
3
2
|
templates = Fog::Compute[:ovirt].templates
|
4
3
|
|
5
|
-
tests(
|
6
|
-
test(
|
4
|
+
tests("The templates collection") do
|
5
|
+
test("should be a kind of Fog::Compute::Ovirt::Templates") { templates.is_a? Fog::Compute::Ovirt::Templates }
|
7
6
|
end
|
8
|
-
|
9
7
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
Shindo.tests("Fog::Compute[:ovirt] | client", ["ovirt"]) do
|
2
|
+
before do
|
3
|
+
@client_mock = Object.new
|
4
|
+
def @client_mock.foo
|
5
|
+
raise OVIRT::OvirtException, "Test"
|
6
|
+
end
|
7
|
+
|
8
|
+
@object_under_test = Fog::Compute::Ovirt::ExceptionWrapper.new(@client_mock)
|
9
|
+
end
|
10
|
+
|
11
|
+
tests("Raises the right type of exception")
|
12
|
+
.raises(Fog::Ovirt::Errors::OvirtEngineError) do
|
13
|
+
@object_under_test.foo
|
14
|
+
end
|
15
|
+
|
16
|
+
tests("The exception test is as expected").returns(true) do
|
17
|
+
begin
|
18
|
+
@object_under_test.foo
|
19
|
+
rescue Fog::Ovirt::Errors::OvirtEngineError => e
|
20
|
+
e.message == "Ovirt client returned an error: Test"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
tests("The original exception test is as expected").returns(true) do
|
25
|
+
begin
|
26
|
+
@object_under_test.foo
|
27
|
+
rescue Fog::Ovirt::Errors::OvirtEngineError => e
|
28
|
+
e.orig_exception.message == "Test"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -1,26 +1,17 @@
|
|
1
|
-
Shindo.tests("Fog::Compute[:ovirt] | vm_create request",
|
2
|
-
|
1
|
+
Shindo.tests("Fog::Compute[:ovirt] | vm_create request", "ovirt") do
|
3
2
|
compute = Fog::Compute[:ovirt]
|
4
3
|
name_base = Time.now.to_i
|
5
4
|
|
6
5
|
tests("Create VM") do
|
7
|
-
response = compute.create_vm(:name =>
|
8
|
-
test("should be a kind of OVIRT::VM") { response.
|
6
|
+
response = compute.create_vm(:name => "fog-" + name_base.to_s, :cluster_name => "Default")
|
7
|
+
test("should be a kind of OVIRT::VM") { response.is_a? OVIRT::VM }
|
9
8
|
end
|
10
9
|
|
11
10
|
tests("Create VM from template (clone)") do
|
12
|
-
response = compute.create_vm(:name =>
|
13
|
-
test("should be a kind of OVIRT::VM") { response.
|
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
|
11
|
+
response = compute.create_vm(:name => "fog-" + (name_base + 1).to_s, :template_name => "hwp_small", :cluster_name => "Default")
|
12
|
+
test("should be a kind of OVIRT::VM") { response.is_a? OVIRT::VM }
|
24
13
|
end
|
25
14
|
|
15
|
+
# TODO: Write a test for situation where creating a VM fails
|
16
|
+
# mocks never raise exceptions
|
26
17
|
end
|
@@ -1,18 +1,16 @@
|
|
1
|
-
Shindo.tests(
|
2
|
-
|
1
|
+
Shindo.tests("Fog::Compute[:ovirt] | vm_destroy request", ["ovirt"]) do
|
3
2
|
compute = Fog::Compute[:ovirt]
|
4
|
-
if compute.servers.all(:search =>
|
5
|
-
compute.create_vm(:name =>
|
3
|
+
if compute.servers.all(:search => "fog-*").empty?
|
4
|
+
compute.create_vm(:name => "fog-" + Time.now.to_i.to_s, :cluster_name => "Default")
|
6
5
|
end
|
7
|
-
vm_id = compute.servers.all(:search =>
|
6
|
+
vm_id = compute.servers.all(:search => "fog-*").last.id
|
8
7
|
|
9
|
-
tests(
|
8
|
+
tests("The response should") do
|
10
9
|
response = compute.destroy_vm(:id => vm_id)
|
11
|
-
test(
|
10
|
+
test("be a success") { response ? true : false }
|
12
11
|
end
|
13
12
|
|
14
|
-
tests(
|
15
|
-
raises(ArgumentError,
|
13
|
+
tests("The expected options") do
|
14
|
+
raises(ArgumentError, "raises ArgumentError when id option is missing") { compute.destroy_vm }
|
16
15
|
end
|
17
|
-
|
18
16
|
end
|
@@ -1,13 +1,11 @@
|
|
1
|
-
Shindo.tests(
|
2
|
-
|
1
|
+
Shindo.tests("Fog::Compute[:ovirt] | datacenters request", ["ovirt"]) do
|
3
2
|
compute = Fog::Compute[:ovirt]
|
4
3
|
|
5
4
|
tests("When listing all datacenters") do
|
6
|
-
|
7
5
|
response = compute.datacenters
|
8
6
|
tests("The response data format ...") do
|
9
|
-
test("it should be a kind of Array") { response.
|
10
|
-
test("be a kind of Hash") { response.first.
|
7
|
+
test("it should be a kind of Array") { response.is_a? Array }
|
8
|
+
test("be a kind of Hash") { response.first.is_a? Hash }
|
11
9
|
end
|
12
10
|
end
|
13
11
|
end
|
@@ -1,12 +1,10 @@
|
|
1
|
-
Shindo.tests(
|
2
|
-
|
1
|
+
Shindo.tests("Fog::Compute[:ovirt] | quotas request", ["ovirt"]) do
|
3
2
|
compute = Fog::Compute[:ovirt]
|
4
3
|
|
5
4
|
tests("When listing all quotas") do
|
6
|
-
|
7
5
|
response = compute.quotas
|
8
6
|
tests("The response data format ...") do
|
9
|
-
test("it should be a kind of Array") { response.
|
7
|
+
test("it should be a kind of Array") { response.is_a? Array }
|
10
8
|
end
|
11
9
|
end
|
12
10
|
end
|
@@ -1,13 +1,11 @@
|
|
1
|
-
Shindo.tests(
|
2
|
-
|
1
|
+
Shindo.tests("Fog::Compute[:ovirt] | storage_domains request", ["ovirt"]) do
|
3
2
|
compute = Fog::Compute[:ovirt]
|
4
3
|
|
5
4
|
tests("When listing all storage_domains") do
|
6
|
-
|
7
5
|
response = compute.storage_domains
|
8
6
|
tests("The response data format ...") do
|
9
|
-
test("it should be a kind of Array") { response.
|
10
|
-
test("be a kind of OVIRT::StorageDomain") { response.first.
|
7
|
+
test("it should be a kind of Array") { response.is_a? Array }
|
8
|
+
test("be a kind of OVIRT::StorageDomain") { response.first.is_a? OVIRT::StorageDomain }
|
11
9
|
end
|
12
10
|
end
|
13
11
|
end
|
@@ -1,18 +1,16 @@
|
|
1
|
-
Shindo.tests(
|
2
|
-
|
1
|
+
Shindo.tests("Fog::Compute[:ovirt] | vm_update request", ["ovirt"]) do
|
3
2
|
compute = Fog::Compute[:ovirt]
|
4
|
-
if compute.servers.all(:search =>
|
5
|
-
compute.create_vm(:name =>
|
3
|
+
if compute.servers.all(:search => "fog-*").empty?
|
4
|
+
compute.create_vm(:name => "fog-" + Time.now.to_i.to_s, :cluster_name => "Default")
|
6
5
|
end
|
7
|
-
vm = compute.servers.all(:search =>
|
6
|
+
vm = compute.servers.all(:search => "fog-*").last
|
8
7
|
|
9
|
-
tests(
|
10
|
-
response = compute.update_vm(:id => vm.id, :name => vm.name +
|
11
|
-
test("be a kind of OVIRT::VM") { response.
|
8
|
+
tests("The response should") do
|
9
|
+
response = compute.update_vm(:id => vm.id, :name => vm.name + "updated")
|
10
|
+
test("be a kind of OVIRT::VM") { response.is_a? OVIRT::VM }
|
12
11
|
end
|
13
12
|
|
14
|
-
tests(
|
15
|
-
raises(ArgumentError,
|
13
|
+
tests("The expected options") do
|
14
|
+
raises(ArgumentError, "raises ArgumentError when id option is missing") { compute.update_vm }
|
16
15
|
end
|
17
|
-
|
18
16
|
end
|
@@ -1,20 +1,17 @@
|
|
1
|
-
Shindo.tests(
|
2
|
-
|
1
|
+
Shindo.tests("Fog::Compute[:ovirt] | update_volume request", ["ovirt"]) do
|
3
2
|
compute = Fog::Compute[:ovirt]
|
4
|
-
if compute.servers.all(:search =>
|
5
|
-
compute.create_vm(:name =>
|
3
|
+
if compute.servers.all(:search => "fog-*").empty?
|
4
|
+
compute.create_vm(:name => "fog-" + Time.now.to_i.to_s, :cluster_name => "Default")
|
6
5
|
end
|
7
|
-
vm_id = compute.servers.all(:search =>
|
6
|
+
vm_id = compute.servers.all(:search => "fog-*").last
|
8
7
|
|
9
|
-
tests(
|
10
|
-
raises(ArgumentError,
|
11
|
-
raises(ArgumentError,
|
8
|
+
tests("The expected options") do
|
9
|
+
raises(ArgumentError, "raises ArgumentError when vm id is missing") { compute.update_volume(nil, :id => 1) }
|
10
|
+
raises(ArgumentError, "raises ArgumentError when disk_id option is missing") { compute.update_volume(1, :any => 1) }
|
12
11
|
end
|
13
12
|
|
14
|
-
tests(
|
13
|
+
tests("The response should") do
|
15
14
|
response = compute.update_volume(vm_id, :id => 1)
|
16
|
-
test(
|
15
|
+
test("be a success") { response ? true : false }
|
17
16
|
end
|
18
|
-
|
19
|
-
|
20
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-ovirt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ori Rabin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '0.
|
117
|
+
version: '0.52'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '0.
|
124
|
+
version: '0.52'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: shindo
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -144,6 +144,8 @@ extensions: []
|
|
144
144
|
extra_rdoc_files: []
|
145
145
|
files:
|
146
146
|
- ".gitignore"
|
147
|
+
- ".rubocop.yml"
|
148
|
+
- ".rubocop_todo.yml"
|
147
149
|
- ".travis.yml"
|
148
150
|
- CONTRIBUTING.md
|
149
151
|
- CONTRIBUTORS.md
|
@@ -155,6 +157,7 @@ files:
|
|
155
157
|
- lib/fog/bin/ovirt.rb
|
156
158
|
- lib/fog/ovirt.rb
|
157
159
|
- lib/fog/ovirt/compute.rb
|
160
|
+
- lib/fog/ovirt/compute/v3.rb
|
158
161
|
- lib/fog/ovirt/core.rb
|
159
162
|
- lib/fog/ovirt/models/compute/affinity_group.rb
|
160
163
|
- lib/fog/ovirt/models/compute/affinity_groups.rb
|
@@ -174,67 +177,67 @@ files:
|
|
174
177
|
- lib/fog/ovirt/models/compute/templates.rb
|
175
178
|
- lib/fog/ovirt/models/compute/volume.rb
|
176
179
|
- lib/fog/ovirt/models/compute/volumes.rb
|
177
|
-
- lib/fog/ovirt/requests/compute/activate_volume.rb
|
178
|
-
- lib/fog/ovirt/requests/compute/add_interface.rb
|
179
|
-
- lib/fog/ovirt/requests/compute/add_to_affinity_group.rb
|
180
|
-
- lib/fog/ovirt/requests/compute/add_volume.rb
|
181
|
-
- lib/fog/ovirt/requests/compute/attach_volume.rb
|
182
|
-
- lib/fog/ovirt/requests/compute/create_affinity_group.rb
|
183
|
-
- lib/fog/ovirt/requests/compute/create_vm.rb
|
184
|
-
- lib/fog/ovirt/requests/compute/datacenters.rb
|
185
|
-
- lib/fog/ovirt/requests/compute/deactivate_volume.rb
|
186
|
-
- lib/fog/ovirt/requests/compute/destroy_affinity_group.rb
|
187
|
-
- lib/fog/ovirt/requests/compute/destroy_interface.rb
|
188
|
-
- lib/fog/ovirt/requests/compute/destroy_vm.rb
|
189
|
-
- lib/fog/ovirt/requests/compute/destroy_volume.rb
|
190
|
-
- lib/fog/ovirt/requests/compute/detach_volume.rb
|
191
|
-
- lib/fog/ovirt/requests/compute/get_affinity_group.rb
|
192
|
-
- lib/fog/ovirt/requests/compute/get_api_version.rb
|
193
|
-
- lib/fog/ovirt/requests/compute/get_cluster.rb
|
194
|
-
- lib/fog/ovirt/requests/compute/get_instance_type.rb
|
195
|
-
- lib/fog/ovirt/requests/compute/get_quota.rb
|
196
|
-
- lib/fog/ovirt/requests/compute/get_template.rb
|
197
|
-
- lib/fog/ovirt/requests/compute/get_virtual_machine.rb
|
198
|
-
- lib/fog/ovirt/requests/compute/list_affinity_group_vms.rb
|
199
|
-
- lib/fog/ovirt/requests/compute/list_affinity_groups.rb
|
200
|
-
- lib/fog/ovirt/requests/compute/list_clusters.rb
|
201
|
-
- lib/fog/ovirt/requests/compute/list_instance_types.rb
|
202
|
-
- lib/fog/ovirt/requests/compute/list_networks.rb
|
203
|
-
- lib/fog/ovirt/requests/compute/list_operating_systems.rb
|
204
|
-
- lib/fog/ovirt/requests/compute/list_quotas.rb
|
205
|
-
- lib/fog/ovirt/requests/compute/list_template_interfaces.rb
|
206
|
-
- lib/fog/ovirt/requests/compute/list_template_volumes.rb
|
207
|
-
- lib/fog/ovirt/requests/compute/list_templates.rb
|
208
|
-
- lib/fog/ovirt/requests/compute/list_virtual_machines.rb
|
209
|
-
- lib/fog/ovirt/requests/compute/list_vm_interfaces.rb
|
210
|
-
- lib/fog/ovirt/requests/compute/list_vm_volumes.rb
|
211
|
-
- lib/fog/ovirt/requests/compute/list_volumes.rb
|
212
|
-
- lib/fog/ovirt/requests/compute/mock_files/affinitygroup.xml
|
213
|
-
- lib/fog/ovirt/requests/compute/mock_files/affinitygroup_vms.xml
|
214
|
-
- lib/fog/ovirt/requests/compute/mock_files/affinitygroups.xml
|
215
|
-
- lib/fog/ovirt/requests/compute/mock_files/cluster.xml
|
216
|
-
- lib/fog/ovirt/requests/compute/mock_files/clusters.xml
|
217
|
-
- lib/fog/ovirt/requests/compute/mock_files/data_centers.xml
|
218
|
-
- lib/fog/ovirt/requests/compute/mock_files/disks.xml
|
219
|
-
- lib/fog/ovirt/requests/compute/mock_files/instance_type.xml
|
220
|
-
- lib/fog/ovirt/requests/compute/mock_files/instance_types.xml
|
221
|
-
- lib/fog/ovirt/requests/compute/mock_files/nics.xml
|
222
|
-
- lib/fog/ovirt/requests/compute/mock_files/operating_systems.xml
|
223
|
-
- lib/fog/ovirt/requests/compute/mock_files/quotas.xml
|
224
|
-
- lib/fog/ovirt/requests/compute/mock_files/storage_domains.xml
|
225
|
-
- lib/fog/ovirt/requests/compute/mock_files/template.xml
|
226
|
-
- lib/fog/ovirt/requests/compute/mock_files/templates.xml
|
227
|
-
- lib/fog/ovirt/requests/compute/mock_files/vm.xml
|
228
|
-
- lib/fog/ovirt/requests/compute/mock_files/vms.xml
|
229
|
-
- lib/fog/ovirt/requests/compute/mock_files/volumes.xml
|
230
|
-
- lib/fog/ovirt/requests/compute/remove_from_affinity_group.rb
|
231
|
-
- lib/fog/ovirt/requests/compute/storage_domains.rb
|
232
|
-
- lib/fog/ovirt/requests/compute/update_interface.rb
|
233
|
-
- lib/fog/ovirt/requests/compute/update_vm.rb
|
234
|
-
- lib/fog/ovirt/requests/compute/update_volume.rb
|
235
|
-
- lib/fog/ovirt/requests/compute/vm_action.rb
|
236
|
-
- lib/fog/ovirt/requests/compute/vm_start_with_cloudinit.rb
|
237
|
-
- lib/fog/ovirt/requests/compute/vm_ticket.rb
|
180
|
+
- lib/fog/ovirt/requests/compute/v3/activate_volume.rb
|
181
|
+
- lib/fog/ovirt/requests/compute/v3/add_interface.rb
|
182
|
+
- lib/fog/ovirt/requests/compute/v3/add_to_affinity_group.rb
|
183
|
+
- lib/fog/ovirt/requests/compute/v3/add_volume.rb
|
184
|
+
- lib/fog/ovirt/requests/compute/v3/attach_volume.rb
|
185
|
+
- lib/fog/ovirt/requests/compute/v3/create_affinity_group.rb
|
186
|
+
- lib/fog/ovirt/requests/compute/v3/create_vm.rb
|
187
|
+
- lib/fog/ovirt/requests/compute/v3/datacenters.rb
|
188
|
+
- lib/fog/ovirt/requests/compute/v3/deactivate_volume.rb
|
189
|
+
- lib/fog/ovirt/requests/compute/v3/destroy_affinity_group.rb
|
190
|
+
- lib/fog/ovirt/requests/compute/v3/destroy_interface.rb
|
191
|
+
- lib/fog/ovirt/requests/compute/v3/destroy_vm.rb
|
192
|
+
- lib/fog/ovirt/requests/compute/v3/destroy_volume.rb
|
193
|
+
- lib/fog/ovirt/requests/compute/v3/detach_volume.rb
|
194
|
+
- lib/fog/ovirt/requests/compute/v3/get_affinity_group.rb
|
195
|
+
- lib/fog/ovirt/requests/compute/v3/get_api_version.rb
|
196
|
+
- lib/fog/ovirt/requests/compute/v3/get_cluster.rb
|
197
|
+
- lib/fog/ovirt/requests/compute/v3/get_instance_type.rb
|
198
|
+
- lib/fog/ovirt/requests/compute/v3/get_quota.rb
|
199
|
+
- lib/fog/ovirt/requests/compute/v3/get_template.rb
|
200
|
+
- lib/fog/ovirt/requests/compute/v3/get_virtual_machine.rb
|
201
|
+
- lib/fog/ovirt/requests/compute/v3/list_affinity_group_vms.rb
|
202
|
+
- lib/fog/ovirt/requests/compute/v3/list_affinity_groups.rb
|
203
|
+
- lib/fog/ovirt/requests/compute/v3/list_clusters.rb
|
204
|
+
- lib/fog/ovirt/requests/compute/v3/list_instance_types.rb
|
205
|
+
- lib/fog/ovirt/requests/compute/v3/list_networks.rb
|
206
|
+
- lib/fog/ovirt/requests/compute/v3/list_operating_systems.rb
|
207
|
+
- lib/fog/ovirt/requests/compute/v3/list_quotas.rb
|
208
|
+
- lib/fog/ovirt/requests/compute/v3/list_template_interfaces.rb
|
209
|
+
- lib/fog/ovirt/requests/compute/v3/list_template_volumes.rb
|
210
|
+
- lib/fog/ovirt/requests/compute/v3/list_templates.rb
|
211
|
+
- lib/fog/ovirt/requests/compute/v3/list_virtual_machines.rb
|
212
|
+
- lib/fog/ovirt/requests/compute/v3/list_vm_interfaces.rb
|
213
|
+
- lib/fog/ovirt/requests/compute/v3/list_vm_volumes.rb
|
214
|
+
- lib/fog/ovirt/requests/compute/v3/list_volumes.rb
|
215
|
+
- lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroup.xml
|
216
|
+
- lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroup_vms.xml
|
217
|
+
- lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroups.xml
|
218
|
+
- lib/fog/ovirt/requests/compute/v3/mock_files/cluster.xml
|
219
|
+
- lib/fog/ovirt/requests/compute/v3/mock_files/clusters.xml
|
220
|
+
- lib/fog/ovirt/requests/compute/v3/mock_files/data_centers.xml
|
221
|
+
- lib/fog/ovirt/requests/compute/v3/mock_files/disks.xml
|
222
|
+
- lib/fog/ovirt/requests/compute/v3/mock_files/instance_type.xml
|
223
|
+
- lib/fog/ovirt/requests/compute/v3/mock_files/instance_types.xml
|
224
|
+
- lib/fog/ovirt/requests/compute/v3/mock_files/nics.xml
|
225
|
+
- lib/fog/ovirt/requests/compute/v3/mock_files/operating_systems.xml
|
226
|
+
- lib/fog/ovirt/requests/compute/v3/mock_files/quotas.xml
|
227
|
+
- lib/fog/ovirt/requests/compute/v3/mock_files/storage_domains.xml
|
228
|
+
- lib/fog/ovirt/requests/compute/v3/mock_files/template.xml
|
229
|
+
- lib/fog/ovirt/requests/compute/v3/mock_files/templates.xml
|
230
|
+
- lib/fog/ovirt/requests/compute/v3/mock_files/vm.xml
|
231
|
+
- lib/fog/ovirt/requests/compute/v3/mock_files/vms.xml
|
232
|
+
- lib/fog/ovirt/requests/compute/v3/mock_files/volumes.xml
|
233
|
+
- lib/fog/ovirt/requests/compute/v3/remove_from_affinity_group.rb
|
234
|
+
- lib/fog/ovirt/requests/compute/v3/storage_domains.rb
|
235
|
+
- lib/fog/ovirt/requests/compute/v3/update_interface.rb
|
236
|
+
- lib/fog/ovirt/requests/compute/v3/update_vm.rb
|
237
|
+
- lib/fog/ovirt/requests/compute/v3/update_volume.rb
|
238
|
+
- lib/fog/ovirt/requests/compute/v3/vm_action.rb
|
239
|
+
- lib/fog/ovirt/requests/compute/v3/vm_start_with_cloudinit.rb
|
240
|
+
- lib/fog/ovirt/requests/compute/v3/vm_ticket.rb
|
238
241
|
- lib/fog/ovirt/version.rb
|
239
242
|
- spec/fog/bin/ovirt_spec.rb
|
240
243
|
- spec/fog/bin_spec.rb
|
@@ -252,6 +255,7 @@ files:
|
|
252
255
|
- tests/ovirt/models/compute/servers_tests.rb
|
253
256
|
- tests/ovirt/models/compute/template_tests.rb
|
254
257
|
- tests/ovirt/models/compute/templates_tests.rb
|
258
|
+
- tests/ovirt/requests/compute/client_tests.rb
|
255
259
|
- tests/ovirt/requests/compute/create_vm_tests.rb
|
256
260
|
- tests/ovirt/requests/compute/destroy_vm_tests.rb
|
257
261
|
- tests/ovirt/requests/compute/list_datacenters_tests.rb
|
@@ -298,6 +302,7 @@ test_files:
|
|
298
302
|
- tests/ovirt/models/compute/servers_tests.rb
|
299
303
|
- tests/ovirt/models/compute/template_tests.rb
|
300
304
|
- tests/ovirt/models/compute/templates_tests.rb
|
305
|
+
- tests/ovirt/requests/compute/client_tests.rb
|
301
306
|
- tests/ovirt/requests/compute/create_vm_tests.rb
|
302
307
|
- tests/ovirt/requests/compute/destroy_vm_tests.rb
|
303
308
|
- tests/ovirt/requests/compute/list_datacenters_tests.rb
|