beaker-vagrant 0.6.6 → 0.6.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +8 -0
- data/.github/workflows/test.yml +32 -0
- data/.rspec +1 -0
- data/Rakefile +2 -2
- data/lib/beaker-vagrant/version.rb +1 -1
- data/lib/beaker/hypervisor/vagrant.rb +14 -5
- data/lib/beaker/hypervisor/vagrant_libvirt.rb +6 -0
- data/spec/beaker/hypervisor/vagrant_spec.rb +2 -2
- metadata +5 -4
- data/.travis.yml +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc3033b00b34521daab9d6221f02c1514cffaff1c64863dcb5643bf964e28f10
|
4
|
+
data.tar.gz: be554ffaf55e253e2ef2c61f86c3b9fec52f043f3ce496d1eb5c898e4c4c9da2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf38bd6c73c279461c5f9f8a9334a5bbbfb37658dfb0e8463b861fdfbd6c81e1c0132fd8a865a5c3ad08766a89f1ec1792bde7457d9a7d258e2891d5061537c3
|
7
|
+
data.tar.gz: 54d4ecc9660e53f1c49a1e786407ed1c5c20461fc3ff6756cfe1699d91468c0c9fa01b4e5717258d6f70454e825c8d5fda7ec65d3a3ec17bc49365364b57a122
|
@@ -0,0 +1,32 @@
|
|
1
|
+
name: Test
|
2
|
+
|
3
|
+
on:
|
4
|
+
- pull_request
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
test:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
strategy:
|
10
|
+
fail-fast: false
|
11
|
+
matrix:
|
12
|
+
ruby:
|
13
|
+
- "2.4"
|
14
|
+
- "2.5"
|
15
|
+
- "2.6"
|
16
|
+
- "2.7"
|
17
|
+
env:
|
18
|
+
BUNDLE_WITHOUT: release
|
19
|
+
name: Ruby ${{ matrix.ruby }}
|
20
|
+
steps:
|
21
|
+
- uses: actions/checkout@v2
|
22
|
+
- name: Install Ruby ${{ matrix.ruby }}
|
23
|
+
uses: ruby/setup-ruby@v1
|
24
|
+
with:
|
25
|
+
ruby-version: ${{ matrix.ruby }}
|
26
|
+
bundler-cache: true
|
27
|
+
- name: Run spec tests
|
28
|
+
run: bundle exec rake test:spec
|
29
|
+
# It seems some additonal setup of Docker may be needed for
|
30
|
+
# the acceptance tests to work.
|
31
|
+
# - name: Run acceptance tests
|
32
|
+
# run: bundle exec rake test:acceptance
|
data/.rspec
CHANGED
data/Rakefile
CHANGED
@@ -6,14 +6,14 @@ namespace :test do
|
|
6
6
|
|
7
7
|
desc "Run spec tests"
|
8
8
|
RSpec::Core::RakeTask.new(:run) do |t|
|
9
|
-
t.rspec_opts = ['--color']
|
9
|
+
t.rspec_opts = ['--color', '--format documentation']
|
10
10
|
t.pattern = 'spec/'
|
11
11
|
end
|
12
12
|
|
13
13
|
desc "Run spec tests with coverage"
|
14
14
|
RSpec::Core::RakeTask.new(:coverage) do |t|
|
15
15
|
ENV['BEAKER_TEMPLATE_COVERAGE'] = 'y'
|
16
|
-
t.rspec_opts = ['--color']
|
16
|
+
t.rspec_opts = ['--color', '--format documentation']
|
17
17
|
t.pattern = 'spec/'
|
18
18
|
end
|
19
19
|
|
@@ -16,8 +16,13 @@ module Beaker
|
|
16
16
|
(2 + rand(252)).to_s #don't want a 0, 1, or a 255
|
17
17
|
end
|
18
18
|
|
19
|
-
def randip
|
20
|
-
|
19
|
+
def randip(hypervisor=nil)
|
20
|
+
case hypervisor
|
21
|
+
when /libvirt/
|
22
|
+
"10.254.#{rand_chunk}.#{rand_chunk}"
|
23
|
+
else
|
24
|
+
"10.255.#{rand_chunk}.#{rand_chunk}"
|
25
|
+
end
|
21
26
|
end
|
22
27
|
|
23
28
|
def private_network_generator(host)
|
@@ -57,7 +62,7 @@ module Beaker
|
|
57
62
|
|
58
63
|
hosts.each do |host|
|
59
64
|
host.name.tr!('_','-') # Rewrite Hostname with hyphens instead of underscores to get legal hostname
|
60
|
-
host['ip'] ||= randip #use the existing ip, otherwise default to a random ip
|
65
|
+
host['ip'] ||= randip(host.host_hash[:hypervisor]) #use the existing ip, otherwise default to a random ip
|
61
66
|
v_file << " c.vm.define '#{host.name}' do |v|\n"
|
62
67
|
v_file << " v.vm.hostname = '#{host.name}'\n"
|
63
68
|
v_file << " v.vm.box = '#{host['box']}'\n"
|
@@ -136,6 +141,9 @@ module Beaker
|
|
136
141
|
@logger.debug "created Vagrantfile for VagrantHost #{host.name}"
|
137
142
|
end
|
138
143
|
v_file << "end\n"
|
144
|
+
|
145
|
+
# In case this is called directly
|
146
|
+
FileUtils.mkdir_p(@vagrant_path)
|
139
147
|
File.open(@vagrant_file, 'w') do |f|
|
140
148
|
f.write(v_file)
|
141
149
|
end
|
@@ -232,8 +240,7 @@ module Beaker
|
|
232
240
|
@logger = options[:logger]
|
233
241
|
@temp_files = []
|
234
242
|
@hosts = vagrant_hosts
|
235
|
-
@vagrant_path = File.expand_path(File.join(File.basename(__FILE__), '..', '.vagrant', 'beaker_vagrant_files', File.basename(options[:hosts_file])))
|
236
|
-
FileUtils.mkdir_p(@vagrant_path)
|
243
|
+
@vagrant_path = File.expand_path(File.join(File.basename(__FILE__), '..', '.vagrant', 'beaker_vagrant_files', 'beaker_' + File.basename(options[:hosts_file])))
|
237
244
|
@vagrant_file = File.expand_path(File.join(@vagrant_path, "Vagrantfile"))
|
238
245
|
@vagrant_env = { "RUBYLIB" => "", "RUBYOPT" => "" }
|
239
246
|
end
|
@@ -254,6 +261,8 @@ module Beaker
|
|
254
261
|
end
|
255
262
|
|
256
263
|
def provision(provider = nil)
|
264
|
+
FileUtils.mkdir_p(@vagrant_path)
|
265
|
+
|
257
266
|
#setting up new vagrant hosts
|
258
267
|
#make sure that any old boxes are dead dead dead
|
259
268
|
begin
|
@@ -16,6 +16,12 @@ class Beaker::VagrantLibvirt < Beaker::Vagrant
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def provision(provider = 'libvirt')
|
19
|
+
# This needs to be unique for every system with the same hostname but does
|
20
|
+
# not affect VirtualBox
|
21
|
+
vagrant_path_digest = Digest::SHA256.hexdigest(@vagrant_path)
|
22
|
+
@vagrant_path = @vagrant_path + '_' + vagrant_path_digest[0..2] + vagrant_path_digest[-3..-1]
|
23
|
+
@vagrant_file = File.expand_path(File.join(@vagrant_path, "Vagrantfile"))
|
24
|
+
|
19
25
|
super
|
20
26
|
end
|
21
27
|
|
@@ -29,11 +29,11 @@ module Beaker
|
|
29
29
|
})
|
30
30
|
end
|
31
31
|
|
32
|
-
it "stores the vagrant file in $WORKINGDIR/.vagrant/beaker_vagrant_files/
|
32
|
+
it "stores the vagrant file in $WORKINGDIR/.vagrant/beaker_vagrant_files/beaker_sample.cfg" do
|
33
33
|
allow( vagrant ).to receive( :randmac ).and_return( "0123456789" )
|
34
34
|
path = vagrant.instance_variable_get( :@vagrant_path )
|
35
35
|
|
36
|
-
expect( path ).to be === File.join(Dir.pwd, '.vagrant', 'beaker_vagrant_files', '
|
36
|
+
expect( path ).to be === File.join(Dir.pwd, '.vagrant', 'beaker_vagrant_files', 'beaker_sample.cfg')
|
37
37
|
|
38
38
|
end
|
39
39
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beaker-vagrant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rishi Javia, Kevin Imber, Tony Vu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -144,10 +144,11 @@ executables:
|
|
144
144
|
extensions: []
|
145
145
|
extra_rdoc_files: []
|
146
146
|
files:
|
147
|
+
- ".github/dependabot.yml"
|
148
|
+
- ".github/workflows/test.yml"
|
147
149
|
- ".gitignore"
|
148
150
|
- ".rspec"
|
149
151
|
- ".simplecov"
|
150
|
-
- ".travis.yml"
|
151
152
|
- Gemfile
|
152
153
|
- LICENSE
|
153
154
|
- README.md
|
@@ -196,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
197
|
- !ruby/object:Gem::Version
|
197
198
|
version: '0'
|
198
199
|
requirements: []
|
199
|
-
rubygems_version: 3.0.
|
200
|
+
rubygems_version: 3.0.8
|
200
201
|
signing_key:
|
201
202
|
specification_version: 4
|
202
203
|
summary: Beaker DSL Extension Helpers!
|