chef-provisioning-vsphere 0.10.0 → 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/.gitignore +7 -3
- data/.rubocop.yml +8 -0
- data/.rubocop_todo.yml +143 -0
- data/.travis.yml +8 -0
- data/CHANGELOG.md +111 -0
- data/Gemfile +2 -3
- data/LICENSE +19 -19
- data/LICENSE-Rally +20 -20
- data/README.md +29 -19
- data/Rakefile +34 -22
- data/chef-provisioning-vsphere.gemspec +9 -7
- data/contribution-notice +7 -7
- data/lib/chef/provisioning/driver_init/vsphere.rb +4 -3
- data/lib/chef/provisioning/vsphere_driver.rb +16 -14
- data/lib/chef/provisioning/vsphere_driver/clone_spec_builder.rb +68 -53
- data/lib/chef/provisioning/vsphere_driver/driver.rb +96 -70
- data/lib/chef/provisioning/vsphere_driver/version.rb +2 -1
- data/lib/chef/provisioning/vsphere_driver/vsphere_helpers.rb +98 -99
- data/lib/chef/provisioning/vsphere_driver/vsphere_url.rb +46 -45
- data/lib/kitchen/driver/vsphere.rb +27 -27
- data/spec/integration_tests/.gitignore +1 -1
- data/spec/integration_tests/vsphere_driver_spec.rb +50 -51
- data/spec/unit_tests/VsphereDriver_spec.rb +133 -132
- data/spec/unit_tests/VsphereUrl_spec.rb +67 -66
- data/spec/unit_tests/clone_spec_builder_spec.rb +162 -161
- data/spec/unit_tests/support/fake_action_handler.rb +6 -7
- data/spec/unit_tests/support/vsphere_helper_stub.rb +51 -52
- metadata +29 -10
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'json'
|
2
3
|
require 'kitchen'
|
3
4
|
require 'chef/provisioning/vsphere_driver'
|
@@ -6,26 +7,25 @@ require 'chef/provisioning/machine_spec'
|
|
6
7
|
module Kitchen
|
7
8
|
module Driver
|
8
9
|
class Vsphere < Kitchen::Driver::Base
|
9
|
-
|
10
10
|
@@chef_zero_server = false
|
11
11
|
|
12
12
|
default_config :machine_options,
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
13
|
+
start_timeout: 600,
|
14
|
+
create_timeout: 600,
|
15
|
+
stop_timeout: 600,
|
16
|
+
ready_timeout: 90,
|
17
|
+
bootstrap_options: {
|
18
|
+
use_linked_clone: true,
|
19
|
+
ssh: {
|
20
|
+
user: 'root',
|
21
|
+
paranoid: false,
|
22
|
+
port: 22
|
23
|
+
},
|
24
|
+
convergence_options: {},
|
25
|
+
customization_spec: {
|
26
|
+
domain: 'local'
|
27
|
+
}
|
28
|
+
}
|
29
29
|
|
30
30
|
default_config(:vsphere_name) do |driver|
|
31
31
|
"#{driver.instance.name}-#{SecureRandom.hex(4)}"
|
@@ -37,7 +37,7 @@ module Kitchen
|
|
37
37
|
state[:password] = config[:machine_options][:bootstrap_options][:ssh][:password]
|
38
38
|
config[:server_name] = state[:vsphere_name]
|
39
39
|
|
40
|
-
machine = with_provisioning_driver(state) do |
|
40
|
+
machine = with_provisioning_driver(state) do |action_handler, driver, machine_spec|
|
41
41
|
driver.allocate_machine(action_handler, machine_spec, config[:machine_options])
|
42
42
|
driver.ready_machine(action_handler, machine_spec, config[:machine_options])
|
43
43
|
state[:server_id] = machine_spec.location['server_id']
|
@@ -49,9 +49,9 @@ module Kitchen
|
|
49
49
|
def destroy(state)
|
50
50
|
return if state[:server_id].nil?
|
51
51
|
|
52
|
-
with_provisioning_driver(state) do |
|
52
|
+
with_provisioning_driver(state) do |action_handler, driver, machine_spec|
|
53
53
|
machine_spec.location = { 'driver_url' => driver.driver_url,
|
54
|
-
|
54
|
+
'server_id' => state[:server_id] }
|
55
55
|
driver.destroy_machine(action_handler, machine_spec, config[:machine_options])
|
56
56
|
end
|
57
57
|
|
@@ -60,23 +60,23 @@ module Kitchen
|
|
60
60
|
state.delete(:vsphere_name)
|
61
61
|
end
|
62
62
|
|
63
|
-
def with_provisioning_driver(state
|
64
|
-
config[:machine_options][:convergence_options] = {:chef_server
|
63
|
+
def with_provisioning_driver(state)
|
64
|
+
config[:machine_options][:convergence_options] = { chef_server: chef_server }
|
65
65
|
machine_spec = Chef::Provisioning.chef_managed_entry_store(chef_server).get(:machine, state[:vsphere_name])
|
66
66
|
if machine_spec.nil?
|
67
67
|
machine_spec = Chef::Provisioning.chef_managed_entry_store(chef_server)
|
68
|
-
|
68
|
+
.new_entry(:machine, state[:vsphere_name])
|
69
69
|
end
|
70
70
|
url = URI::VsphereUrl.from_config(@config[:driver_options]).to_s
|
71
71
|
driver = Chef::Provisioning.driver_for_url(url, config)
|
72
72
|
action_handler = Chef::Provisioning::ActionHandler.new
|
73
|
-
|
73
|
+
yield(action_handler, driver, machine_spec)
|
74
74
|
end
|
75
75
|
|
76
76
|
def chef_server
|
77
|
-
|
77
|
+
unless @@chef_zero_server
|
78
78
|
vsphere_mutex.synchronize do
|
79
|
-
|
79
|
+
unless @@chef_zero_server
|
80
80
|
Chef::Config.local_mode = true
|
81
81
|
Chef::Config.chef_repo_path = Chef::Config.find_chef_repo_path(Dir.pwd)
|
82
82
|
require 'chef/local_mode'
|
@@ -92,7 +92,7 @@ module Kitchen
|
|
92
92
|
def vsphere_mutex
|
93
93
|
@@vsphere_mutex ||= begin
|
94
94
|
Kitchen.mutex.synchronize do
|
95
|
-
instance.class.mutexes ||=
|
95
|
+
instance.class.mutexes ||= {}
|
96
96
|
instance.class.mutexes[self.class] = Mutex.new
|
97
97
|
end
|
98
98
|
|
@@ -1 +1 @@
|
|
1
|
-
config.rb
|
1
|
+
config.rb
|
@@ -1,37 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'chef/provisioning/vsphere_driver'
|
2
3
|
require 'chef/provisioning/machine_spec'
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
5
|
+
# A file named config.rb in the same directory as this spec file
|
6
|
+
# must exist containing the driver options to use for the test.
|
7
|
+
# Here is an example:
|
8
|
+
# {
|
9
|
+
# :driver_options => {
|
10
|
+
# :host => '213.45.67.88',
|
11
|
+
# :user => 'vmapi',
|
12
|
+
# :password => 'SuperSecureP@ssw0rd',
|
13
|
+
# :insecure => true
|
14
|
+
# },
|
15
|
+
# :machine_options => {
|
16
|
+
# :start_timeout => 600,
|
17
|
+
# :create_timeout => 600,
|
18
|
+
# :bootstrap_options => {
|
19
|
+
# :datacenter => 'QA1',
|
20
|
+
# :template_name => 'UBUNTU-12-64-TEMPLATE',
|
21
|
+
# :vm_folder => 'DLAB',
|
22
|
+
# :num_cpus => 2,
|
23
|
+
# :network_name => 'vlan152_172.21.152',
|
24
|
+
# :memory_mb => 4096,
|
25
|
+
# :resource_pool => 'CLSTR02/DLAB',
|
26
|
+
# :ssh => {
|
27
|
+
# :user => 'root',
|
28
|
+
# :password => 'SuperSecureP@ssw0rd',
|
29
|
+
# :paranoid => false,
|
30
|
+
# :port => 22
|
31
|
+
# },
|
32
|
+
# :convergence_options => {}
|
33
|
+
# }
|
34
|
+
# }
|
35
|
+
# }
|
35
36
|
|
36
37
|
describe 'vsphere_driver' do
|
37
38
|
before :all do
|
@@ -45,7 +46,7 @@ describe 'vsphere_driver' do
|
|
45
46
|
@driver = Chef::Provisioning.driver_for_url(url, @metal_config)
|
46
47
|
action_handler = Chef::Provisioning::ActionHandler.new
|
47
48
|
@driver.allocate_machine(action_handler, @machine_spec, @metal_config[:machine_options])
|
48
|
-
@metal_config[:machine_options][:convergence_options] = {:chef_server
|
49
|
+
@metal_config[:machine_options][:convergence_options] = { chef_server: chef_server }
|
49
50
|
machine = @driver.ready_machine(action_handler, @machine_spec, @metal_config[:machine_options])
|
50
51
|
@server_id = @machine_spec.location['server_id']
|
51
52
|
@vsphere_helper = ChefProvisioningVsphere::VsphereHelper.new(
|
@@ -57,7 +58,6 @@ describe 'vsphere_driver' do
|
|
57
58
|
end
|
58
59
|
|
59
60
|
context 'when allocating a machine' do
|
60
|
-
|
61
61
|
it 'adds machine to the correct folder' do
|
62
62
|
expect(@vm.parent.name).to eq(@metal_config[:machine_options][:bootstrap_options][:vm_folder])
|
63
63
|
end
|
@@ -65,13 +65,13 @@ describe 'vsphere_driver' do
|
|
65
65
|
expect(@vm.config.instanceUuid).to eq(@machine_spec.location['server_id'])
|
66
66
|
end
|
67
67
|
it 'has the correct name' do
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
68
|
+
now = Time.now.utc
|
69
|
+
trimmed_name = @vm.config.guestId.start_with?('win') ? @vm_name.byteslice(0, 15) : @vm_name
|
70
|
+
expected_name = "#{trimmed_name}.#{@metal_config[:machine_options][:bootstrap_options][:customization_spec][:domain]}"
|
71
|
+
until (Time.now.utc - now) > 30 || (@vm.guest.hostName == expected_name)
|
72
|
+
print '.'
|
73
|
+
sleep 5
|
74
|
+
end
|
75
75
|
expect(@vm.guest.hostName).to eq(expected_name)
|
76
76
|
end
|
77
77
|
it 'has the correct number of CPUs' do
|
@@ -81,24 +81,24 @@ describe 'vsphere_driver' do
|
|
81
81
|
expect(@vm.config.hardware.memoryMB).to eq(@metal_config[:machine_options][:bootstrap_options][:memory_mb])
|
82
82
|
end
|
83
83
|
it 'is on the correct networks' do
|
84
|
-
expect(@vm.network.map
|
85
|
-
expect(@vm.network.map
|
84
|
+
expect(@vm.network.map(&:name)).to include(@metal_config[:machine_options][:bootstrap_options][:network_name][0])
|
85
|
+
expect(@vm.network.map(&:name)).to include(@metal_config[:machine_options][:bootstrap_options][:network_name][1])
|
86
86
|
end
|
87
87
|
it 'is on the correct datastore' do
|
88
88
|
expect(@vm.datastore[0].name).to eq(@metal_config[:machine_options][:bootstrap_options][:datastore])
|
89
89
|
end
|
90
90
|
it 'is in the correct resource pool' do
|
91
|
-
if @metal_config[:machine_options][:bootstrap_options].
|
91
|
+
if @metal_config[:machine_options][:bootstrap_options].key?(:resource_pool)
|
92
92
|
expect(@vm.resourcePool.name).to eq(@metal_config[:machine_options][:bootstrap_options][:resource_pool].split('/')[1])
|
93
93
|
end
|
94
94
|
end
|
95
95
|
it 'is in the correct host' do
|
96
|
-
if @metal_config[:machine_options][:bootstrap_options].
|
96
|
+
if @metal_config[:machine_options][:bootstrap_options].key?(:host)
|
97
97
|
expect(@vm.runtime.host.name).to eq(@metal_config[:machine_options][:bootstrap_options][:host].split('/').last)
|
98
98
|
end
|
99
99
|
end
|
100
100
|
it 'is in the correct cluster' do
|
101
|
-
if @metal_config[:machine_options][:bootstrap_options].
|
101
|
+
if @metal_config[:machine_options][:bootstrap_options].key?(:resource_pool)
|
102
102
|
expect(@vm.resourcePool.owner.name).to eq(@metal_config[:machine_options][:bootstrap_options][:resource_pool].split('/')[0])
|
103
103
|
end
|
104
104
|
end
|
@@ -107,7 +107,7 @@ describe 'vsphere_driver' do
|
|
107
107
|
end
|
108
108
|
it 'has an added disk of the correct size' do
|
109
109
|
disk_count = @vm.disks.count
|
110
|
-
expect(@vm.disks[disk_count-1].capacityInKB).to eq(@metal_config[:machine_options][:bootstrap_options][:additional_disk_size_gb][1] * 1024 * 1024)
|
110
|
+
expect(@vm.disks[disk_count - 1].capacityInKB).to eq(@metal_config[:machine_options][:bootstrap_options][:additional_disk_size_gb][1] * 1024 * 1024)
|
111
111
|
end
|
112
112
|
it 'has the correct number of disks' do
|
113
113
|
expect(@vm.disks.count).to eq(3)
|
@@ -120,19 +120,18 @@ describe 'vsphere_driver' do
|
|
120
120
|
end
|
121
121
|
it 'has hot add memory enabled' do
|
122
122
|
expect(@vm.config.memoryHotAddEnabled).to eq(true)
|
123
|
-
end
|
123
|
+
end
|
124
124
|
it 'has the correct IP address' do
|
125
125
|
now = Time.now.utc
|
126
|
-
until (Time.now.utc - now) > 30 || (@vm.guest.toolsRunningStatus == 'guestToolsRunning' && @vm.guest.net.count == 2 && @vm.guest.net[1].ipAddress[1] == @metal_config[:machine_options][:bootstrap_options][:customization_spec][:ipsettings][:ip])
|
126
|
+
until (Time.now.utc - now) > 30 || (@vm.guest.toolsRunningStatus == 'guestToolsRunning' && @vm.guest.net.count == 2 && @vm.guest.net[1].ipAddress[1] == @metal_config[:machine_options][:bootstrap_options][:customization_spec][:ipsettings][:ip])
|
127
127
|
print '.'
|
128
128
|
sleep 5
|
129
129
|
end
|
130
|
-
expect(@vm.guest.net.map
|
130
|
+
expect(@vm.guest.net.map(&:ipAddress).flatten).to include(@metal_config[:machine_options][:bootstrap_options][:customization_spec][:ipsettings][:ip])
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
134
134
|
context 'destroy_machine' do
|
135
|
-
|
136
135
|
it 'removes the machine' do
|
137
136
|
Cheffish.honor_local_mode do
|
138
137
|
chef_server = Cheffish.default_chef_server
|
@@ -140,7 +139,7 @@ describe 'vsphere_driver' do
|
|
140
139
|
driver = Chef::Provisioning.driver_for_url(url, @metal_config)
|
141
140
|
action_handler = Chef::Provisioning::ActionHandler.new
|
142
141
|
machine_spec = Chef::Provisioning.chef_managed_entry_store(chef_server)
|
143
|
-
|
142
|
+
.new_entry(:machine, @vm_name)
|
144
143
|
machine_spec.location = {
|
145
144
|
'driver_url' => driver.driver_url,
|
146
145
|
'server_id' => @server_id
|
@@ -1,132 +1,133 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
:
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
:
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
'
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
'
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
:
|
91
|
-
:
|
92
|
-
:
|
93
|
-
:
|
94
|
-
:
|
95
|
-
:
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
:
|
116
|
-
:
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'chef/provisioning/vsphere_driver'
|
3
|
+
|
4
|
+
describe ChefProvisioningVsphere::VsphereDriver do
|
5
|
+
subject do
|
6
|
+
Chef::Provisioning.driver_for_url(
|
7
|
+
'vsphere://3.3.3.3:999/crazyapi?use_ssl=false&insecure=true',
|
8
|
+
metal_config
|
9
|
+
)
|
10
|
+
end
|
11
|
+
|
12
|
+
context 'when config does not include the properties included in the url' do
|
13
|
+
let(:metal_config) do
|
14
|
+
{
|
15
|
+
driver_options: {
|
16
|
+
user: 'vmapi',
|
17
|
+
password: '<password>'
|
18
|
+
},
|
19
|
+
machine_options: {
|
20
|
+
ssh: {
|
21
|
+
password: '<password>',
|
22
|
+
paranoid: false
|
23
|
+
},
|
24
|
+
bootstrap_options: {
|
25
|
+
datacenter: 'QA1',
|
26
|
+
template_name: 'UBUNTU-12-64-TEMPLATE',
|
27
|
+
vm_folder: 'DLAB',
|
28
|
+
num_cpus: 2,
|
29
|
+
memory_mb: 4096,
|
30
|
+
resource_pool: 'CLSTR02/DLAB'
|
31
|
+
}
|
32
|
+
},
|
33
|
+
log_level: :debug
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'populates the connect options with correct host from the driver url' do
|
38
|
+
expect(subject.connect_options[:host]).to eq('3.3.3.3')
|
39
|
+
end
|
40
|
+
it 'populates the connect options with correct port from the driver url' do
|
41
|
+
expect(subject.connect_options[:port]).to eq(999)
|
42
|
+
end
|
43
|
+
it 'populates the connect options with correct path from the driver url' do
|
44
|
+
expect(subject.connect_options[:path]).to eq('/crazyapi')
|
45
|
+
end
|
46
|
+
it 'populates the connect options with correct use_ssl setting from the driver url' do
|
47
|
+
expect(subject.connect_options[:use_ssl]).to eq(false)
|
48
|
+
end
|
49
|
+
it 'populates the connect options with correct insecure setting from the driver url' do
|
50
|
+
expect(subject.connect_options[:insecure]).to eq(true)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
context 'when config keys are stringified' do
|
55
|
+
let(:metal_config) do
|
56
|
+
{
|
57
|
+
'driver_options' => {
|
58
|
+
'user' => 'vmapi',
|
59
|
+
'password' => '<driver_password>'
|
60
|
+
},
|
61
|
+
'bootstrap_options' => {
|
62
|
+
'machine_options' => {
|
63
|
+
'datacenter' => 'QA1',
|
64
|
+
'ssh' => {
|
65
|
+
'password' => '<machine_password>'
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'will symbolize user' do
|
73
|
+
expect(subject.connect_options[:user]).to eq('vmapi')
|
74
|
+
end
|
75
|
+
it 'will symbolize password' do
|
76
|
+
expect(subject.connect_options[:password]).to eq('<driver_password>')
|
77
|
+
end
|
78
|
+
it 'will symbolize ssh password' do
|
79
|
+
expect(subject.config[:bootstrap_options][:machine_options][:ssh][:password]).to eq('<machine_password>')
|
80
|
+
end
|
81
|
+
it 'will symbolize ssh bootstrap options' do
|
82
|
+
expect(subject.config[:bootstrap_options][:machine_options][:datacenter]).to eq('QA1')
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
describe 'canonicalize_url' do
|
87
|
+
context 'when no url is in the config' do
|
88
|
+
let(:metal_config) do
|
89
|
+
{
|
90
|
+
user: 'vmapi',
|
91
|
+
password: '<password>',
|
92
|
+
host: '4.4.4.4',
|
93
|
+
port: 888,
|
94
|
+
path: '/yoda',
|
95
|
+
use_ssl: false,
|
96
|
+
insecure: true
|
97
|
+
}
|
98
|
+
end
|
99
|
+
|
100
|
+
subject do
|
101
|
+
ChefProvisioningVsphere::VsphereDriver.canonicalize_url(
|
102
|
+
nil,
|
103
|
+
metal_config
|
104
|
+
)
|
105
|
+
end
|
106
|
+
|
107
|
+
it 'creates the correct driver url from config settings' do
|
108
|
+
expect(subject[0]).to eq('vsphere://4.4.4.4:888/yoda?use_ssl=false&insecure=true')
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
context 'when no url is in the config and config is missing defaulted values' do
|
113
|
+
let(:metal_config) do
|
114
|
+
{
|
115
|
+
user: 'vmapi',
|
116
|
+
password: '<password>',
|
117
|
+
host: '4.4.4.4'
|
118
|
+
}
|
119
|
+
end
|
120
|
+
|
121
|
+
subject do
|
122
|
+
ChefProvisioningVsphere::VsphereDriver.canonicalize_url(
|
123
|
+
nil,
|
124
|
+
metal_config
|
125
|
+
)
|
126
|
+
end
|
127
|
+
|
128
|
+
it 'creates the correct driver url from default settings' do
|
129
|
+
expect(subject[0]).to eq('vsphere://4.4.4.4/sdk?use_ssl=true&insecure=false')
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|