foreman_fog_proxmox 0.8.0 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of foreman_fog_proxmox might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +11 -1
- data/Rakefile +3 -1
- data/app/controllers/concerns/foreman_fog_proxmox/controller/parameters/compute_resource.rb +2 -2
- data/app/controllers/foreman_fog_proxmox/compute_resources_controller.rb +2 -2
- data/app/helpers/node_dashboard_helper.rb +13 -14
- data/app/helpers/proxmox_compute_selectors_helper.rb +49 -50
- data/app/helpers/proxmox_container_helper.rb +42 -36
- data/app/helpers/proxmox_form_helper.rb +38 -40
- data/app/helpers/proxmox_server_helper.rb +39 -41
- data/app/helpers/proxmox_vm_helper.rb +21 -25
- data/app/models/concerns/fog_extensions/proxmox/disk.rb +8 -8
- data/app/models/concerns/fog_extensions/proxmox/interface.rb +8 -8
- data/app/models/concerns/fog_extensions/proxmox/node.rb +24 -22
- data/app/models/concerns/fog_extensions/proxmox/server.rb +71 -59
- data/app/models/concerns/fog_extensions/proxmox/server_config.rb +47 -39
- data/app/models/concerns/fog_extensions/proxmox/volume.rb +8 -8
- data/app/models/concerns/host_ext/proxmox/interfaces.rb +21 -13
- data/app/models/concerns/orchestration/proxmox/compute.rb +14 -10
- data/app/models/foreman_fog_proxmox/options_select.rb +14 -14
- data/app/models/foreman_fog_proxmox/proxmox.rb +30 -466
- data/app/models/foreman_fog_proxmox/proxmox_compute_attributes.rb +54 -0
- data/app/models/foreman_fog_proxmox/proxmox_connection.rb +67 -0
- data/app/models/foreman_fog_proxmox/proxmox_console.rb +41 -0
- data/app/models/foreman_fog_proxmox/proxmox_images.rb +53 -0
- data/app/models/foreman_fog_proxmox/proxmox_interfaces.rb +60 -0
- data/app/models/foreman_fog_proxmox/proxmox_operating_systems.rb +49 -0
- data/app/models/foreman_fog_proxmox/proxmox_token_expiration.rb +30 -0
- data/app/models/foreman_fog_proxmox/proxmox_version.rb +36 -0
- data/app/models/foreman_fog_proxmox/proxmox_vm_commands.rb +108 -0
- data/app/models/foreman_fog_proxmox/proxmox_vm_new.rb +162 -0
- data/app/models/foreman_fog_proxmox/proxmox_vm_queries.rb +74 -0
- data/app/models/foreman_fog_proxmox/proxmox_volumes.rb +85 -0
- data/app/overrides/compute_resources_vms/form/add_clone_to_new_vm_compute_detail.rb +7 -6
- data/app/overrides/compute_resources_vms/form/add_from_profile_to_compute_attributes_form.rb +13 -11
- data/app/overrides/compute_resources_vms/form/add_vm_type_to_networks_form.rb +13 -11
- data/app/overrides/compute_resources_vms/form/add_vm_type_to_nic_provider_specific_form.rb +8 -7
- data/app/overrides/compute_resources_vms/form/add_vm_type_to_volumes_edit.rb +7 -6
- data/app/overrides/compute_resources_vms/form/add_vm_type_to_volumes_new_volume.rb +7 -6
- data/app/overrides/compute_resources_vms/form/remove_new_vm_from_removable_layout.rb +7 -6
- data/app/services/foreman_fog_proxmox/node_dashboard/data.rb +16 -16
- data/app/views/api/v2/compute_resources/proxmox.json.rabl +3 -1
- data/app/views/compute_resources/form/_proxmox.html.erb +3 -0
- data/app/views/compute_resources/show/_proxmox.html.erb +8 -0
- data/app/views/compute_resources_vms/form/proxmox/_add_from_profile_to_compute_attributes_form.html.erb +5 -0
- data/app/views/compute_resources_vms/form/proxmox/_add_from_profile_to_compute_form.html.erb +6 -1
- data/app/views/compute_resources_vms/form/proxmox/_add_from_profile_to_hosts_compute_detail_form.html.erb +6 -0
- data/app/views/compute_resources_vms/form/proxmox/_add_vm_type_to_networks_form.html.erb +6 -2
- data/app/views/compute_resources_vms/form/proxmox/_add_vm_type_to_networks_new_childs_form.html.erb +8 -2
- data/app/views/compute_resources_vms/form/proxmox/_add_vm_type_to_nic_provider_specific_form.html.erb +6 -0
- data/app/views/compute_resources_vms/form/proxmox/_add_vm_type_to_volumes_edit.html.erb +15 -1
- data/app/views/compute_resources_vms/form/proxmox/_base.html.erb +2 -2
- data/app/views/compute_resources_vms/form/proxmox/_general.html.erb +1 -1
- data/app/views/compute_resources_vms/form/proxmox/_removable_layout.html.erb +6 -1
- data/app/views/compute_resources_vms/form/proxmox/container/_extended.html.erb +1 -1
- data/app/views/compute_resources_vms/form/proxmox/container/_volume_mp.html.erb +1 -1
- data/app/views/compute_resources_vms/form/proxmox/server/_config.html.erb +1 -1
- data/app/views/compute_resources_vms/form/proxmox/server/_volume.html.erb +2 -2
- data/config/routes.rb +4 -4
- data/lib/foreman_fog_proxmox/engine.rb +14 -14
- data/lib/foreman_fog_proxmox/semver.rb +78 -78
- data/lib/foreman_fog_proxmox/value.rb +5 -3
- data/lib/foreman_fog_proxmox/version.rb +1 -1
- data/lib/tasks/foreman_fog_proxmox_tasks.rake +3 -13
- data/locale/en/foreman_fog_proxmox.edit.po +472 -0
- data/locale/en/foreman_fog_proxmox.po +48 -24
- data/locale/en/foreman_fog_proxmox.po.time_stamp +0 -0
- data/locale/foreman_fog_proxmox.pot +140 -102
- data/locale/fr/foreman_fog_proxmox.edit.po +472 -0
- data/locale/fr/foreman_fog_proxmox.po +52 -28
- data/locale/fr/foreman_fog_proxmox.po.time_stamp +0 -0
- data/locale/gemspec.rb +2 -0
- data/test/{unit/foreman_fog_proxmox/proxmox_test_helpers.rb → factories/foreman_fog_proxmox/proxmox_container_mock_factory.rb} +4 -140
- data/test/factories/foreman_fog_proxmox/proxmox_node_mock_factory.rb +61 -0
- data/test/factories/foreman_fog_proxmox/proxmox_server_mock_factory.rb +134 -0
- data/test/factories/proxmox_factory.rb +15 -15
- data/test/functional/compute_resources_controller_test.rb +12 -10
- data/test/test_plugin_helper.rb +2 -0
- data/test/unit/foreman_fog_proxmox/helpers/proxmox_container_helper_test.rb +178 -182
- data/test/unit/foreman_fog_proxmox/helpers/proxmox_server_helper_test.rb +122 -126
- data/test/unit/foreman_fog_proxmox/helpers/proxmox_vm_helper_test.rb +180 -187
- data/test/unit/foreman_fog_proxmox/proxmox_compute_attributes_test.rb +116 -0
- data/test/unit/foreman_fog_proxmox/proxmox_interfaces_test.rb +71 -0
- data/test/unit/foreman_fog_proxmox/proxmox_test.rb +9 -479
- data/test/unit/foreman_fog_proxmox/proxmox_version_test.rb +82 -0
- data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_container_test.rb +207 -0
- data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_create_test.rb +92 -0
- data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_test.rb +324 -0
- data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_test.rb +43 -0
- data/test/unit/foreman_fog_proxmox/proxmox_vm_new_test.rb +71 -0
- data/test/unit/foreman_fog_proxmox/proxmox_vm_queries_test.rb +63 -0
- data/test/unit/foreman_fog_proxmox/semver_test.rb +67 -53
- metadata +52 -14
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2018 Tristan Robert
|
4
|
+
|
5
|
+
# This file is part of ForemanFogProxmox.
|
6
|
+
|
7
|
+
# ForemanFogProxmox is free software: you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU General Public License as published by
|
9
|
+
# the Free Software Foundation, either version 3 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
|
12
|
+
# ForemanFogProxmox is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU General Public License for more details.
|
16
|
+
|
17
|
+
# You should have received a copy of the GNU General Public License
|
18
|
+
# along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.
|
19
|
+
|
20
|
+
require 'test_plugin_helper'
|
21
|
+
require 'models/compute_resources/compute_resource_test_helpers'
|
22
|
+
require 'factories/foreman_fog_proxmox/proxmox_node_mock_factory'
|
23
|
+
require 'factories/foreman_fog_proxmox/proxmox_server_mock_factory'
|
24
|
+
require 'factories/foreman_fog_proxmox/proxmox_container_mock_factory'
|
25
|
+
require 'active_support/core_ext/hash/indifferent_access'
|
26
|
+
|
27
|
+
module ForemanFogProxmox
|
28
|
+
class ProxmoxVmCommandsServerTest < ActiveSupport::TestCase
|
29
|
+
include ComputeResourceTestHelpers
|
30
|
+
include ProxmoxNodeMockFactory
|
31
|
+
include ProxmoxServerMockFactory
|
32
|
+
include ProxmoxContainerMockFactory
|
33
|
+
include ProxmoxVmHelper
|
34
|
+
|
35
|
+
describe 'destroy_vm' do
|
36
|
+
it 'handles situation when vm is not present' do
|
37
|
+
cr = mock_cr_servers(ForemanFogProxmox::Proxmox.new, empty_servers)
|
38
|
+
cr.expects(:find_vm_by_uuid).raises(ActiveRecord::RecordNotFound)
|
39
|
+
assert cr.destroy_vm('abc')
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2018 Tristan Robert
|
4
|
+
|
5
|
+
# This file is part of ForemanFogProxmox.
|
6
|
+
|
7
|
+
# ForemanFogProxmox is free software: you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU General Public License as published by
|
9
|
+
# the Free Software Foundation, either version 3 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
|
12
|
+
# ForemanFogProxmox is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU General Public License for more details.
|
16
|
+
|
17
|
+
# You should have received a copy of the GNU General Public License
|
18
|
+
# along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.
|
19
|
+
|
20
|
+
require 'test_plugin_helper'
|
21
|
+
require 'models/compute_resources/compute_resource_test_helpers'
|
22
|
+
require 'factories/foreman_fog_proxmox/proxmox_node_mock_factory'
|
23
|
+
require 'factories/foreman_fog_proxmox/proxmox_server_mock_factory'
|
24
|
+
require 'factories/foreman_fog_proxmox/proxmox_container_mock_factory'
|
25
|
+
require 'active_support/core_ext/hash/indifferent_access'
|
26
|
+
|
27
|
+
module ForemanFogProxmox
|
28
|
+
class ProxmoxVmNewTest < ActiveSupport::TestCase
|
29
|
+
include ComputeResourceTestHelpers
|
30
|
+
include ProxmoxNodeMockFactory
|
31
|
+
include ProxmoxServerMockFactory
|
32
|
+
include ProxmoxContainerMockFactory
|
33
|
+
include ProxmoxVmHelper
|
34
|
+
|
35
|
+
describe 'new_vm' do
|
36
|
+
before do
|
37
|
+
@cr = FactoryBot.build_stubbed(:proxmox_cr)
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'new server with attr empty' do
|
41
|
+
attr = {}
|
42
|
+
vm = mock('vm')
|
43
|
+
config = mock('config')
|
44
|
+
config.stubs(:inspect).returns('config')
|
45
|
+
vm.stubs(:config).returns(config)
|
46
|
+
@cr.stubs(:new_server_vm).with(attr).returns(vm)
|
47
|
+
assert_equal vm, @cr.new_vm(attr)
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'new server with attr not empty' do
|
51
|
+
attr = { 'type' => 'qemu' }
|
52
|
+
vm = mock('vm')
|
53
|
+
config = mock('config')
|
54
|
+
config.stubs(:inspect).returns('config')
|
55
|
+
vm.stubs(:config).returns(config)
|
56
|
+
@cr.stubs(:new_server_vm).with(attr).returns(vm)
|
57
|
+
assert_equal vm, @cr.new_vm(attr)
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'new container with attr not empty' do
|
61
|
+
attr = { 'type' => 'lxc' }
|
62
|
+
vm = mock('vm')
|
63
|
+
config = mock('config')
|
64
|
+
config.stubs(:inspect).returns('config')
|
65
|
+
vm.stubs(:config).returns(config)
|
66
|
+
@cr.stubs(:new_container_vm).with(attr).returns(vm)
|
67
|
+
assert_equal vm, @cr.new_vm(attr)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2018 Tristan Robert
|
4
|
+
|
5
|
+
# This file is part of ForemanFogProxmox.
|
6
|
+
|
7
|
+
# ForemanFogProxmox is free software: you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU General Public License as published by
|
9
|
+
# the Free Software Foundation, either version 3 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
|
12
|
+
# ForemanFogProxmox is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU General Public License for more details.
|
16
|
+
|
17
|
+
# You should have received a copy of the GNU General Public License
|
18
|
+
# along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.
|
19
|
+
|
20
|
+
require 'test_plugin_helper'
|
21
|
+
require 'models/compute_resources/compute_resource_test_helpers'
|
22
|
+
require 'factories/foreman_fog_proxmox/proxmox_node_mock_factory'
|
23
|
+
require 'factories/foreman_fog_proxmox/proxmox_server_mock_factory'
|
24
|
+
require 'factories/foreman_fog_proxmox/proxmox_container_mock_factory'
|
25
|
+
require 'active_support/core_ext/hash/indifferent_access'
|
26
|
+
|
27
|
+
module ForemanFogProxmox
|
28
|
+
class ProxmoxVmQueriesTest < ActiveSupport::TestCase
|
29
|
+
include ComputeResourceTestHelpers
|
30
|
+
include ProxmoxNodeMockFactory
|
31
|
+
include ProxmoxServerMockFactory
|
32
|
+
include ProxmoxContainerMockFactory
|
33
|
+
include ProxmoxVmHelper
|
34
|
+
|
35
|
+
describe 'find_vm_by_uuid' do
|
36
|
+
it 'returns nil when the uuid does not match' do
|
37
|
+
cr = mock_node_servers_containers(ForemanFogProxmox::Proxmox.new, empty_servers, empty_servers)
|
38
|
+
assert cr.find_vm_by_uuid('100').nil?
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'raises RecordNotFound when the compute raises error' do
|
42
|
+
exception = Fog::Errors::Error.new
|
43
|
+
cr = mock_node_servers(ForemanFogProxmox::Proxmox.new, servers_raising_exception(exception))
|
44
|
+
assert_raises ActiveRecord::RecordNotFound do
|
45
|
+
cr.find_vm_by_uuid('100')
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'finds vm on other node in cluster' do
|
50
|
+
args = { vmid: '100', type: 'qemu' }
|
51
|
+
servers = mock('servers')
|
52
|
+
servers.stubs(:id_valid?).returns(true)
|
53
|
+
servers.stubs(:get).with(args[:vmid]).returns(args)
|
54
|
+
cr = mock_cluster_nodes_servers_containers(
|
55
|
+
ForemanFogProxmox::Proxmox.new,
|
56
|
+
empty_servers, empty_servers, # node1
|
57
|
+
servers, empty_servers # node2
|
58
|
+
)
|
59
|
+
assert_equal args, cr.find_vm_by_uuid(args[:vmid])
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -20,60 +20,74 @@
|
|
20
20
|
require 'foreman_fog_proxmox/semver'
|
21
21
|
|
22
22
|
module ForemanFogProxmox
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
23
|
+
class SemverTest < ActiveSupport::TestCase
|
24
|
+
describe 'semver?' do
|
25
|
+
it '#5.3.2 returns true' do
|
26
|
+
assert ForemanFogProxmox::Semver.semver?('5.3.2')
|
27
|
+
end
|
28
|
+
it '#6.0-6 returns true' do
|
29
|
+
assert ForemanFogProxmox::Semver.semver?('6.0-6')
|
30
|
+
end
|
31
|
+
it '#5.3beta returns false' do
|
32
|
+
assert_not ForemanFogProxmox::Semver.semver?('5.3beta')
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'to_semver' do
|
36
|
+
it '#5.3.2 returns SemverClass' do
|
37
|
+
semver = ForemanFogProxmox::Semver.to_semver('5.3.2')
|
38
|
+
assert_not_nil semver
|
39
|
+
assert semver.is_a?(ForemanFogProxmox::Semver::SemverClass)
|
40
|
+
assert_equal 5, semver.major
|
41
|
+
assert_equal 3, semver.minor
|
42
|
+
assert_equal 2, semver.patch
|
43
|
+
assert_equal '', semver.qualifier
|
44
|
+
end
|
45
|
+
it '#6.0-6 returns SemverClass' do
|
46
|
+
semver = ForemanFogProxmox::Semver.to_semver('6.0-6')
|
47
|
+
assert_not_nil semver
|
48
|
+
assert semver.is_a?(ForemanFogProxmox::Semver::SemverClass)
|
49
|
+
assert_equal 6, semver.major
|
50
|
+
assert_equal 0, semver.minor
|
51
|
+
assert_equal 0, semver.patch
|
52
|
+
assert_equal '6', semver.qualifier
|
53
|
+
end
|
54
|
+
it '#5.3beta raises ArgumentError' do
|
55
|
+
assert_raises ArgumentError do
|
56
|
+
ForemanFogProxmox::Semver.to_semver('5.3beta')
|
31
57
|
end
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
58
|
+
end
|
59
|
+
end
|
60
|
+
# rubocop:disable Lint/UselessComparison
|
61
|
+
describe 'semverclass comparators' do
|
62
|
+
it '#5.3.0 <= 5.4.0 returns true' do
|
63
|
+
assert ForemanFogProxmox::Semver.to_semver('5.3.0') <= ForemanFogProxmox::Semver.to_semver('5.4.0')
|
64
|
+
end
|
65
|
+
it '#2.4.0 >= 1.3.0 returns true' do
|
66
|
+
assert ForemanFogProxmox::Semver.to_semver('2.4.0') >= ForemanFogProxmox::Semver.to_semver('1.3.0')
|
67
|
+
end
|
68
|
+
it '#1.0.10 <= 1.0.20 returns true' do
|
69
|
+
assert ForemanFogProxmox::Semver.to_semver('1.0.10') <= ForemanFogProxmox::Semver.to_semver('1.0.20')
|
70
|
+
end
|
71
|
+
it '#1.2.3-beta == 1.2.3-beta returns true' do
|
72
|
+
assert ForemanFogProxmox::Semver.to_semver('1.2.3-beta') == ForemanFogProxmox::Semver.to_semver('1.2.3-beta')
|
73
|
+
end
|
74
|
+
it '#1.2.3-beta >= 1.-beta raises ArgumentError' do
|
75
|
+
assert_raises ArgumentError do
|
76
|
+
ForemanFogProxmox::Semver.to_semver('1.2.3-beta') >= ForemanFogProxmox::Semver.to_semver('1.-beta')
|
47
77
|
end
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
it '#2.4.0 >= 1.3.0 returns true' do
|
53
|
-
assert ForemanFogProxmox::Semver.to_semver("2.4.0")>=ForemanFogProxmox::Semver.to_semver("1.3.0")
|
54
|
-
end
|
55
|
-
it '#1.0.10 <= 1.0.20 returns true' do
|
56
|
-
assert ForemanFogProxmox::Semver.to_semver("1.0.10")<=ForemanFogProxmox::Semver.to_semver("1.0.20")
|
57
|
-
end
|
58
|
-
it '#1.2.3-beta == 1.2.3-beta returns true' do
|
59
|
-
assert ForemanFogProxmox::Semver.to_semver("1.2.3-beta")==ForemanFogProxmox::Semver.to_semver("1.2.3-beta")
|
60
|
-
end
|
61
|
-
it '#1.2.3-beta >= 1.-beta raises ArgumentError' do
|
62
|
-
assert_raises ArgumentError do
|
63
|
-
ForemanFogProxmox::Semver.to_semver("1.2.3-beta")>=ForemanFogProxmox::Semver.to_semver("1.-beta")
|
64
|
-
end
|
65
|
-
end
|
66
|
-
it '#SemverClass(1.2.3-beta) >= String(1.-beta) raises TypeError' do
|
67
|
-
assert_raises TypeError do
|
68
|
-
ForemanFogProxmox::Semver.to_semver("1.2.3-beta")>="1.-beta"
|
69
|
-
end
|
70
|
-
end
|
71
|
-
it '#1.10.2 < 1.20.0 returns true' do
|
72
|
-
assert ForemanFogProxmox::Semver.to_semver("1.10.2")<ForemanFogProxmox::Semver.to_semver("1.20.0")
|
73
|
-
end
|
74
|
-
it '#0.10.2 < 1.20.0 returns true' do
|
75
|
-
assert ForemanFogProxmox::Semver.to_semver("0.10.2")<ForemanFogProxmox::Semver.to_semver("1.20.0")
|
76
|
-
end
|
78
|
+
end
|
79
|
+
it '#SemverClass(1.2.3-beta) >= String(1.-beta) raises TypeError' do
|
80
|
+
assert_raises TypeError do
|
81
|
+
ForemanFogProxmox::Semver.to_semver('1.2.3-beta') >= '1.-beta'
|
77
82
|
end
|
83
|
+
end
|
84
|
+
it '#1.10.2 < 1.20.0 returns true' do
|
85
|
+
assert ForemanFogProxmox::Semver.to_semver('1.10.2') < ForemanFogProxmox::Semver.to_semver('1.20.0')
|
86
|
+
end
|
87
|
+
it '#0.10.2 < 1.20.0 returns true' do
|
88
|
+
assert ForemanFogProxmox::Semver.to_semver('0.10.2') < ForemanFogProxmox::Semver.to_semver('1.20.0')
|
89
|
+
end
|
78
90
|
end
|
79
|
-
|
91
|
+
# rubocop:enable Lint/UselessComparison
|
92
|
+
end
|
93
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_fog_proxmox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tristan Robert
|
@@ -9,36 +9,36 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-11-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: deface
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '0
|
20
|
+
version: '0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '0
|
27
|
+
version: '0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
|
-
name:
|
29
|
+
name: fog-proxmox
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - "
|
32
|
+
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '0'
|
34
|
+
version: '0.8'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - "
|
39
|
+
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '0'
|
41
|
+
version: '0.8'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rdoc
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,6 +115,18 @@ files:
|
|
115
115
|
- app/models/concerns/orchestration/proxmox/compute.rb
|
116
116
|
- app/models/foreman_fog_proxmox/options_select.rb
|
117
117
|
- app/models/foreman_fog_proxmox/proxmox.rb
|
118
|
+
- app/models/foreman_fog_proxmox/proxmox_compute_attributes.rb
|
119
|
+
- app/models/foreman_fog_proxmox/proxmox_connection.rb
|
120
|
+
- app/models/foreman_fog_proxmox/proxmox_console.rb
|
121
|
+
- app/models/foreman_fog_proxmox/proxmox_images.rb
|
122
|
+
- app/models/foreman_fog_proxmox/proxmox_interfaces.rb
|
123
|
+
- app/models/foreman_fog_proxmox/proxmox_operating_systems.rb
|
124
|
+
- app/models/foreman_fog_proxmox/proxmox_token_expiration.rb
|
125
|
+
- app/models/foreman_fog_proxmox/proxmox_version.rb
|
126
|
+
- app/models/foreman_fog_proxmox/proxmox_vm_commands.rb
|
127
|
+
- app/models/foreman_fog_proxmox/proxmox_vm_new.rb
|
128
|
+
- app/models/foreman_fog_proxmox/proxmox_vm_queries.rb
|
129
|
+
- app/models/foreman_fog_proxmox/proxmox_volumes.rb
|
118
130
|
- app/overrides/compute_resources_vms/form/add_clone_to_new_vm_compute_detail.rb
|
119
131
|
- app/overrides/compute_resources_vms/form/add_from_profile_to_compute_attributes_form.rb
|
120
132
|
- app/overrides/compute_resources_vms/form/add_vm_type_to_networks_form.rb
|
@@ -159,18 +171,33 @@ files:
|
|
159
171
|
- lib/foreman_fog_proxmox/version.rb
|
160
172
|
- lib/tasks/foreman_fog_proxmox_tasks.rake
|
161
173
|
- locale/Makefile
|
174
|
+
- locale/en/foreman_fog_proxmox.edit.po
|
162
175
|
- locale/en/foreman_fog_proxmox.po
|
176
|
+
- locale/en/foreman_fog_proxmox.po.time_stamp
|
163
177
|
- locale/foreman_fog_proxmox.pot
|
178
|
+
- locale/fr/foreman_fog_proxmox.edit.po
|
164
179
|
- locale/fr/foreman_fog_proxmox.po
|
180
|
+
- locale/fr/foreman_fog_proxmox.po.time_stamp
|
165
181
|
- locale/gemspec.rb
|
182
|
+
- test/factories/foreman_fog_proxmox/proxmox_container_mock_factory.rb
|
183
|
+
- test/factories/foreman_fog_proxmox/proxmox_node_mock_factory.rb
|
184
|
+
- test/factories/foreman_fog_proxmox/proxmox_server_mock_factory.rb
|
166
185
|
- test/factories/proxmox_factory.rb
|
167
186
|
- test/functional/compute_resources_controller_test.rb
|
168
187
|
- test/test_plugin_helper.rb
|
169
188
|
- test/unit/foreman_fog_proxmox/helpers/proxmox_container_helper_test.rb
|
170
189
|
- test/unit/foreman_fog_proxmox/helpers/proxmox_server_helper_test.rb
|
171
190
|
- test/unit/foreman_fog_proxmox/helpers/proxmox_vm_helper_test.rb
|
191
|
+
- test/unit/foreman_fog_proxmox/proxmox_compute_attributes_test.rb
|
192
|
+
- test/unit/foreman_fog_proxmox/proxmox_interfaces_test.rb
|
172
193
|
- test/unit/foreman_fog_proxmox/proxmox_test.rb
|
173
|
-
- test/unit/foreman_fog_proxmox/
|
194
|
+
- test/unit/foreman_fog_proxmox/proxmox_version_test.rb
|
195
|
+
- test/unit/foreman_fog_proxmox/proxmox_vm_commands_container_test.rb
|
196
|
+
- test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_create_test.rb
|
197
|
+
- test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_test.rb
|
198
|
+
- test/unit/foreman_fog_proxmox/proxmox_vm_commands_test.rb
|
199
|
+
- test/unit/foreman_fog_proxmox/proxmox_vm_new_test.rb
|
200
|
+
- test/unit/foreman_fog_proxmox/proxmox_vm_queries_test.rb
|
174
201
|
- test/unit/foreman_fog_proxmox/semver_test.rb
|
175
202
|
homepage: https://github.com/theforeman/foreman_fog_proxmox
|
176
203
|
licenses:
|
@@ -197,11 +224,22 @@ specification_version: 4
|
|
197
224
|
summary: Foreman plugin that adds Proxmox VE compute resource using fog-proxmox
|
198
225
|
test_files:
|
199
226
|
- test/functional/compute_resources_controller_test.rb
|
227
|
+
- test/unit/foreman_fog_proxmox/proxmox_vm_new_test.rb
|
200
228
|
- test/unit/foreman_fog_proxmox/semver_test.rb
|
229
|
+
- test/unit/foreman_fog_proxmox/proxmox_vm_queries_test.rb
|
201
230
|
- test/unit/foreman_fog_proxmox/proxmox_test.rb
|
202
|
-
- test/unit/foreman_fog_proxmox/
|
231
|
+
- test/unit/foreman_fog_proxmox/proxmox_vm_commands_container_test.rb
|
232
|
+
- test/unit/foreman_fog_proxmox/proxmox_vm_commands_test.rb
|
233
|
+
- test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_create_test.rb
|
234
|
+
- test/unit/foreman_fog_proxmox/proxmox_compute_attributes_test.rb
|
203
235
|
- test/unit/foreman_fog_proxmox/helpers/proxmox_container_helper_test.rb
|
204
236
|
- test/unit/foreman_fog_proxmox/helpers/proxmox_vm_helper_test.rb
|
205
237
|
- test/unit/foreman_fog_proxmox/helpers/proxmox_server_helper_test.rb
|
238
|
+
- test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_test.rb
|
239
|
+
- test/unit/foreman_fog_proxmox/proxmox_interfaces_test.rb
|
240
|
+
- test/unit/foreman_fog_proxmox/proxmox_version_test.rb
|
206
241
|
- test/factories/proxmox_factory.rb
|
242
|
+
- test/factories/foreman_fog_proxmox/proxmox_node_mock_factory.rb
|
243
|
+
- test/factories/foreman_fog_proxmox/proxmox_container_mock_factory.rb
|
244
|
+
- test/factories/foreman_fog_proxmox/proxmox_server_mock_factory.rb
|
207
245
|
- test/test_plugin_helper.rb
|