beaker-vagrant 0.7.1 → 1.0.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/.github/dependabot.yml +9 -0
- data/.github/workflows/release.yml +17 -9
- data/.github/workflows/test.yml +40 -11
- data/.rubocop.yml +4 -0
- data/.rubocop_todo.yml +383 -0
- data/CHANGELOG.md +194 -19
- data/Gemfile +3 -24
- data/README.md +26 -9
- data/Rakefile +34 -120
- data/beaker-vagrant.gemspec +24 -24
- data/bin/beaker-vagrant +1 -3
- data/lib/beaker/hypervisor/vagrant/mount_folder.rb +1 -1
- data/lib/beaker/hypervisor/vagrant.rb +72 -83
- data/lib/beaker/hypervisor/vagrant_custom.rb +1 -1
- data/lib/beaker/hypervisor/vagrant_desktop.rb +9 -5
- data/lib/beaker/hypervisor/vagrant_libvirt.rb +1 -1
- data/lib/beaker/hypervisor/vagrant_parallels.rb +2 -2
- data/lib/beaker/hypervisor/vagrant_virtualbox.rb +35 -32
- data/lib/beaker/hypervisor/vagrant_workstation.rb +9 -5
- data/lib/beaker-vagrant/version.rb +1 -1
- data/spec/beaker/hypervisor/vagrant_custom_spec.rb +14 -15
- data/spec/beaker/hypervisor/vagrant_desktop_spec.rb +20 -20
- data/spec/beaker/hypervisor/vagrant_fusion_spec.rb +11 -11
- data/spec/beaker/hypervisor/vagrant_libvirt_spec.rb +22 -21
- data/spec/beaker/hypervisor/vagrant_parallels_spec.rb +15 -15
- data/spec/beaker/hypervisor/vagrant_spec.rb +301 -309
- data/spec/beaker/hypervisor/vagrant_virtualbox_spec.rb +50 -29
- data/spec/beaker/hypervisor/vagrant_workstation_spec.rb +20 -20
- data/spec/spec_helper.rb +1 -2
- metadata +68 -36
@@ -1,32 +1,32 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Beaker::VagrantFusion do
|
4
|
-
let(
|
5
|
-
let(
|
6
|
-
let(
|
4
|
+
let(:options) { make_opts.merge({ :hosts_file => 'sample.cfg', 'logger' => double.as_null_object }) }
|
5
|
+
let(:vagrant) { described_class.new(hosts, options) }
|
6
|
+
let(:hosts) { make_hosts }
|
7
7
|
|
8
|
-
it
|
8
|
+
it 'uses the vmware_fusion provider for provisioning' do
|
9
9
|
hosts.each do |host|
|
10
10
|
host_prev_name = host['user']
|
11
|
-
expect(
|
12
|
-
expect(
|
13
|
-
expect(
|
11
|
+
expect(vagrant).to receive(:set_ssh_config).with(host, 'vagrant').once
|
12
|
+
expect(vagrant).to receive(:copy_ssh_to_root).with(host, options).once
|
13
|
+
expect(vagrant).to receive(:set_ssh_config).with(host, host_prev_name).once
|
14
14
|
end
|
15
|
-
expect(
|
16
|
-
expect(
|
15
|
+
expect(vagrant).to receive(:hack_etc_hosts).with(hosts, options).once
|
16
|
+
expect(vagrant).to receive(:vagrant_cmd).with('up --provider vmware_fusion').once
|
17
17
|
vagrant.provision
|
18
18
|
end
|
19
19
|
|
20
20
|
context 'Correct vagrant configuration' do
|
21
21
|
subject do
|
22
22
|
FakeFS do
|
23
|
-
vagrant.make_vfile(
|
23
|
+
vagrant.make_vfile(hosts, options)
|
24
24
|
File.read(vagrant.instance_variable_get(:@vagrant_file))
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'has a provider section' do
|
29
|
-
is_expected.to include(
|
29
|
+
is_expected.to include(%( v.vm.provider :vmware_fusion do |v|\n v.vmx['memsize'] = '1024'\n end))
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -1,27 +1,28 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Beaker::VagrantLibvirt do
|
4
|
-
let(
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
let(
|
11
|
-
|
4
|
+
let(:options) do
|
5
|
+
make_opts.merge({ :hosts_file => 'sample.cfg',
|
6
|
+
'logger' => double.as_null_object,
|
7
|
+
'libvirt' => { 'uri' => 'qemu+ssh://root@host/system' },
|
8
|
+
'vagrant_cpus' => 2, })
|
9
|
+
end
|
10
|
+
let(:vagrant) { described_class.new(hosts, options) }
|
11
|
+
let(:hosts) do
|
12
|
+
make_hosts.each do |host|
|
12
13
|
host.delete('ip')
|
13
14
|
end
|
14
15
|
end
|
15
16
|
|
16
|
-
it
|
17
|
+
it 'uses the vagrant_libvirt provider for provisioning' do
|
17
18
|
hosts.each do |host|
|
18
19
|
host_prev_name = host['user']
|
19
|
-
expect(
|
20
|
-
expect(
|
21
|
-
expect(
|
20
|
+
expect(vagrant).to receive(:set_ssh_config).with(host, 'vagrant').once
|
21
|
+
expect(vagrant).to receive(:copy_ssh_to_root).with(host, options).once
|
22
|
+
expect(vagrant).to receive(:set_ssh_config).with(host, host_prev_name).once
|
22
23
|
end
|
23
|
-
expect(
|
24
|
-
expect(
|
24
|
+
expect(vagrant).to receive(:hack_etc_hosts).with(hosts, options).once
|
25
|
+
expect(vagrant).to receive(:vagrant_cmd).with('up --provider libvirt').once
|
25
26
|
FakeFS do
|
26
27
|
vagrant.provision
|
27
28
|
end
|
@@ -30,28 +31,28 @@ describe Beaker::VagrantLibvirt do
|
|
30
31
|
context 'Correct vagrant configuration' do
|
31
32
|
subject do
|
32
33
|
FakeFS do
|
33
|
-
vagrant.make_vfile(
|
34
|
+
vagrant.make_vfile(hosts, options)
|
34
35
|
File.read(vagrant.instance_variable_get(:@vagrant_file))
|
35
36
|
end
|
36
37
|
end
|
37
38
|
|
38
39
|
it 'has a provider section' do
|
39
|
-
is_expected.to include(
|
40
|
+
is_expected.to include(%( v.vm.provider :libvirt do |node|))
|
40
41
|
end
|
41
42
|
|
42
|
-
it
|
43
|
+
it 'has no private network' do
|
43
44
|
is_expected.to include('v.vm.network :private_network')
|
44
45
|
end
|
45
46
|
|
46
|
-
it
|
47
|
+
it 'can specify the memory as an integer' do
|
47
48
|
is_expected.to include('node.memory = 1024')
|
48
49
|
end
|
49
50
|
|
50
|
-
it
|
51
|
-
is_expected.to include(
|
51
|
+
it 'can specify the number of cpus' do
|
52
|
+
is_expected.to include('node.cpus = 2')
|
52
53
|
end
|
53
54
|
|
54
|
-
it
|
55
|
+
it 'can specify any libvirt option' do
|
55
56
|
is_expected.to include("node.uri = 'qemu+ssh://root@host/system'")
|
56
57
|
end
|
57
58
|
end
|
@@ -1,40 +1,40 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Beaker::VagrantParallels do
|
4
|
-
let(
|
5
|
-
let(
|
6
|
-
let(
|
4
|
+
let(:options) { make_opts.merge({ :hosts_file => 'sample.cfg', 'logger' => double.as_null_object }) }
|
5
|
+
let(:vagrant) { Beaker::VagrantParallels.new(hosts, options) }
|
6
|
+
let(:hosts) { make_hosts }
|
7
7
|
|
8
|
-
it
|
8
|
+
it 'uses the parallels provider for provisioning' do
|
9
9
|
hosts.each do |host|
|
10
10
|
host_prev_name = host['user']
|
11
|
-
expect(
|
12
|
-
expect(
|
13
|
-
expect(
|
11
|
+
expect(vagrant).to receive(:set_ssh_config).with(host, 'vagrant').once
|
12
|
+
expect(vagrant).to receive(:copy_ssh_to_root).with(host, options).once
|
13
|
+
expect(vagrant).to receive(:set_ssh_config).with(host, host_prev_name).once
|
14
14
|
end
|
15
|
-
expect(
|
16
|
-
expect(
|
15
|
+
expect(vagrant).to receive(:hack_etc_hosts).with(hosts, options).once
|
16
|
+
expect(vagrant).to receive(:vagrant_cmd).with('up --provider parallels').once
|
17
17
|
vagrant.provision
|
18
18
|
end
|
19
19
|
|
20
20
|
context 'Correct vagrant configuration' do
|
21
21
|
subject do
|
22
22
|
FakeFS do
|
23
|
-
vagrant.make_vfile(
|
23
|
+
vagrant.make_vfile(hosts, options)
|
24
24
|
File.read(vagrant.instance_variable_get(:@vagrant_file))
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
it
|
29
|
-
is_expected.to include(
|
28
|
+
it 'can make a Vagrantfile for a set of hosts' do
|
29
|
+
is_expected.to include(%( v.vm.provider :parallels do |prl|\n prl.optimize_power_consumption = false\n prl.memory = '1024'\n end))
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
33
|
context 'disabled guest tools' do
|
34
|
-
let(:options) { super().merge({ :
|
35
|
-
subject { vagrant.class.provider_vfile_section(
|
34
|
+
let(:options) { super().merge({ prl_update_guest_tools: 'disable' }) }
|
35
|
+
subject { vagrant.class.provider_vfile_section(hosts.first, options) }
|
36
36
|
|
37
|
-
it
|
37
|
+
it 'can disable the auto-update functionality of the Parallels Guest Tools' do
|
38
38
|
is_expected.to match(/prl.update_guest_tools = false/)
|
39
39
|
end
|
40
40
|
end
|