vagrant-libvirt 0.0.45 → 0.4.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/README.md +542 -167
- data/lib/vagrant-libvirt/action.rb +2 -2
- data/lib/vagrant-libvirt/action/create_domain.rb +112 -42
- data/lib/vagrant-libvirt/action/create_domain_volume.rb +14 -10
- data/lib/vagrant-libvirt/action/create_network_interfaces.rb +8 -5
- data/lib/vagrant-libvirt/action/create_networks.rb +2 -2
- data/lib/vagrant-libvirt/action/destroy_domain.rb +1 -1
- data/lib/vagrant-libvirt/action/forward_ports.rb +10 -8
- data/lib/vagrant-libvirt/action/halt_domain.rb +1 -1
- data/lib/vagrant-libvirt/action/handle_box_image.rb +28 -60
- data/lib/vagrant-libvirt/action/handle_storage_pool.rb +4 -4
- data/lib/vagrant-libvirt/action/package_domain.rb +64 -12
- data/lib/vagrant-libvirt/action/prepare_nfs_settings.rb +3 -9
- data/lib/vagrant-libvirt/action/prune_nfs_exports.rb +19 -9
- data/lib/vagrant-libvirt/action/remove_libvirt_image.rb +2 -2
- data/lib/vagrant-libvirt/action/remove_stale_volume.rb +17 -11
- data/lib/vagrant-libvirt/action/set_boot_order.rb +2 -2
- data/lib/vagrant-libvirt/action/set_name_of_domain.rb +6 -9
- data/lib/vagrant-libvirt/action/start_domain.rb +87 -30
- data/lib/vagrant-libvirt/action/wait_till_up.rb +10 -32
- data/lib/vagrant-libvirt/cap/public_address.rb +16 -0
- data/lib/vagrant-libvirt/cap/synced_folder.rb +3 -3
- data/lib/vagrant-libvirt/config.rb +294 -42
- data/lib/vagrant-libvirt/driver.rb +49 -34
- data/lib/vagrant-libvirt/errors.rb +5 -5
- data/lib/vagrant-libvirt/plugin.rb +7 -2
- data/lib/vagrant-libvirt/provider.rb +2 -9
- data/lib/vagrant-libvirt/templates/domain.xml.erb +52 -10
- data/lib/vagrant-libvirt/templates/public_interface.xml.erb +5 -1
- data/lib/vagrant-libvirt/util.rb +1 -0
- data/lib/vagrant-libvirt/util/erb_template.rb +6 -7
- data/lib/vagrant-libvirt/util/network_util.rb +6 -1
- data/lib/vagrant-libvirt/util/nfs.rb +17 -0
- data/lib/vagrant-libvirt/util/ui.rb +23 -0
- data/lib/vagrant-libvirt/version +1 -0
- data/lib/vagrant-libvirt/version.rb +72 -1
- data/locales/en.yml +6 -6
- data/spec/spec_helper.rb +28 -2
- data/spec/support/libvirt_context.rb +3 -1
- data/spec/support/sharedcontext.rb +7 -3
- data/spec/unit/action/create_domain_spec.rb +160 -0
- data/spec/unit/action/create_domain_spec/default_system_storage_pool.xml +17 -0
- data/spec/unit/action/create_domain_spec/default_user_storage_pool.xml +17 -0
- data/spec/unit/action/destroy_domain_spec.rb +2 -2
- data/spec/unit/action/set_name_of_domain_spec.rb +3 -3
- data/spec/unit/action/start_domain_spec.rb +231 -0
- data/spec/unit/action/start_domain_spec/clock_timer_rtc.xml +50 -0
- data/spec/unit/action/start_domain_spec/default.xml +48 -0
- data/spec/unit/action/start_domain_spec/default_added_tpm_path.xml +48 -0
- data/spec/unit/action/start_domain_spec/default_added_tpm_version.xml +48 -0
- data/spec/unit/action/wait_till_up_spec.rb +14 -9
- data/spec/unit/config_spec.rb +438 -0
- data/spec/unit/provider_spec.rb +11 -0
- data/spec/unit/templates/domain_all_settings.xml +20 -5
- data/spec/unit/templates/domain_custom_cpu_model.xml +4 -1
- data/spec/unit/templates/domain_defaults.xml +4 -1
- data/spec/unit/templates/domain_spec.rb +92 -4
- data/spec/unit/templates/tpm/version_1.2.xml +54 -0
- data/spec/unit/templates/tpm/version_2.0.xml +53 -0
- metadata +91 -36
- data/.coveralls.yml +0 -1
- data/.github/issue_template.md +0 -37
- data/.gitignore +0 -21
- data/.travis.yml +0 -24
- data/Gemfile +0 -26
- data/Rakefile +0 -8
- data/example_box/README.md +0 -29
- data/example_box/Vagrantfile +0 -60
- data/example_box/metadata.json +0 -5
- data/lib/vagrant-libvirt/templates/default_storage_volume.xml.erb +0 -14
- data/tools/create_box.sh +0 -130
- data/tools/prepare_redhat_for_box.sh +0 -119
- data/vagrant-libvirt.gemspec +0 -51
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
module VagrantPlugins
|
3
|
+
module ProviderLibvirt
|
4
|
+
module Util
|
5
|
+
module Ui
|
6
|
+
# Since v2.2.8 Vagrant support --no-tty option, which silences
|
7
|
+
# progress bars and other interactive elements for cleaner logs
|
8
|
+
# in scripts, but requires a slight change in UI object handling.
|
9
|
+
# This helper allows the vagrant-libvirt plugin to stay compatible
|
10
|
+
# with the older Vagrant versions.
|
11
|
+
# See: https://github.com/hashicorp/vagrant/pull/11465/
|
12
|
+
def rewriting(ui)
|
13
|
+
if ui.respond_to?(:rewriting)
|
14
|
+
ui.rewriting {|rw| yield rw}
|
15
|
+
else
|
16
|
+
yield ui
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
0.4.0
|
@@ -1,5 +1,76 @@
|
|
1
|
+
require 'open3'
|
2
|
+
require 'tmpdir'
|
3
|
+
|
1
4
|
module VagrantPlugins
|
2
5
|
module ProviderLibvirt
|
3
|
-
|
6
|
+
VERSION_FILE = File.dirname(__FILE__) + "/version"
|
7
|
+
|
8
|
+
GIT_ARCHIVE_VERSION = "$Format:%H %D$"
|
9
|
+
|
10
|
+
HOMEPAGE = 'https://github.com/vagrant-libvirt/vagrant-libvirt'
|
11
|
+
|
12
|
+
def self.get_version
|
13
|
+
if File.exist?(VERSION_FILE)
|
14
|
+
# built gem
|
15
|
+
version = File.read(VERSION_FILE)
|
16
|
+
elsif self.inside_git_repository
|
17
|
+
# local repo
|
18
|
+
git_version = `git describe --tags`
|
19
|
+
version = self.version_from_describe(git_version)
|
20
|
+
elsif !GIT_ARCHIVE_VERSION.start_with?('$Format')
|
21
|
+
# archive - format string replaced during export
|
22
|
+
hash, refs = GIT_ARCHIVE_VERSION.split(' ', 2)
|
23
|
+
|
24
|
+
tag = refs.split(',').select { |ref| ref.strip.start_with?("tag:") }.first
|
25
|
+
if tag != nil
|
26
|
+
# tagged
|
27
|
+
version = tag.strip.split(' ').last
|
28
|
+
else
|
29
|
+
version = ""
|
30
|
+
# arbitrary branch/commit
|
31
|
+
Dir.mktmpdir do |dir|
|
32
|
+
stdout_and_stderr, status = Open3.capture2e("git -C #{dir} clone --bare #{HOMEPAGE}")
|
33
|
+
raise "failed to clone original to resolve version: #{stdout_and_stderr}" unless status.success?
|
34
|
+
|
35
|
+
stdout_and_stderr, status = Open3.capture2e("git --git-dir=#{dir}/vagrant-libvirt.git describe --tags #{hash}")
|
36
|
+
raise "failed to determine version for #{hash}: #{stdout_and_stderr}" unless status.success?
|
37
|
+
|
38
|
+
version = version_from_describe(stdout_and_stderr)
|
39
|
+
end
|
40
|
+
|
41
|
+
# in this case write the version file to avoid cloning a second time
|
42
|
+
File.write(VERSION_FILE, version)
|
43
|
+
end
|
44
|
+
else
|
45
|
+
# no idea
|
46
|
+
version = "9999"
|
47
|
+
end
|
48
|
+
|
49
|
+
return version.freeze
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.write_version
|
53
|
+
File.write(VERSION_FILE, self.get_version)
|
54
|
+
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
def self.inside_git_repository
|
59
|
+
_, status = Open3.capture2e("git rev-parse --git-dir")
|
60
|
+
|
61
|
+
status.success?
|
62
|
+
end
|
63
|
+
|
64
|
+
def self.version_from_describe(describe)
|
65
|
+
version_parts = describe.split('-').first(2) # drop the git sha if it exists
|
66
|
+
if version_parts.length > 1
|
67
|
+
# increment the patch number so that this is marked as a pre-release of the
|
68
|
+
# next possible release
|
69
|
+
main_version_parts = Gem::Version.new(version_parts[0]).segments
|
70
|
+
main_version_parts[-1] = main_version_parts.last + 1
|
71
|
+
version_parts = main_version_parts + ["pre", version_parts[1]]
|
72
|
+
end
|
73
|
+
version = version_parts.join(".")
|
74
|
+
end
|
4
75
|
end
|
5
76
|
end
|
data/locales/en.yml
CHANGED
@@ -16,7 +16,7 @@ en:
|
|
16
16
|
Created volume larger than box defaults, will require manual resizing of
|
17
17
|
filesystems to utilize.
|
18
18
|
uploading_volume: |-
|
19
|
-
Uploading base box image as volume into
|
19
|
+
Uploading base box image as volume into Libvirt storage...
|
20
20
|
creating_domain_volume: |-
|
21
21
|
Creating image (snapshot of base box volume).
|
22
22
|
removing_domain_volume: |-
|
@@ -60,7 +60,7 @@ en:
|
|
60
60
|
Forwarding UDP ports is not supported. Ignoring.
|
61
61
|
|
62
62
|
errors:
|
63
|
-
package_not_supported: No support for package with
|
63
|
+
package_not_supported: No support for package with Libvirt. Create box manually.
|
64
64
|
fog_error: |-
|
65
65
|
There was an error talking to Libvirt. The error message is shown
|
66
66
|
below:
|
@@ -97,7 +97,7 @@ en:
|
|
97
97
|
wrong_box_format: |-
|
98
98
|
Wrong image format specified for box.
|
99
99
|
fog_libvirt_connection_error: |-
|
100
|
-
Error while connecting to
|
100
|
+
Error while connecting to Libvirt: %{error_message}
|
101
101
|
fog_create_volume_error: |-
|
102
102
|
Error while creating a storage pool volume: %{error_message}
|
103
103
|
fog_create_domain_volume_error: |-
|
@@ -108,11 +108,11 @@ en:
|
|
108
108
|
Name `%{domain_name}` of domain about to create is already taken. Please try to run
|
109
109
|
`vagrant up` command again.
|
110
110
|
creating_storage_pool_error: |-
|
111
|
-
There was error while creating
|
112
|
-
creating_volume_error: |-
|
113
|
-
There was error while creating libvirt volume: %{error_message}
|
111
|
+
There was error while creating Libvirt storage pool: %{error_message}
|
114
112
|
image_upload_error: |-
|
115
113
|
Error while uploading image to storage pool: %{error_message}
|
114
|
+
image_download_error: |-
|
115
|
+
Error while downloading volume '%{volume_name}' from storage pool '%{pool_name}': %{error_message}
|
116
116
|
no_domain_error: |-
|
117
117
|
No domain found. %{error_message}
|
118
118
|
attach_device_error: |-
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,31 @@
|
|
1
|
-
require '
|
2
|
-
|
1
|
+
require 'simplecov'
|
2
|
+
require 'simplecov-lcov'
|
3
|
+
|
4
|
+
# patch simplecov configuration
|
5
|
+
if ! SimpleCov::Configuration.method_defined? :branch_coverage?
|
6
|
+
module SimpleCov
|
7
|
+
module Configuration
|
8
|
+
def branch_coverage?
|
9
|
+
return false
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
SimpleCov::Formatter::LcovFormatter.config do |config|
|
16
|
+
config.report_with_single_file = true
|
17
|
+
config.single_report_path = 'coverage/lcov.info'
|
18
|
+
end
|
19
|
+
|
20
|
+
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(
|
21
|
+
[
|
22
|
+
SimpleCov::Formatter::HTMLFormatter,
|
23
|
+
SimpleCov::Formatter::LcovFormatter,
|
24
|
+
]
|
25
|
+
)
|
26
|
+
SimpleCov.start do
|
27
|
+
add_filter 'spec/'
|
28
|
+
end
|
3
29
|
|
4
30
|
require 'vagrant-libvirt'
|
5
31
|
require 'support/environment_helper'
|
@@ -7,6 +7,7 @@ shared_context 'libvirt' do
|
|
7
7
|
let(:id) { 'dummy-vagrant_dummy' }
|
8
8
|
let(:connection) { double('connection') }
|
9
9
|
let(:domain) { double('domain') }
|
10
|
+
let(:logger) { double('logger') }
|
10
11
|
|
11
12
|
def connection_result(options = {})
|
12
13
|
result = options.fetch(:result, nil)
|
@@ -25,6 +26,7 @@ shared_context 'libvirt' do
|
|
25
26
|
# return some information for domain when needed
|
26
27
|
allow(domain).to receive(:mac).and_return('9C:D5:53:F1:5A:E7')
|
27
28
|
|
28
|
-
machine.
|
29
|
+
allow(machine).to receive(:id).and_return(id)
|
30
|
+
allow(Log4r::Logger).to receive(:new).and_return(logger)
|
29
31
|
end
|
30
32
|
end
|
@@ -3,10 +3,14 @@ require 'spec_helper'
|
|
3
3
|
shared_context 'unit' do
|
4
4
|
include_context 'vagrant-unit'
|
5
5
|
|
6
|
+
let(:vagrantfile_providerconfig) { '' }
|
6
7
|
let(:vagrantfile) do
|
7
8
|
<<-EOF
|
8
9
|
Vagrant.configure('2') do |config|
|
9
10
|
config.vm.define :test
|
11
|
+
config.vm.provider :libvirt do |libvirt|
|
12
|
+
#{vagrantfile_providerconfig}
|
13
|
+
end
|
10
14
|
end
|
11
15
|
EOF
|
12
16
|
end
|
@@ -17,7 +21,7 @@ shared_context 'unit' do
|
|
17
21
|
end
|
18
22
|
let(:env) { { env: iso_env, machine: machine, ui: ui, root_path: '/rootpath' } }
|
19
23
|
let(:conf) { Vagrant::Config::V2::DummyConfig.new }
|
20
|
-
let(:ui) { Vagrant::UI::
|
24
|
+
let(:ui) { Vagrant::UI::Silent.new }
|
21
25
|
let(:iso_env) { test_env.create_vagrant_env ui_class: Vagrant::UI::Basic }
|
22
26
|
let(:machine) { iso_env.machine(:test, :libvirt) }
|
23
27
|
# Mock the communicator to prevent SSH commands for being executed.
|
@@ -28,7 +32,7 @@ shared_context 'unit' do
|
|
28
32
|
let(:plugin) { register_plugin }
|
29
33
|
|
30
34
|
before (:each) do
|
31
|
-
machine.
|
32
|
-
machine.
|
35
|
+
allow(machine).to receive(:guest).and_return(guest)
|
36
|
+
allow(machine).to receive(:communicator).and_return(communicator)
|
33
37
|
end
|
34
38
|
end
|
@@ -0,0 +1,160 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'support/sharedcontext'
|
3
|
+
require 'support/libvirt_context'
|
4
|
+
|
5
|
+
require 'vagrant-libvirt/errors'
|
6
|
+
require 'vagrant-libvirt/action/create_domain'
|
7
|
+
|
8
|
+
describe VagrantPlugins::ProviderLibvirt::Action::CreateDomain do
|
9
|
+
subject { described_class.new(app, env) }
|
10
|
+
|
11
|
+
include_context 'unit'
|
12
|
+
include_context 'libvirt'
|
13
|
+
|
14
|
+
let(:libvirt_client) { double('libvirt_client') }
|
15
|
+
let(:servers) { double('servers') }
|
16
|
+
let(:volumes) { double('volumes') }
|
17
|
+
|
18
|
+
let(:storage_pool_xml) { File.read(File.join(File.dirname(__FILE__), File.basename(__FILE__, '.rb'), test_file)) }
|
19
|
+
let(:libvirt_storage_pool) { double('storage_pool') }
|
20
|
+
|
21
|
+
describe '#call' do
|
22
|
+
before do
|
23
|
+
allow_any_instance_of(VagrantPlugins::ProviderLibvirt::Driver)
|
24
|
+
.to receive(:connection).and_return(connection)
|
25
|
+
allow(connection).to receive(:client).and_return(libvirt_client)
|
26
|
+
|
27
|
+
allow(connection).to receive(:servers).and_return(servers)
|
28
|
+
allow(connection).to receive(:volumes).and_return(volumes)
|
29
|
+
|
30
|
+
allow(logger).to receive(:info)
|
31
|
+
|
32
|
+
env[:domain_name] = "vagrant-test_default"
|
33
|
+
|
34
|
+
# should be ignored for system session and used for user session
|
35
|
+
allow(Process).to receive(:uid).and_return(9999)
|
36
|
+
allow(Process).to receive(:gid).and_return(9999)
|
37
|
+
end
|
38
|
+
|
39
|
+
context 'connection => qemu:///system' do
|
40
|
+
context 'default pool' do
|
41
|
+
let(:test_file) { 'default_system_storage_pool.xml' }
|
42
|
+
|
43
|
+
it 'should execute correctly' do
|
44
|
+
expect(libvirt_client).to receive(:lookup_storage_pool_by_name).and_return(libvirt_storage_pool)
|
45
|
+
expect(libvirt_storage_pool).to receive(:xml_desc).and_return(storage_pool_xml)
|
46
|
+
expect(servers).to receive(:create).and_return(machine)
|
47
|
+
expect(volumes).to_not receive(:create) # additional disks only
|
48
|
+
|
49
|
+
expect(subject.call(env)).to be_nil
|
50
|
+
end
|
51
|
+
|
52
|
+
context 'additional disks' do
|
53
|
+
let(:vagrantfile) do
|
54
|
+
<<-EOF
|
55
|
+
Vagrant.configure('2') do |config|
|
56
|
+
config.vm.define :test
|
57
|
+
config.vm.provider :libvirt do |libvirt|
|
58
|
+
libvirt.storage :file, :size => '20G'
|
59
|
+
end
|
60
|
+
end
|
61
|
+
EOF
|
62
|
+
end
|
63
|
+
|
64
|
+
context 'volume create failed' do
|
65
|
+
it 'should raise an exception' do
|
66
|
+
expect(libvirt_client).to receive(:lookup_storage_pool_by_name).and_return(libvirt_storage_pool)
|
67
|
+
expect(libvirt_storage_pool).to receive(:xml_desc).and_return(storage_pool_xml)
|
68
|
+
expect(volumes).to receive(:create).and_raise(Libvirt::Error)
|
69
|
+
|
70
|
+
expect{ subject.call(env) }.to raise_error(VagrantPlugins::ProviderLibvirt::Errors::FogCreateDomainVolumeError)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
context 'volume create succeeded' do
|
75
|
+
it 'should complete' do
|
76
|
+
expect(libvirt_client).to receive(:lookup_storage_pool_by_name).and_return(libvirt_storage_pool)
|
77
|
+
expect(libvirt_storage_pool).to receive(:xml_desc).and_return(storage_pool_xml)
|
78
|
+
expect(volumes).to receive(:create).with(
|
79
|
+
hash_including(
|
80
|
+
:path => "/var/lib/libvirt/images/vagrant-test_default-vdb.qcow2",
|
81
|
+
:owner => 0,
|
82
|
+
:group => 0,
|
83
|
+
:pool_name => "default",
|
84
|
+
)
|
85
|
+
)
|
86
|
+
expect(servers).to receive(:create).and_return(machine)
|
87
|
+
|
88
|
+
expect(subject.call(env)).to be_nil
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
context 'no default pool' do
|
95
|
+
it 'should raise an exception' do
|
96
|
+
expect(libvirt_client).to receive(:lookup_storage_pool_by_name).and_return(nil)
|
97
|
+
|
98
|
+
expect{ subject.call(env) }.to raise_error(VagrantPlugins::ProviderLibvirt::Errors::NoStoragePool)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
context 'connection => qemu:///session' do
|
104
|
+
let(:vagrantfile) do
|
105
|
+
<<-EOF
|
106
|
+
Vagrant.configure('2') do |config|
|
107
|
+
config.vm.define :test
|
108
|
+
config.vm.provider :libvirt do |libvirt|
|
109
|
+
libvirt.qemu_use_session = true
|
110
|
+
end
|
111
|
+
end
|
112
|
+
EOF
|
113
|
+
end
|
114
|
+
|
115
|
+
context 'default pool' do
|
116
|
+
let(:test_file) { 'default_user_storage_pool.xml' }
|
117
|
+
|
118
|
+
it 'should execute correctly' do
|
119
|
+
expect(libvirt_client).to receive(:lookup_storage_pool_by_name).and_return(libvirt_storage_pool)
|
120
|
+
expect(libvirt_storage_pool).to receive(:xml_desc).and_return(storage_pool_xml)
|
121
|
+
expect(servers).to receive(:create).and_return(machine)
|
122
|
+
|
123
|
+
expect(subject.call(env)).to be_nil
|
124
|
+
end
|
125
|
+
|
126
|
+
context 'additional disks' do
|
127
|
+
let(:vagrantfile) do
|
128
|
+
<<-EOF
|
129
|
+
Vagrant.configure('2') do |config|
|
130
|
+
config.vm.define :test
|
131
|
+
config.vm.provider :libvirt do |libvirt|
|
132
|
+
libvirt.qemu_use_session = true
|
133
|
+
libvirt.storage :file, :size => '20G'
|
134
|
+
end
|
135
|
+
end
|
136
|
+
EOF
|
137
|
+
end
|
138
|
+
|
139
|
+
context 'volume create succeeded' do
|
140
|
+
it 'should complete' do
|
141
|
+
expect(libvirt_client).to receive(:lookup_storage_pool_by_name).and_return(libvirt_storage_pool)
|
142
|
+
expect(libvirt_storage_pool).to receive(:xml_desc).and_return(storage_pool_xml)
|
143
|
+
expect(volumes).to receive(:create).with(
|
144
|
+
hash_including(
|
145
|
+
:path => "/var/lib/libvirt/images/vagrant-test_default-vdb.qcow2",
|
146
|
+
:owner => 9999,
|
147
|
+
:group => 9999,
|
148
|
+
:pool_name => "default",
|
149
|
+
)
|
150
|
+
)
|
151
|
+
expect(servers).to receive(:create).and_return(machine)
|
152
|
+
|
153
|
+
expect(subject.call(env)).to be_nil
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<pool type='dir'>
|
2
|
+
<name>default</name>
|
3
|
+
<uuid>434e1b75-4a72-45d7-8a98-ebd90c125d22</uuid>
|
4
|
+
<capacity unit='bytes'>10737418240</capacity>
|
5
|
+
<allocation unit='bytes'>10737418240</allocation>
|
6
|
+
<available unit='bytes'>10737418240</available>
|
7
|
+
<source>
|
8
|
+
</source>
|
9
|
+
<target>
|
10
|
+
<path>/var/lib/libvirt/images</path>
|
11
|
+
<permissions>
|
12
|
+
<mode>0755</mode>
|
13
|
+
<owner>0</owner>
|
14
|
+
<group>0</group>
|
15
|
+
</permissions>
|
16
|
+
</target>
|
17
|
+
</pool>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<pool type='dir'>
|
2
|
+
<name>default</name>
|
3
|
+
<uuid>434e1b75-4a72-45d7-8a98-ebd90c125d22</uuid>
|
4
|
+
<capacity unit='bytes'>10737418240</capacity>
|
5
|
+
<allocation unit='bytes'>10737418240</allocation>
|
6
|
+
<available unit='bytes'>10737418240</available>
|
7
|
+
<source>
|
8
|
+
</source>
|
9
|
+
<target>
|
10
|
+
<path>/var/lib/libvirt/images</path>
|
11
|
+
<permissions>
|
12
|
+
<mode>0755</mode>
|
13
|
+
<owner>0</owner>
|
14
|
+
<group>0</group>
|
15
|
+
</permissions>
|
16
|
+
</target>
|
17
|
+
</pool>
|
@@ -33,7 +33,7 @@ describe VagrantPlugins::ProviderLibvirt::Action::DestroyDomain do
|
|
33
33
|
before do
|
34
34
|
allow(libvirt_domain).to receive(:list_snapshots).and_return([])
|
35
35
|
allow(libvirt_domain).to receive(:has_managed_save?).and_return(nil)
|
36
|
-
root_disk.
|
36
|
+
allow(root_disk).to receive(:name).and_return('test.img')
|
37
37
|
end
|
38
38
|
|
39
39
|
context 'when only has root disk' do
|
@@ -57,7 +57,7 @@ describe VagrantPlugins::ProviderLibvirt::Action::DestroyDomain do
|
|
57
57
|
|
58
58
|
let(:extra_disk) { double('libvirt_extra_disk') }
|
59
59
|
before do
|
60
|
-
extra_disk.
|
60
|
+
allow(extra_disk).to receive(:name).and_return('test-vdb.qcow2')
|
61
61
|
end
|
62
62
|
|
63
63
|
it 'destroys disks individually' do
|