beaker-vagrant 0.7.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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,79 +1,96 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker-vagrant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 1.0.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-18 00:00:00.000000000 Z
14
+ date: 2023-03-27 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
- - - ">="
61
+ - - "~>"
56
62
  - !ruby/object:Gem::Version
57
- version: '0.6'
58
- - - "<"
63
+ version: '13.0'
64
+ - !ruby/object:Gem::Dependency
65
+ name: rspec
66
+ requirement: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - "~>"
69
+ - !ruby/object:Gem::Version
70
+ version: '3.0'
71
+ type: :development
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - "~>"
59
76
  - !ruby/object:Gem::Version
60
- version: '2.0'
77
+ version: '3.0'
61
78
  - !ruby/object:Gem::Dependency
62
- name: rake
79
+ name: rubocop
63
80
  requirement: !ruby/object:Gem::Requirement
64
81
  requirements:
65
82
  - - "~>"
66
83
  - !ruby/object:Gem::Version
67
- version: '13.0'
84
+ version: 1.48.1
68
85
  type: :development
69
86
  prerelease: false
70
87
  version_requirements: !ruby/object:Gem::Requirement
71
88
  requirements:
72
89
  - - "~>"
73
90
  - !ruby/object:Gem::Version
74
- version: '13.0'
91
+ version: 1.48.1
75
92
  - !ruby/object:Gem::Dependency
76
- name: simplecov
93
+ name: rubocop-performance
77
94
  requirement: !ruby/object:Gem::Requirement
78
95
  requirements:
79
96
  - - ">="
@@ -87,21 +104,21 @@ dependencies:
87
104
  - !ruby/object:Gem::Version
88
105
  version: '0'
89
106
  - !ruby/object:Gem::Dependency
90
- name: pry
107
+ name: rubocop-rake
91
108
  requirement: !ruby/object:Gem::Requirement
92
109
  requirements:
93
- - - "~>"
110
+ - - ">="
94
111
  - !ruby/object:Gem::Version
95
- version: '0.10'
112
+ version: '0'
96
113
  type: :development
97
114
  prerelease: false
98
115
  version_requirements: !ruby/object:Gem::Requirement
99
116
  requirements:
100
- - - "~>"
117
+ - - ">="
101
118
  - !ruby/object:Gem::Version
102
- version: '0.10'
119
+ version: '0'
103
120
  - !ruby/object:Gem::Dependency
104
- name: yard
121
+ name: rubocop-rspec
105
122
  requirement: !ruby/object:Gem::Requirement
106
123
  requirements:
107
124
  - - ">="
@@ -115,7 +132,7 @@ dependencies:
115
132
  - !ruby/object:Gem::Version
116
133
  version: '0'
117
134
  - !ruby/object:Gem::Dependency
118
- name: thin
135
+ name: simplecov
119
136
  requirement: !ruby/object:Gem::Requirement
120
137
  requirements:
121
138
  - - ">="
@@ -128,9 +145,22 @@ dependencies:
128
145
  - - ">="
129
146
  - !ruby/object:Gem::Version
130
147
  version: '0'
148
+ - !ruby/object:Gem::Dependency
149
+ name: beaker
150
+ requirement: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - "~>"
153
+ - !ruby/object:Gem::Version
154
+ version: '5'
155
+ type: :runtime
156
+ prerelease: false
157
+ version_requirements: !ruby/object:Gem::Requirement
158
+ requirements:
159
+ - - "~>"
160
+ - !ruby/object:Gem::Version
161
+ version: '5'
131
162
  description: For use for the Beaker acceptance testing tool
132
- email:
133
- - rishi.javia@puppet.com, kevin.imber@puppet.com, tony.vu@puppet.com
163
+ email: voxpupuli@groups.io
134
164
  executables:
135
165
  - beaker-vagrant
136
166
  extensions: []
@@ -141,7 +171,10 @@ files:
141
171
  - ".github/workflows/test.yml"
142
172
  - ".gitignore"
143
173
  - ".rspec"
174
+ - ".rubocop.yml"
175
+ - ".rubocop_todo.yml"
144
176
  - ".simplecov"
177
+ - CHANGELOG.md
145
178
  - Gemfile
146
179
  - LICENSE
147
180
  - README.md
@@ -183,14 +216,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
183
216
  requirements:
184
217
  - - ">="
185
218
  - !ruby/object:Gem::Version
186
- version: '0'
219
+ version: '2.7'
187
220
  required_rubygems_version: !ruby/object:Gem::Requirement
188
221
  requirements:
189
222
  - - ">="
190
223
  - !ruby/object:Gem::Version
191
224
  version: '0'
192
225
  requirements: []
193
- rubygems_version: 3.1.6
226
+ rubygems_version: 3.2.33
194
227
  signing_key:
195
228
  specification_version: 4
196
229
  summary: Beaker DSL Extension Helpers!