beaker-vagrant 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +25 -0
- data/.rspec +3 -0
- data/.simplecov +9 -0
- data/Gemfile +27 -0
- data/LICENSE +202 -0
- data/README.md +36 -0
- data/Rakefile +161 -0
- data/acceptance/config/nodes/redhat-nodes.yml +25 -0
- data/beaker-vagrant.gemspec +37 -0
- data/bin/beaker-vagrant +32 -0
- data/docs/vagrant.md +165 -0
- data/docs/vagrant_hosts_file_examples.md +60 -0
- data/docs/vagrant_libvirt.md +58 -0
- data/lib/beaker-vagrant/version.rb +3 -0
- data/lib/beaker/hypervisor/vagrant.rb +287 -0
- data/lib/beaker/hypervisor/vagrant_custom.rb +11 -0
- data/lib/beaker/hypervisor/vagrant_fusion.rb +17 -0
- data/lib/beaker/hypervisor/vagrant_libvirt.rb +41 -0
- data/lib/beaker/hypervisor/vagrant_parallels.rb +18 -0
- data/lib/beaker/hypervisor/vagrant_virtualbox.rb +76 -0
- data/lib/beaker/hypervisor/vagrant_workstation.rb +13 -0
- data/spec/beaker/hypervisor/vagrant_custom_spec.rb +46 -0
- data/spec/beaker/hypervisor/vagrant_fusion_spec.rb +32 -0
- data/spec/beaker/hypervisor/vagrant_libvirt_spec.rb +61 -0
- data/spec/beaker/hypervisor/vagrant_parallels_spec.rb +44 -0
- data/spec/beaker/hypervisor/vagrant_spec.rb +479 -0
- data/spec/beaker/hypervisor/vagrant_virtualbox_spec.rb +44 -0
- data/spec/beaker/hypervisor/vagrant_workstation_spec.rb +32 -0
- data/spec/spec_helper.rb +17 -0
- metadata +214 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Beaker::VagrantVirtualbox do
|
4
|
+
let( :options ) { make_opts.merge({ :hosts_file => 'sample.cfg', 'logger' => double().as_null_object }) }
|
5
|
+
let( :vagrant ) { Beaker::VagrantVirtualbox.new( @hosts, options ) }
|
6
|
+
|
7
|
+
before :each do
|
8
|
+
@hosts = make_hosts()
|
9
|
+
end
|
10
|
+
|
11
|
+
it "uses the virtualbox provider for provisioning" do
|
12
|
+
@hosts.each do |host|
|
13
|
+
host_prev_name = host['user']
|
14
|
+
expect( vagrant ).to receive( :set_ssh_config ).with( host, 'vagrant' ).once
|
15
|
+
expect( vagrant ).to receive( :copy_ssh_to_root ).with( host, options ).once
|
16
|
+
expect( vagrant ).to receive( :set_ssh_config ).with( host, host_prev_name ).once
|
17
|
+
end
|
18
|
+
expect( vagrant ).to receive( :hack_etc_hosts ).with( @hosts, options ).once
|
19
|
+
expect( vagrant ).to receive( :vagrant_cmd ).with( "up --provider virtualbox" ).once
|
20
|
+
vagrant.provision
|
21
|
+
end
|
22
|
+
|
23
|
+
it "can make a Vagranfile for a set of hosts" do
|
24
|
+
path = vagrant.instance_variable_get( :@vagrant_path )
|
25
|
+
allow( vagrant ).to receive( :randmac ).and_return( "0123456789" )
|
26
|
+
|
27
|
+
vagrant.make_vfile( @hosts )
|
28
|
+
|
29
|
+
vagrantfile = File.read( File.expand_path( File.join( path, 'Vagrantfile' )))
|
30
|
+
expect( vagrantfile ).to include( %Q{ v.vm.provider :virtualbox do |vb|\n vb.customize ['modifyvm', :id, '--memory', '1024', '--cpus', '1']\n end})
|
31
|
+
end
|
32
|
+
|
33
|
+
it "can disable the vb guest plugin" do
|
34
|
+
options.merge!({ :vbguest_plugin => 'disable' })
|
35
|
+
|
36
|
+
vfile_section = vagrant.class.provider_vfile_section( @hosts.first, options )
|
37
|
+
|
38
|
+
match = vfile_section.match(/vb.vbguest.auto_update = false/)
|
39
|
+
|
40
|
+
expect( match ).to_not be nil
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Beaker::VagrantWorkstation do
|
4
|
+
let( :options ) { make_opts.merge({ :hosts_file => 'sample.cfg', 'logger' => double().as_null_object }) }
|
5
|
+
let( :vagrant ) { Beaker::VagrantWorkstation.new( @hosts, options ) }
|
6
|
+
|
7
|
+
before :each do
|
8
|
+
@hosts = make_hosts()
|
9
|
+
end
|
10
|
+
|
11
|
+
it "uses the vmware_workstation provider for provisioning" do
|
12
|
+
@hosts.each do |host|
|
13
|
+
host_prev_name = host['user']
|
14
|
+
expect( vagrant ).to receive( :set_ssh_config ).with( host, 'vagrant' ).once
|
15
|
+
expect( vagrant ).to receive( :copy_ssh_to_root ).with( host, options ).once
|
16
|
+
expect( vagrant ).to receive( :set_ssh_config ).with( host, host_prev_name ).once
|
17
|
+
end
|
18
|
+
expect( vagrant ).to receive( :hack_etc_hosts ).with( @hosts, options ).once
|
19
|
+
expect( vagrant ).to receive( :vagrant_cmd ).with( "up --provider vmware_workstation" ).once
|
20
|
+
vagrant.provision
|
21
|
+
end
|
22
|
+
|
23
|
+
it "can make a Vagranfile for a set of hosts" do
|
24
|
+
path = vagrant.instance_variable_get( :@vagrant_path )
|
25
|
+
allow( vagrant ).to receive( :randmac ).and_return( "0123456789" )
|
26
|
+
|
27
|
+
vagrant.make_vfile( @hosts )
|
28
|
+
|
29
|
+
vagrantfile = File.read( File.expand_path( File.join( path, "Vagrantfile")))
|
30
|
+
expect( vagrantfile ).to include( %Q{ v.vm.provider :vmware_workstation do |v|\n v.vmx['memsize'] = '1024'\n end})
|
31
|
+
end
|
32
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
require 'rspec/its'
|
3
|
+
require 'beaker'
|
4
|
+
|
5
|
+
Dir.glob(Dir.pwd + '/lib/beaker/hypervisor/*.rb') {|file| require file}
|
6
|
+
|
7
|
+
# setup & require beaker's spec_helper.rb
|
8
|
+
beaker_gem_spec = Gem::Specification.find_by_name('beaker')
|
9
|
+
beaker_gem_dir = beaker_gem_spec.gem_dir
|
10
|
+
beaker_spec_path = File.join(beaker_gem_dir, 'spec')
|
11
|
+
$LOAD_PATH << beaker_spec_path
|
12
|
+
require File.join(beaker_spec_path, 'spec_helper.rb')
|
13
|
+
|
14
|
+
RSpec.configure do |config|
|
15
|
+
config.include TestFileHelpers
|
16
|
+
config.include HostHelpers
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,214 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: beaker-vagrant
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Rishi Javia, Kevin Imber, Tony Vu
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-07-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec-its
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: fakefs
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.6'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.6'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.1'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.1'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.10'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.10'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: yard
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: markdown
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: thin
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ! '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ! '>='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: stringify-hash
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ~>
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 0.0.0
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ~>
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 0.0.0
|
153
|
+
description: For use for the Beaker acceptance testing tool
|
154
|
+
email:
|
155
|
+
- rishi.javia@puppet.com, kevin.imber@puppet.com, tony.vu@puppet.com
|
156
|
+
executables:
|
157
|
+
- beaker-vagrant
|
158
|
+
extensions: []
|
159
|
+
extra_rdoc_files: []
|
160
|
+
files:
|
161
|
+
- .gitignore
|
162
|
+
- .rspec
|
163
|
+
- .simplecov
|
164
|
+
- Gemfile
|
165
|
+
- LICENSE
|
166
|
+
- README.md
|
167
|
+
- Rakefile
|
168
|
+
- acceptance/config/nodes/redhat-nodes.yml
|
169
|
+
- beaker-vagrant.gemspec
|
170
|
+
- bin/beaker-vagrant
|
171
|
+
- docs/vagrant.md
|
172
|
+
- docs/vagrant_hosts_file_examples.md
|
173
|
+
- docs/vagrant_libvirt.md
|
174
|
+
- lib/beaker-vagrant/version.rb
|
175
|
+
- lib/beaker/hypervisor/vagrant.rb
|
176
|
+
- lib/beaker/hypervisor/vagrant_custom.rb
|
177
|
+
- lib/beaker/hypervisor/vagrant_fusion.rb
|
178
|
+
- lib/beaker/hypervisor/vagrant_libvirt.rb
|
179
|
+
- lib/beaker/hypervisor/vagrant_parallels.rb
|
180
|
+
- lib/beaker/hypervisor/vagrant_virtualbox.rb
|
181
|
+
- lib/beaker/hypervisor/vagrant_workstation.rb
|
182
|
+
- spec/beaker/hypervisor/vagrant_custom_spec.rb
|
183
|
+
- spec/beaker/hypervisor/vagrant_fusion_spec.rb
|
184
|
+
- spec/beaker/hypervisor/vagrant_libvirt_spec.rb
|
185
|
+
- spec/beaker/hypervisor/vagrant_parallels_spec.rb
|
186
|
+
- spec/beaker/hypervisor/vagrant_spec.rb
|
187
|
+
- spec/beaker/hypervisor/vagrant_virtualbox_spec.rb
|
188
|
+
- spec/beaker/hypervisor/vagrant_workstation_spec.rb
|
189
|
+
- spec/spec_helper.rb
|
190
|
+
homepage: https://github.com/puppetlabs/beaker-vagrant
|
191
|
+
licenses:
|
192
|
+
- Apache2
|
193
|
+
metadata: {}
|
194
|
+
post_install_message:
|
195
|
+
rdoc_options: []
|
196
|
+
require_paths:
|
197
|
+
- lib
|
198
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
199
|
+
requirements:
|
200
|
+
- - ! '>='
|
201
|
+
- !ruby/object:Gem::Version
|
202
|
+
version: '0'
|
203
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
204
|
+
requirements:
|
205
|
+
- - ! '>='
|
206
|
+
- !ruby/object:Gem::Version
|
207
|
+
version: '0'
|
208
|
+
requirements: []
|
209
|
+
rubyforge_project:
|
210
|
+
rubygems_version: 2.4.6
|
211
|
+
signing_key:
|
212
|
+
specification_version: 4
|
213
|
+
summary: Beaker DSL Extension Helpers!
|
214
|
+
test_files: []
|