vagrant-libvirt 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vagrant-libvirt/action.rb +4 -8
- data/lib/vagrant-libvirt/version +1 -1
- data/spec/unit/action_spec.rb +78 -0
- metadata +35 -37
- data/spec/unit/provider_spec.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e9e48f76c74f80aa79c260ab558d0a72ec8dd3ecc667731ff05bd0a54d8ab8b
|
4
|
+
data.tar.gz: 8144733ea9d0f2a0a3152d481ab690120017a6767dcee783de8d5ba86d320d62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4a81d5cacbee89973ae0dee7eedcc28ccee0a66d9d1139cef7a91ade87b16ca85a91f0cf22e7d8659450114691fc3079b7beef5cb002621683881cc99ca634a
|
7
|
+
data.tar.gz: 418ed72a453ba03aca7c0cb67d15adc431d37ab5de7c7f0f2d9f9a987f90ad7a88e923249eaf0a324ebc57886dc1b4d9eb23bcf3258254970dc8cdc8ba9a6f90
|
@@ -233,14 +233,12 @@ module VagrantPlugins
|
|
233
233
|
b.use ConfigValidate
|
234
234
|
b.use Call, IsCreated do |env, b2|
|
235
235
|
unless env[:result]
|
236
|
-
|
237
|
-
next
|
236
|
+
raise Vagrant::Errors::VMNotCreatedError
|
238
237
|
end
|
239
238
|
|
240
239
|
b2.use Call, IsRunning do |env2, b3|
|
241
240
|
unless env2[:result]
|
242
|
-
|
243
|
-
next
|
241
|
+
raise Vagrant::Errors::VMNotRunningError
|
244
242
|
end
|
245
243
|
|
246
244
|
b3.use SSHExec
|
@@ -330,14 +328,12 @@ module VagrantPlugins
|
|
330
328
|
b.use ConfigValidate
|
331
329
|
b.use Call, IsCreated do |env, b2|
|
332
330
|
unless env[:result]
|
333
|
-
|
334
|
-
next
|
331
|
+
raise Vagrant::Errors::VMNotCreatedError
|
335
332
|
end
|
336
333
|
|
337
334
|
b2.use Call, IsRunning do |env2, b3|
|
338
335
|
unless env2[:result]
|
339
|
-
|
340
|
-
next
|
336
|
+
raise Vagrant::Errors::VMNotRunningError
|
341
337
|
end
|
342
338
|
|
343
339
|
b3.use SSHRun
|
data/lib/vagrant-libvirt/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.2
|
data/spec/unit/action_spec.rb
CHANGED
@@ -93,4 +93,82 @@ describe VagrantPlugins::ProviderLibvirt::Action do
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
end
|
96
|
+
|
97
|
+
describe '#action_ssh' do
|
98
|
+
context 'when not created' do
|
99
|
+
before do
|
100
|
+
allow_action_env_result(VagrantPlugins::ProviderLibvirt::Action::IsCreated, false)
|
101
|
+
end
|
102
|
+
|
103
|
+
it 'should cause an error' do
|
104
|
+
expect{ machine.action(:ssh, ssh_opts: {})}.to raise_error(Vagrant::Errors::VMNotCreatedError)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
context 'when created' do
|
109
|
+
before do
|
110
|
+
allow_action_env_result(VagrantPlugins::ProviderLibvirt::Action::IsCreated, true)
|
111
|
+
end
|
112
|
+
|
113
|
+
context 'when not running' do
|
114
|
+
before do
|
115
|
+
allow_action_env_result(VagrantPlugins::ProviderLibvirt::Action::IsRunning, false)
|
116
|
+
end
|
117
|
+
|
118
|
+
it 'should cause an error' do
|
119
|
+
expect{ machine.action(:ssh, ssh_opts: {})}.to raise_error(Vagrant::Errors::VMNotRunningError)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
context 'when running' do
|
124
|
+
before do
|
125
|
+
allow_action_env_result(VagrantPlugins::ProviderLibvirt::Action::IsRunning, true)
|
126
|
+
end
|
127
|
+
|
128
|
+
it 'should call SSHExec' do
|
129
|
+
expect_any_instance_of(Vagrant::Action::Builtin::SSHExec).to receive(:call).and_return(0)
|
130
|
+
expect(machine.action(:ssh, ssh_opts: {})).to match(hash_including({:action_name => :machine_action_ssh}))
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
describe '#action_ssh_run' do
|
137
|
+
context 'when not created' do
|
138
|
+
before do
|
139
|
+
allow_action_env_result(VagrantPlugins::ProviderLibvirt::Action::IsCreated, false)
|
140
|
+
end
|
141
|
+
|
142
|
+
it 'should cause an error' do
|
143
|
+
expect{ machine.action(:ssh_run, ssh_opts: {})}.to raise_error(Vagrant::Errors::VMNotCreatedError)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
context 'when created' do
|
148
|
+
before do
|
149
|
+
allow_action_env_result(VagrantPlugins::ProviderLibvirt::Action::IsCreated, true)
|
150
|
+
end
|
151
|
+
|
152
|
+
context 'when not running' do
|
153
|
+
before do
|
154
|
+
allow_action_env_result(VagrantPlugins::ProviderLibvirt::Action::IsRunning, false)
|
155
|
+
end
|
156
|
+
|
157
|
+
it 'should cause an error' do
|
158
|
+
expect{ machine.action(:ssh_run, ssh_opts: {})}.to raise_error(Vagrant::Errors::VMNotRunningError)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
context 'when running' do
|
163
|
+
before do
|
164
|
+
allow_action_env_result(VagrantPlugins::ProviderLibvirt::Action::IsRunning, true)
|
165
|
+
end
|
166
|
+
|
167
|
+
it 'should call SSHRun' do
|
168
|
+
expect_any_instance_of(Vagrant::Action::Builtin::SSHRun).to receive(:call).and_return(0)
|
169
|
+
expect(machine.action(:ssh_run, ssh_opts: {})).to match(hash_including({:action_name => :machine_action_ssh_run}))
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
96
174
|
end
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-libvirt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukas Stanek
|
8
8
|
- Dima Vasilets
|
9
9
|
- Brian Pitts
|
10
10
|
- Darragh Bailey
|
11
|
-
autorequire:
|
11
|
+
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2021-10-
|
14
|
+
date: 2021-10-12 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec-core
|
@@ -264,7 +264,6 @@ files:
|
|
264
264
|
- spec/unit/action_spec.rb
|
265
265
|
- spec/unit/config_spec.rb
|
266
266
|
- spec/unit/driver_spec.rb
|
267
|
-
- spec/unit/provider_spec.rb
|
268
267
|
- spec/unit/templates/domain_all_settings.xml
|
269
268
|
- spec/unit/templates/domain_custom_cpu_model.xml
|
270
269
|
- spec/unit/templates/domain_defaults.xml
|
@@ -276,7 +275,7 @@ homepage: https://github.com/vagrant-libvirt/vagrant-libvirt
|
|
276
275
|
licenses:
|
277
276
|
- MIT
|
278
277
|
metadata: {}
|
279
|
-
post_install_message:
|
278
|
+
post_install_message:
|
280
279
|
rdoc_options: []
|
281
280
|
require_paths:
|
282
281
|
- lib
|
@@ -291,51 +290,50 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
291
290
|
- !ruby/object:Gem::Version
|
292
291
|
version: '0'
|
293
292
|
requirements: []
|
294
|
-
rubygems_version: 3.0.
|
295
|
-
signing_key:
|
293
|
+
rubygems_version: 3.0.8
|
294
|
+
signing_key:
|
296
295
|
specification_version: 4
|
297
296
|
summary: libvirt provider for Vagrant.
|
298
297
|
test_files:
|
299
|
-
- spec/support/matchers/have_file_content.rb
|
300
|
-
- spec/support/binding_proc.rb
|
301
|
-
- spec/support/environment_helper.rb
|
302
|
-
- spec/support/libvirt_context.rb
|
303
298
|
- spec/support/temporary_dir.rb
|
299
|
+
- spec/support/libvirt_context.rb
|
300
|
+
- spec/support/binding_proc.rb
|
304
301
|
- spec/support/sharedcontext.rb
|
305
|
-
- spec/
|
306
|
-
- spec/
|
302
|
+
- spec/support/matchers/have_file_content.rb
|
303
|
+
- spec/support/environment_helper.rb
|
304
|
+
- spec/unit/action_spec.rb
|
305
|
+
- spec/unit/templates/domain_all_settings.xml
|
306
|
+
- spec/unit/templates/domain_custom_cpu_model.xml
|
307
|
+
- spec/unit/templates/domain_defaults.xml
|
308
|
+
- spec/unit/templates/domain_spec.rb
|
309
|
+
- spec/unit/templates/tpm/version_1.2.xml
|
310
|
+
- spec/unit/templates/tpm/version_2.0.xml
|
307
311
|
- spec/unit/action/create_domain_spec/additional_disks_domain.xml
|
308
312
|
- spec/unit/action/create_domain_spec/default_domain.xml
|
309
|
-
- spec/unit/action/
|
310
|
-
- spec/unit/action/
|
313
|
+
- spec/unit/action/create_domain_spec/default_system_storage_pool.xml
|
314
|
+
- spec/unit/action/create_domain_spec/default_user_storage_pool.xml
|
315
|
+
- spec/unit/action/create_domain_spec.rb
|
316
|
+
- spec/unit/action/wait_till_up_spec.rb
|
317
|
+
- spec/unit/action/package_domain_spec.rb
|
318
|
+
- spec/unit/action/forward_ports_spec.rb
|
319
|
+
- spec/unit/action/destroy_domain_spec.rb
|
320
|
+
- spec/unit/action/halt_domain_spec.rb
|
321
|
+
- spec/unit/action/start_domain_spec.rb
|
322
|
+
- spec/unit/action/shutdown_domain_spec.rb
|
323
|
+
- spec/unit/action/clean_machine_folder_spec.rb
|
324
|
+
- spec/unit/action/create_domain_volume_spec.rb
|
325
|
+
- spec/unit/action/set_name_of_domain_spec.rb
|
311
326
|
- spec/unit/action/create_domain_volume_spec/three_disks_in_storage_disk_1.xml
|
327
|
+
- spec/unit/action/create_domain_volume_spec/three_disks_in_storage_disk_0.xml
|
312
328
|
- spec/unit/action/create_domain_volume_spec/three_disks_in_storage_disk_2.xml
|
329
|
+
- spec/unit/action/create_domain_volume_spec/one_disk_in_storage.xml
|
330
|
+
- spec/unit/action/start_domain_spec/default_added_tpm_path.xml
|
313
331
|
- spec/unit/action/start_domain_spec/clock_timer_rtc.xml
|
314
332
|
- spec/unit/action/start_domain_spec/default.xml
|
315
|
-
- spec/unit/action/start_domain_spec/default_added_tpm_path.xml
|
316
|
-
- spec/unit/action/start_domain_spec/default_added_tpm_version.xml
|
317
333
|
- spec/unit/action/start_domain_spec/existing.xml
|
318
|
-
- spec/unit/action/
|
319
|
-
- spec/unit/action/forward_ports_spec.rb
|
334
|
+
- spec/unit/action/start_domain_spec/default_added_tpm_version.xml
|
320
335
|
- spec/unit/action/handle_box_image_spec.rb
|
321
|
-
- spec/unit/action/set_name_of_domain_spec.rb
|
322
|
-
- spec/unit/action/wait_till_up_spec.rb
|
323
|
-
- spec/unit/action/create_domain_volume_spec.rb
|
324
|
-
- spec/unit/action/start_domain_spec.rb
|
325
|
-
- spec/unit/action/destroy_domain_spec.rb
|
326
|
-
- spec/unit/action/halt_domain_spec.rb
|
327
|
-
- spec/unit/action/create_domain_spec.rb
|
328
|
-
- spec/unit/action/package_domain_spec.rb
|
329
|
-
- spec/unit/action/shutdown_domain_spec.rb
|
330
|
-
- spec/unit/templates/tpm/version_1.2.xml
|
331
|
-
- spec/unit/templates/tpm/version_2.0.xml
|
332
|
-
- spec/unit/templates/domain_custom_cpu_model.xml
|
333
|
-
- spec/unit/templates/domain_defaults.xml
|
334
|
-
- spec/unit/templates/domain_spec.rb
|
335
|
-
- spec/unit/templates/domain_all_settings.xml
|
336
|
-
- spec/unit/util/byte_number_spec.rb
|
337
|
-
- spec/unit/provider_spec.rb
|
338
|
-
- spec/unit/action_spec.rb
|
339
336
|
- spec/unit/config_spec.rb
|
337
|
+
- spec/unit/util/byte_number_spec.rb
|
340
338
|
- spec/unit/driver_spec.rb
|
341
339
|
- spec/spec_helper.rb
|
data/spec/unit/provider_spec.rb
DELETED