beaker-vagrant 0.7.1 → 1.1.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.
@@ -1,20 +1,20 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Beaker::VagrantVirtualbox do
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(:vagrantfile_path) { vagrant.instance_variable_get( :@vagrant_file ) }
7
- let(:hosts) { make_hosts() }
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(:vagrantfile_path) { vagrant.instance_variable_get(:@vagrant_file) }
7
+ let(:hosts) { make_hosts }
8
8
 
9
- it "uses the virtualbox provider for provisioning" do
9
+ it 'uses the virtualbox provider for provisioning' do
10
10
  hosts.each do |host|
11
11
  host_prev_name = host['user']
12
- expect( vagrant ).to receive( :set_ssh_config ).with( host, 'vagrant' ).once
13
- expect( vagrant ).to receive( :copy_ssh_to_root ).with( host, options ).once
14
- expect( vagrant ).to receive( :set_ssh_config ).with( host, host_prev_name ).once
12
+ expect(vagrant).to receive(:set_ssh_config).with(host, 'vagrant').once
13
+ expect(vagrant).to receive(:copy_ssh_to_root).with(host, options).once
14
+ expect(vagrant).to receive(:set_ssh_config).with(host, host_prev_name).once
15
15
  end
16
- expect( vagrant ).to receive( :hack_etc_hosts ).with( hosts, options ).once
17
- expect( vagrant ).to receive( :vagrant_cmd ).with( "up --provider virtualbox" ).once
16
+ expect(vagrant).to receive(:hack_etc_hosts).with(hosts, options).once
17
+ expect(vagrant).to receive(:vagrant_cmd).with('up --provider virtualbox').once
18
18
  vagrant.provision
19
19
  end
20
20
 
@@ -26,52 +26,73 @@ describe Beaker::VagrantVirtualbox do
26
26
  end
27
27
  end
28
28
 
29
- it "can make a Vagrantfile for a set of hosts" do
30
- is_expected.to include( %Q{ v.vm.provider :virtualbox do |vb|\n vb.customize ['modifyvm', :id, '--memory', '1024', '--cpus', '1', '--audio', 'none']\n end})
29
+ it 'can make a Vagrantfile for a set of hosts' do
30
+ is_expected.to include(%( v.vm.provider :virtualbox do |vb|\n vb.customize ['modifyvm', :id, '--memory', '1024', '--cpus', '1', '--audio', 'none']\n end))
31
31
  end
32
32
 
33
33
  context 'with ioapic(multiple cores)' do
34
- let(:hosts) { make_hosts({:ioapic => 'true'}, 1) }
34
+ let(:hosts) { make_hosts({ ioapic: 'true' }, 1) }
35
35
 
36
- it { is_expected.to include( " vb.customize ['modifyvm', :id, '--ioapic', 'on']") }
36
+ it { is_expected.to include(" vb.customize ['modifyvm', :id, '--ioapic', 'on']") }
37
37
  end
38
38
 
39
39
  context 'with NAT DNS' do
40
- let(:hosts) { make_hosts({:natdns => 'on'}, 1) }
40
+ let(:hosts) { make_hosts({ natdns: 'on' }, 1) }
41
41
 
42
- it { is_expected.to include( " vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']") }
43
- it { is_expected.to include( " vb.customize ['modifyvm', :id, '--natdnsproxy1', 'on']") }
42
+ it { is_expected.to include(" vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']") }
43
+ it { is_expected.to include(" vb.customize ['modifyvm', :id, '--natdnsproxy1', 'on']") }
44
44
  end
45
45
 
46
46
  context 'storage with the USB controller' do
47
- let(:hosts) { make_hosts({:volumes => { 'test_disk' => { size: '5120' }}, :volume_storage_controller => 'USB' }) }
47
+ let(:hosts) { make_hosts({ volumes: { 'test_disk' => { size: '5120' } }, volume_storage_controller: 'USB' }) }
48
48
 
49
49
  it { is_expected.to include(" vb.customize ['modifyvm', :id, '--usb', 'on']") }
50
- it { is_expected.to include(" vb.customize ['storagectl', :id, '--name', 'Beaker USB Controller', '--add', 'usb', '--portcount', '8', '--controller', 'USB', '--bootable', 'off']") }
50
+
51
+ it {
52
+ is_expected.to include(" vb.customize ['storagectl', :id, '--name', 'Beaker USB Controller', '--add', 'usb', '--portcount', '8', '--controller', 'USB', '--bootable', 'off']")
53
+ }
54
+
51
55
  it { is_expected.to include(" vb.customize ['createhd', '--filename', 'vm1-test_disk.vdi', '--size', '5120']") }
52
- it { is_expected.to include(" vb.customize ['storageattach', :id, '--storagectl', 'Beaker USB Controller', '--port', '0', '--device', '0', '--type', 'hdd', '--medium', 'vm1-test_disk.vdi']") }
56
+
57
+ it {
58
+ is_expected.to include(" vb.customize ['storageattach', :id, '--storagectl', 'Beaker USB Controller', '--port', '0', '--device', '0', '--type', 'hdd', '--medium', 'vm1-test_disk.vdi']")
59
+ }
53
60
  end
54
61
 
55
62
  context 'storage with the LSILogic controller' do
56
- let(:hosts) { make_hosts({:volumes => { 'test_disk' => { size: '5120' }}, :volume_storage_controller => 'LSILogic' }) }
63
+ let(:hosts) do
64
+ make_hosts({ volumes: { 'test_disk' => { size: '5120' } }, volume_storage_controller: 'LSILogic' })
65
+ end
66
+
67
+ it {
68
+ is_expected.to include(" vb.customize ['storagectl', :id, '--name', 'Beaker LSILogic Controller', '--add', 'scsi', '--portcount', '16', '--controller', 'LSILogic', '--bootable', 'off']")
69
+ }
57
70
 
58
- it { is_expected.to include(" vb.customize ['storagectl', :id, '--name', 'Beaker LSILogic Controller', '--add', 'scsi', '--portcount', '16', '--controller', 'LSILogic', '--bootable', 'off']") }
59
71
  it { is_expected.to include(" vb.customize ['createhd', '--filename', 'vm1-test_disk.vdi', '--size', '5120']") }
60
- it { is_expected.to include(" vb.customize ['storageattach', :id, '--storagectl', 'Beaker LSILogic Controller', '--port', '0', '--device', '0', '--type', 'hdd', '--medium', 'vm1-test_disk.vdi']") }
72
+
73
+ it {
74
+ is_expected.to include(" vb.customize ['storageattach', :id, '--storagectl', 'Beaker LSILogic Controller', '--port', '0', '--device', '0', '--type', 'hdd', '--medium', 'vm1-test_disk.vdi']")
75
+ }
61
76
  end
62
77
 
63
- context "storage with the default controller" do
64
- let(:hosts) { make_hosts({:volumes => { 'test_disk' => { size: '5120' }}}) }
78
+ context 'storage with the default controller' do
79
+ let(:hosts) { make_hosts({ volumes: { 'test_disk' => { size: '5120' } } }) }
80
+
81
+ it {
82
+ is_expected.to include(" vb.customize ['storagectl', :id, '--name', 'Beaker IntelAHCI Controller', '--add', 'sata', '--portcount', '2', '--controller', 'IntelAHCI', '--bootable', 'off']")
83
+ }
65
84
 
66
- it { is_expected.to include(" vb.customize ['storagectl', :id, '--name', 'Beaker IntelAHCI Controller', '--add', 'sata', '--portcount', '2', '--controller', 'IntelAHCI', '--bootable', 'off']") }
67
85
  it { is_expected.to include(" vb.customize ['createhd', '--filename', 'vm1-test_disk.vdi', '--size', '5120']") }
68
- it { is_expected.to include(" vb.customize ['storageattach', :id, '--storagectl', 'Beaker IntelAHCI Controller', '--port', '0', '--device', '0', '--type', 'hdd', '--medium', 'vm1-test_disk.vdi']") }
86
+
87
+ it {
88
+ is_expected.to include(" vb.customize ['storageattach', :id, '--storagectl', 'Beaker IntelAHCI Controller', '--port', '0', '--device', '0', '--type', 'hdd', '--medium', 'vm1-test_disk.vdi']")
89
+ }
69
90
  end
70
91
  end
71
92
 
72
93
  context 'disabled vb guest plugin' do
73
- let(:options) { super().merge({ :vbguest_plugin => 'disable' }) }
74
- subject { vagrant.class.provider_vfile_section( hosts.first, options ) }
94
+ let(:options) { super().merge({ vbguest_plugin: 'disable' }) }
95
+ subject { vagrant.class.provider_vfile_section(hosts.first, options) }
75
96
 
76
97
  it { is_expected.to match(/vb\.vbguest\.auto_update = false/) }
77
98
  end
@@ -1,19 +1,19 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Beaker::VagrantWorkstation do
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() }
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 "uses the vmware_workstation provider for provisioning" do
8
+ it 'uses the vmware_workstation provider for provisioning' do
9
9
  hosts.each do |host|
10
10
  host_prev_name = host['user']
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
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( vagrant ).to receive( :hack_etc_hosts ).with( hosts, options ).once
16
- expect( vagrant ).to receive( :vagrant_cmd ).with( "up --provider vmware_workstation" ).once
15
+ expect(vagrant).to receive(:hack_etc_hosts).with(hosts, options).once
16
+ expect(vagrant).to receive(:vagrant_cmd).with('up --provider vmware_workstation').once
17
17
  FakeFS do
18
18
  vagrant.provision
19
19
  end
@@ -27,32 +27,32 @@ describe Beaker::VagrantWorkstation do
27
27
  end
28
28
  end
29
29
 
30
- it "for a set of hosts" do
31
- is_expected.to include( %Q{ v.vm.provider :vmware_workstation do |v|\n v.vmx['memsize'] = '1024'\n end})
30
+ it 'for a set of hosts' do
31
+ is_expected.to include(%( v.vm.provider :vmware_workstation do |v|\n v.vmx['memsize'] = '1024'\n end))
32
32
  end
33
33
 
34
34
  context 'with whitelist_verified' do
35
- let(:hosts) { make_hosts({:whitelist_verified => true}, 1) }
35
+ let(:hosts) { make_hosts({ whitelist_verified: true }, 1) }
36
36
 
37
- it { is_expected.to include( %Q{ v.vmx['whitelist_verified'] = 'true'}) }
37
+ it { is_expected.to include(%( v.vmx['whitelist_verified'] = 'true')) }
38
38
  end
39
39
 
40
40
  context 'with functional_hgfs' do
41
- let(:hosts) { make_hosts({:functional_hgfs => true}, 1) }
41
+ let(:hosts) { make_hosts({ functional_hgfs: true }, 1) }
42
42
 
43
- it { is_expected.to include( %Q{ v.vmx['functional_hgfs'] = 'true'}) }
43
+ it { is_expected.to include(%( v.vmx['functional_hgfs'] = 'true')) }
44
44
  end
45
45
 
46
46
  context 'with unmount_default_hgfs' do
47
- let(:hosts) { make_hosts({:unmount_default_hgfs => true}, 1) }
47
+ let(:hosts) { make_hosts({ unmount_default_hgfs: true }, 1) }
48
48
 
49
- it { is_expected.to include( %Q{ v.vmx['unmount_default_hgfs'] = 'true'}) }
49
+ it { is_expected.to include(%( v.vmx['unmount_default_hgfs'] = 'true')) }
50
50
  end
51
51
 
52
- context "with gui" do
53
- let(:hosts) { make_hosts({:gui => true},1) }
52
+ context 'with gui' do
53
+ let(:hosts) { make_hosts({ gui: true }, 1) }
54
54
 
55
- it { is_expected.to include( %Q{ v.vmx['gui'] = true}) }
55
+ it { is_expected.to include(%( v.vmx['gui'] = true)) }
56
56
  end
57
57
  end
58
58
  end
data/spec/spec_helper.rb CHANGED
@@ -1,8 +1,7 @@
1
1
  require 'simplecov'
2
- require 'rspec/its'
3
2
  require 'beaker'
4
3
 
5
- Dir.glob(Dir.pwd + '/lib/beaker/hypervisor/*.rb') {|file| require file}
4
+ Dir.glob(Dir.pwd + '/lib/beaker/hypervisor/*.rb') { |file| require file }
6
5
 
7
6
  # setup & require beaker's spec_helper.rb
8
7
  beaker_gem_spec = Gem::Specification.find_by_name('beaker')
metadata CHANGED
@@ -1,77 +1,80 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker-vagrant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
- - Rishi Javia, Kevin Imber, Tony Vu
7
+ - Vox Pupuli
8
+ - Rishi Javia
9
+ - Kevin Imber
10
+ - Tony Vu
8
11
  autorequire:
9
12
  bindir: bin
10
13
  cert_chain: []
11
- date: 2021-05-26 00:00:00.000000000 Z
14
+ date: 2023-04-28 00:00:00.000000000 Z
12
15
  dependencies:
13
16
  - !ruby/object:Gem::Dependency
14
- name: rspec
17
+ name: fakefs
15
18
  requirement: !ruby/object:Gem::Requirement
16
19
  requirements:
17
- - - "~>"
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: '0.6'
23
+ - - "<"
18
24
  - !ruby/object:Gem::Version
19
25
  version: '3.0'
20
26
  type: :development
21
27
  prerelease: false
22
28
  version_requirements: !ruby/object:Gem::Requirement
23
29
  requirements:
24
- - - "~>"
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0.6'
33
+ - - "<"
25
34
  - !ruby/object:Gem::Version
26
35
  version: '3.0'
27
36
  - !ruby/object:Gem::Dependency
28
- name: rspec-its
37
+ name: pry
29
38
  requirement: !ruby/object:Gem::Requirement
30
39
  requirements:
31
- - - ">="
40
+ - - "~>"
32
41
  - !ruby/object:Gem::Version
33
- version: '0'
42
+ version: '0.10'
34
43
  type: :development
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
38
- - - ">="
47
+ - - "~>"
39
48
  - !ruby/object:Gem::Version
40
- version: '0'
49
+ version: '0.10'
41
50
  - !ruby/object:Gem::Dependency
42
- name: fakefs
51
+ name: rake
43
52
  requirement: !ruby/object:Gem::Requirement
44
53
  requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0.6'
48
- - - "<"
54
+ - - "~>"
49
55
  - !ruby/object:Gem::Version
50
- version: '2.0'
56
+ version: '13.0'
51
57
  type: :development
52
58
  prerelease: false
53
59
  version_requirements: !ruby/object:Gem::Requirement
54
60
  requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- version: '0.6'
58
- - - "<"
61
+ - - "~>"
59
62
  - !ruby/object:Gem::Version
60
- version: '2.0'
63
+ version: '13.0'
61
64
  - !ruby/object:Gem::Dependency
62
- name: rake
65
+ name: rspec
63
66
  requirement: !ruby/object:Gem::Requirement
64
67
  requirements:
65
68
  - - "~>"
66
69
  - !ruby/object:Gem::Version
67
- version: '13.0'
70
+ version: '3.0'
68
71
  type: :development
69
72
  prerelease: false
70
73
  version_requirements: !ruby/object:Gem::Requirement
71
74
  requirements:
72
75
  - - "~>"
73
76
  - !ruby/object:Gem::Version
74
- version: '13.0'
77
+ version: '3.0'
75
78
  - !ruby/object:Gem::Dependency
76
79
  name: simplecov
77
80
  requirement: !ruby/object:Gem::Requirement
@@ -87,50 +90,35 @@ dependencies:
87
90
  - !ruby/object:Gem::Version
88
91
  version: '0'
89
92
  - !ruby/object:Gem::Dependency
90
- name: pry
93
+ name: voxpupuli-rubocop
91
94
  requirement: !ruby/object:Gem::Requirement
92
95
  requirements:
93
96
  - - "~>"
94
97
  - !ruby/object:Gem::Version
95
- version: '0.10'
98
+ version: '1.1'
96
99
  type: :development
97
100
  prerelease: false
98
101
  version_requirements: !ruby/object:Gem::Requirement
99
102
  requirements:
100
103
  - - "~>"
101
104
  - !ruby/object:Gem::Version
102
- version: '0.10'
103
- - !ruby/object:Gem::Dependency
104
- name: yard
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- version: '0'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- version: '0'
105
+ version: '1.1'
117
106
  - !ruby/object:Gem::Dependency
118
- name: thin
107
+ name: beaker
119
108
  requirement: !ruby/object:Gem::Requirement
120
109
  requirements:
121
- - - ">="
110
+ - - "~>"
122
111
  - !ruby/object:Gem::Version
123
- version: '0'
124
- type: :development
112
+ version: '5'
113
+ type: :runtime
125
114
  prerelease: false
126
115
  version_requirements: !ruby/object:Gem::Requirement
127
116
  requirements:
128
- - - ">="
117
+ - - "~>"
129
118
  - !ruby/object:Gem::Version
130
- version: '0'
119
+ version: '5'
131
120
  description: For use for the Beaker acceptance testing tool
132
- email:
133
- - rishi.javia@puppet.com, kevin.imber@puppet.com, tony.vu@puppet.com
121
+ email: voxpupuli@groups.io
134
122
  executables:
135
123
  - beaker-vagrant
136
124
  extensions: []
@@ -141,6 +129,8 @@ files:
141
129
  - ".github/workflows/test.yml"
142
130
  - ".gitignore"
143
131
  - ".rspec"
132
+ - ".rubocop.yml"
133
+ - ".rubocop_todo.yml"
144
134
  - ".simplecov"
145
135
  - CHANGELOG.md
146
136
  - Gemfile
@@ -184,14 +174,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
184
174
  requirements:
185
175
  - - ">="
186
176
  - !ruby/object:Gem::Version
187
- version: '0'
177
+ version: '2.7'
188
178
  required_rubygems_version: !ruby/object:Gem::Requirement
189
179
  requirements:
190
180
  - - ">="
191
181
  - !ruby/object:Gem::Version
192
182
  version: '0'
193
183
  requirements: []
194
- rubygems_version: 3.1.6
184
+ rubygems_version: 3.2.33
195
185
  signing_key:
196
186
  specification_version: 4
197
187
  summary: Beaker DSL Extension Helpers!