beaker-puppet 1.20.0 → 1.22.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +32 -0
- data/.github/workflows/test.yml +36 -0
- data/CHANGELOG.md +650 -0
- data/Gemfile +7 -5
- data/README.md +34 -38
- data/Rakefile +13 -0
- data/beaker-puppet.gemspec +4 -7
- data/lib/beaker-puppet/helpers/puppet_helpers.rb +1 -1
- data/lib/beaker-puppet/install_utils/foss_utils.rb +21 -13
- data/lib/beaker-puppet/install_utils/puppet_utils.rb +1 -3
- data/lib/beaker-puppet/version.rb +1 -1
- data/lib/beaker-puppet.rb +0 -1
- data/setup/git/000_EnvSetup.rb +1 -1
- data/spec/beaker-puppet/helpers/puppet_helpers_spec.rb +15 -20
- data/spec/beaker-puppet/install_utils/foss_utils_spec.rb +7 -22
- data/spec/beaker-puppet/install_utils/puppet_utils_spec.rb +14 -0
- data/spec/spec_helper.rb +25 -2
- metadata +13 -54
- data/.travis.yml +0 -10
- data/HISTORY.md +0 -42
data/Gemfile
CHANGED
@@ -2,8 +2,6 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org"
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
|
6
|
-
|
7
5
|
def location_for(place, fake_version = nil)
|
8
6
|
if place =~ /^(git:[^#]*)#(.*)/
|
9
7
|
[fake_version, { :git => $1, :branch => $2, :require => false }].compact
|
@@ -16,11 +14,15 @@ end
|
|
16
14
|
|
17
15
|
|
18
16
|
group :test do
|
19
|
-
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || ['>= 4.
|
17
|
+
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || ['>= 4.30.0', '< 5.0.0'])
|
20
18
|
gem "beaker-abs", *location_for(ENV['ABS_VERSION'] || '~> 0.4.0')
|
21
19
|
end
|
22
20
|
|
21
|
+
group :release do
|
22
|
+
gem 'github_changelog_generator', require: false
|
23
|
+
end
|
23
24
|
|
24
|
-
|
25
|
-
|
25
|
+
group :coverage, optional: ENV['COVERAGE']!='yes' do
|
26
|
+
gem 'simplecov-console', :require => false
|
27
|
+
gem 'codecov', :require => false
|
26
28
|
end
|
data/README.md
CHANGED
@@ -1,51 +1,39 @@
|
|
1
1
|
# beaker-puppet: The Puppet-Specific Beaker Library
|
2
2
|
|
3
|
+
[![License](https://img.shields.io/github/license/voxpupuli/beaker-puppet.svg)](https://github.com/voxpupuli/beaker-puppet/blob/master/LICENSE)
|
4
|
+
[![Test](https://github.com/voxpupuli/beaker-puppet/actions/workflows/test.yml/badge.svg)](https://github.com/voxpupuli/beaker-puppet/actions/workflows/test.yml)
|
5
|
+
[![codecov](https://codecov.io/gh/voxpupuli/beaker-puppet/branch/master/graph/badge.svg?token=Mypkl78hvK)](https://codecov.io/gh/voxpupuli/beaker-puppet)
|
6
|
+
[![Release](https://github.com/voxpupuli/beaker-puppet/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/beaker-puppet/actions/workflows/release.yml)
|
7
|
+
[![RubyGem Version](https://img.shields.io/gem/v/beaker-puppet.svg)](https://rubygems.org/gems/beaker-puppet)
|
8
|
+
[![RubyGem Downloads](https://img.shields.io/gem/dt/beaker-puppet.svg)](https://rubygems.org/gems/beaker-puppet)
|
9
|
+
[![Donated by Puppet Inc](https://img.shields.io/badge/donated%20by-Puppet%20Inc-fb7047.svg)](#transfer-notice)
|
10
|
+
|
3
11
|
The purpose of this library is to hold all puppet-specific info & DSL methods.
|
4
12
|
This includes all helper & installer methods.
|
5
13
|
|
6
14
|
It might not be up to that state yet, but that's the goal for this library. If
|
7
15
|
you see anything puppet-specific that you'd like to pull into this library out
|
8
|
-
of beaker, please do, we would love any help that you'd like to provide.
|
16
|
+
of beaker, please do, we would love any help that you'd like to provide.
|
9
17
|
|
10
18
|
# How Do I Use This?
|
11
19
|
|
12
|
-
|
13
|
-
|
14
|
-
This library is included as a dependency of Beaker 3.x versions and is automatically included, so there's nothing to do.
|
15
|
-
|
16
|
-
## With Beaker 4.x
|
17
|
-
|
18
|
-
As of Version 1.0 of `beaker-puppet`, the minimum supported version of beaker is Version 4.0. If you use `ENV['BEAKER_VERSION']`, you will have to ensure that this is compatible, and that if you are using a local Git repository it is up to date.
|
20
|
+
You will need to include beaker-puppet alongside Beaker in your Gemfile or project.gemspec. E.g.
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
~~~ruby
|
22
|
+
```ruby
|
23
23
|
# Gemfile
|
24
24
|
gem 'beaker', '~>4.0'
|
25
25
|
gem 'beaker-puppet', '~>1.0'
|
26
26
|
# project.gemspec
|
27
27
|
s.add_runtime_dependency 'beaker', '~>4.0'
|
28
28
|
s.add_runtime_dependency 'beaker-puppet', '~>1.0'
|
29
|
-
|
30
|
-
|
31
|
-
For DSL Extension Libraries, you must also ensure that you `require` the library in your test files. You can do this manually in individual test files or in a test helper (if you have one). You can [use `Bundler.require()`](https://bundler.io/v1.16/guides/groups.html) to require the library automatically.
|
32
|
-
|
33
|
-
### Right Now? (beaker 3.x)
|
34
|
-
|
35
|
-
At this point, beaker-puppet is included in beaker, so you don't have to _do_
|
36
|
-
anything to get the methods in this library.
|
37
|
-
|
38
|
-
You can use these methods in a test by referencing them by name without
|
39
|
-
qualifications, as they're included in the beaker DSL by default.
|
40
|
-
|
41
|
-
### In beaker's Next Major Version? (beaker 4.x)
|
29
|
+
```
|
42
30
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
31
|
+
For DSL Extension Libraries, you must also ensure that you `require` the
|
32
|
+
library in your test files. You can do this manually in individual test files
|
33
|
+
or in a test helper (if you have one). You can [use
|
34
|
+
`Bundler.require()`](https://bundler.io/v1.16/guides/groups.html) to require
|
35
|
+
the library automatically. To explicitly require it:
|
47
36
|
|
48
|
-
Once you've done that & installed the gems, in your test, you'll have to
|
49
37
|
```ruby
|
50
38
|
require 'beaker-puppet'
|
51
39
|
```
|
@@ -74,16 +62,24 @@ file, or you can provide a beaker-hostgenerator value to the `TEST_TARGET`
|
|
74
62
|
environment variable. You can also specify the tests that get executed with the
|
75
63
|
`TESTS` environment variable.
|
76
64
|
|
77
|
-
|
65
|
+
## Transfer Notice
|
66
|
+
|
67
|
+
This plugin was originally authored by [Puppet Inc](http://puppet.com).
|
68
|
+
The maintainer preferred that Puppet Community take ownership of the module for future improvement and maintenance.
|
69
|
+
Existing pull requests and issues were transferred over, please fork and continue to contribute here.
|
70
|
+
|
71
|
+
Previously: https://github.com/puppetlabs/beaker
|
78
72
|
|
79
|
-
|
73
|
+
## License
|
80
74
|
|
81
|
-
|
75
|
+
This gem is licensed under the Apache-2 license.
|
82
76
|
|
83
|
-
|
84
|
-
lives on internal infrastructure.
|
77
|
+
## Release information
|
85
78
|
|
86
|
-
To
|
87
|
-
|
88
|
-
|
89
|
-
|
79
|
+
To make a new release, please do:
|
80
|
+
* update the version in `lib/beaker-puppet/version.rb`
|
81
|
+
* Install gems with `bundle install --with release --path .vendor`
|
82
|
+
* generate the changelog with `bundle exec rake changelog`
|
83
|
+
* Check if the new version matches the closed issues/PRs in the changelog
|
84
|
+
* Create a PR with it
|
85
|
+
* After it got merged, push a tag. GitHub actions will do the actual release to rubygems and GitHub Packages
|
data/Rakefile
CHANGED
@@ -297,3 +297,16 @@ namespace :docs do
|
|
297
297
|
end
|
298
298
|
end
|
299
299
|
end
|
300
|
+
|
301
|
+
begin
|
302
|
+
require 'github_changelog_generator/task'
|
303
|
+
|
304
|
+
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
305
|
+
config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file."
|
306
|
+
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix skip-changelog}
|
307
|
+
config.user = 'voxpupuli'
|
308
|
+
config.project = 'beaker-puppet'
|
309
|
+
config.future_release = "#{Gem::Specification.load("#{config.project}.gemspec").version}"
|
310
|
+
end
|
311
|
+
rescue LoadError
|
312
|
+
end
|
data/beaker-puppet.gemspec
CHANGED
@@ -5,9 +5,9 @@ require 'beaker-puppet/version'
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "beaker-puppet"
|
7
7
|
s.version = BeakerPuppet::VERSION
|
8
|
-
s.authors = ["
|
9
|
-
s.email = ["
|
10
|
-
s.homepage = "https://github.com/
|
8
|
+
s.authors = ["Vox Pupuli"]
|
9
|
+
s.email = ["voxpupuli@groups.io"]
|
10
|
+
s.homepage = "https://github.com/voxpupuli/beaker-puppet"
|
11
11
|
s.summary = %q{Beaker's Puppet DSL Extension Helpers!}
|
12
12
|
s.description = %q{For use for the Beaker acceptance testing tool}
|
13
13
|
s.license = 'Apache2'
|
@@ -20,10 +20,8 @@ Gem::Specification.new do |s|
|
|
20
20
|
# Testing dependencies
|
21
21
|
s.add_development_dependency 'rspec', '~> 3.0'
|
22
22
|
s.add_development_dependency 'rspec-its'
|
23
|
-
s.add_development_dependency 'fakefs', '
|
23
|
+
s.add_development_dependency 'fakefs', '>= 0.6', '< 2.0'
|
24
24
|
s.add_development_dependency 'rake', '~> 13.0'
|
25
|
-
s.add_development_dependency 'simplecov'
|
26
|
-
s.add_development_dependency 'pry', '~> 0.10'
|
27
25
|
|
28
26
|
# Acceptance Testing Dependencies
|
29
27
|
s.add_development_dependency 'beaker-vmpooler'
|
@@ -34,7 +32,6 @@ Gem::Specification.new do |s|
|
|
34
32
|
|
35
33
|
# Run time dependencies
|
36
34
|
s.add_runtime_dependency 'beaker', '~> 4.1'
|
37
|
-
s.add_runtime_dependency 'stringify-hash', '~> 0.0.0'
|
38
35
|
s.add_runtime_dependency 'in-parallel', '~> 0.1'
|
39
36
|
s.add_runtime_dependency 'oga'
|
40
37
|
|
@@ -519,7 +519,7 @@ module Beaker
|
|
519
519
|
puppet_apply_opts['ENV'] = opts[:environment]
|
520
520
|
end
|
521
521
|
|
522
|
-
file_path = host.tmpfile(
|
522
|
+
file_path = host.tmpfile(%(apply_manifest_#{Time.now.strftime("%H%M%S%L")}.pp))
|
523
523
|
create_remote_file(host, file_path, manifest + "\n")
|
524
524
|
|
525
525
|
if host[:default_apply_opts].respond_to? :merge
|
@@ -72,6 +72,9 @@ module Beaker
|
|
72
72
|
def dev_builds_accessible_on?(host, url = FOSS_DEFAULT_DOWNLOAD_URLS[:dev_builds_url])
|
73
73
|
return true if host.host_hash[:template] =~ /^amazon-*/ && host.hostname =~ /.puppet.net$/
|
74
74
|
|
75
|
+
# redhat-8-arm64 is provided from amazon
|
76
|
+
return true if host.host_hash[:template] == 'redhat-8-arm64' && host.hostname =~ /.puppet.net$/
|
77
|
+
|
75
78
|
result = on(host, %(curl -fI "#{url}"), accept_all_exit_codes: true)
|
76
79
|
return result.exit_code.zero?
|
77
80
|
end
|
@@ -300,12 +303,10 @@ module Beaker
|
|
300
303
|
# run_in_parallel option includes install
|
301
304
|
run_in_parallel = run_in_parallel? opts, @options, 'install'
|
302
305
|
block_on hosts, { :run_in_parallel => run_in_parallel } do |host|
|
303
|
-
if host['platform'] =~ /el-(
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
relver = $1
|
308
|
-
install_puppet_from_rpm_on(host, opts.merge(:release => relver, :family => 'fedora'))
|
306
|
+
if host['platform'] =~ /(el|fedora)-(\d+)/
|
307
|
+
family = $1
|
308
|
+
relver = $2
|
309
|
+
install_puppet_from_rpm_on(host, opts.merge(:release => relver, :family => family))
|
309
310
|
elsif host['platform'] =~ /(ubuntu|debian|cumulus|huaweios)/
|
310
311
|
install_puppet_from_deb_on(host, opts)
|
311
312
|
elsif host['platform'] =~ /windows/
|
@@ -416,6 +417,8 @@ module Beaker
|
|
416
417
|
install_puppet_agent_from_msi_on(host, opts)
|
417
418
|
when /osx/
|
418
419
|
install_puppet_agent_from_dmg_on(host, opts)
|
420
|
+
when /archlinux/
|
421
|
+
install_puppet_from_pacman_on(host, opts)
|
419
422
|
else
|
420
423
|
if opts[:default_action] == 'gem_install'
|
421
424
|
opts[:version] = opts[:puppet_gem_version]
|
@@ -949,7 +952,7 @@ module Beaker
|
|
949
952
|
on host, "echo '#{path_with_gem}' >> ~/.bashrc"
|
950
953
|
end
|
951
954
|
|
952
|
-
gemflags = '--no-
|
955
|
+
gemflags = '--no-document --no-format-executable'
|
953
956
|
|
954
957
|
if opts[:facter_version]
|
955
958
|
on host, "gem install facter -v'#{opts[:facter_version]}' #{gemflags}"
|
@@ -1031,8 +1034,11 @@ module Beaker
|
|
1031
1034
|
# package. We'll have to remember to update this block when
|
1032
1035
|
# we update the signing keys
|
1033
1036
|
if variant == 'sles' && version >= '11'
|
1034
|
-
|
1035
|
-
|
1037
|
+
%w[puppet puppet-20250406].each do |gpg_key|
|
1038
|
+
on host, "wget -O /tmp/#{gpg_key} https://yum.puppet.com/RPM-GPG-KEY-#{gpg_key}"
|
1039
|
+
on host, "rpm --import /tmp/#{gpg_key}"
|
1040
|
+
on host, "rm -f /tmp/#{gpg_key}"
|
1041
|
+
end
|
1036
1042
|
end
|
1037
1043
|
|
1038
1044
|
if variant == 'cisco_nexus'
|
@@ -1355,7 +1361,7 @@ module Beaker
|
|
1355
1361
|
opts[:download_url] = "#{opts[:pe_promoted_builds_url]}/puppet-agent/#{ pe_ver }/#{ opts[:puppet_agent_version] }/repos"
|
1356
1362
|
opts[:copy_base_local] ||= File.join('tmp', 'repo_configs')
|
1357
1363
|
opts[:copy_dir_external] ||= host.external_copy_base
|
1358
|
-
opts[:puppet_collection] ||=
|
1364
|
+
opts[:puppet_collection] ||= puppet_collection_for(:puppet_agent, opts[:puppet_agent_version])
|
1359
1365
|
add_role(host, 'aio') #we are installing agent, so we want aio role
|
1360
1366
|
release_path = opts[:download_url]
|
1361
1367
|
variant, version, arch, codename = host['platform'].to_array
|
@@ -1432,7 +1438,7 @@ module Beaker
|
|
1432
1438
|
def install_puppetserver_on(host, opts = {})
|
1433
1439
|
opts = sanitize_opts(opts)
|
1434
1440
|
|
1435
|
-
# Default to installing latest
|
1441
|
+
# Default to installing latest
|
1436
1442
|
opts[:version] ||= 'latest'
|
1437
1443
|
|
1438
1444
|
# If inside the Puppet VPN, install from development builds.
|
@@ -1453,8 +1459,10 @@ module Beaker
|
|
1453
1459
|
# here would be incorrect - that refers to FOSS puppet 3 only).
|
1454
1460
|
host[:type] = :aio
|
1455
1461
|
|
1456
|
-
if opts[:version] == 'latest'
|
1457
|
-
|
1462
|
+
if opts[:version] == 'latest'
|
1463
|
+
if opts[:nightlies]
|
1464
|
+
release_stream += '-nightly' unless release_stream.end_with? "-nightly"
|
1465
|
+
end
|
1458
1466
|
|
1459
1467
|
# Since we have modified the collection, we don't want to pass `latest`
|
1460
1468
|
# in to `install_package` as the version. That'll fail. Instead, if
|
@@ -56,7 +56,6 @@ module Beaker
|
|
56
56
|
block_on hosts do | host |
|
57
57
|
puppet_path = construct_puppet_path(host)
|
58
58
|
host.add_env_var('PATH', puppet_path)
|
59
|
-
host.add_env_var('PATH', 'PATH') # don't destroy the path!
|
60
59
|
end
|
61
60
|
end
|
62
61
|
|
@@ -68,7 +67,6 @@ module Beaker
|
|
68
67
|
block_on hosts do | host |
|
69
68
|
puppet_path = construct_puppet_path(host)
|
70
69
|
host.delete_env_var('PATH', puppet_path)
|
71
|
-
host.add_env_var('PATH', 'PATH') # don't destroy the path!
|
72
70
|
end
|
73
71
|
end
|
74
72
|
|
@@ -152,7 +150,7 @@ module Beaker
|
|
152
150
|
result = on(host, 'puppetserver --version', accept_all_exit_codes: true)
|
153
151
|
if result.exit_code.zero?
|
154
152
|
matched = result.stdout.strip.scan(%r{\d+\.\d+\.\d+})
|
155
|
-
return matched.
|
153
|
+
return matched.first
|
156
154
|
end
|
157
155
|
nil
|
158
156
|
end
|
data/lib/beaker-puppet.rb
CHANGED
data/setup/git/000_EnvSetup.rb
CHANGED
@@ -1229,10 +1229,6 @@ describe ClassMixedWithDSLHelpers do
|
|
1229
1229
|
end
|
1230
1230
|
|
1231
1231
|
describe '#bounce_service' do
|
1232
|
-
# let( :options ) {
|
1233
|
-
# opts = StringifyHash.new
|
1234
|
-
# opts
|
1235
|
-
# }
|
1236
1232
|
let( :options ) { Beaker::Options::Presets.new.presets }
|
1237
1233
|
let( :result ) { double.as_null_object }
|
1238
1234
|
before :each do
|
@@ -1285,12 +1281,13 @@ describe ClassMixedWithDSLHelpers do
|
|
1285
1281
|
end
|
1286
1282
|
|
1287
1283
|
describe '#sleep_until_puppetdb_started' do
|
1288
|
-
let( :options )
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1284
|
+
let( :options ) do # defaults from presets.rb
|
1285
|
+
{
|
1286
|
+
:puppetdb_port_nonssl => 8080,
|
1287
|
+
:puppetdb_port_ssl => 8081
|
1288
|
+
}
|
1289
|
+
end
|
1290
|
+
|
1294
1291
|
before :each do
|
1295
1292
|
allow( subject ).to receive( :options ) { options }
|
1296
1293
|
allow( hosts[0] ).to receive( :node_name ).and_return( '' )
|
@@ -1347,11 +1344,10 @@ describe ClassMixedWithDSLHelpers do
|
|
1347
1344
|
end
|
1348
1345
|
|
1349
1346
|
describe '#sleep_until_puppetserver_started' do
|
1350
|
-
let( :options )
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
}
|
1347
|
+
let( :options ) do
|
1348
|
+
{ :puppetserver_port => 8140 }
|
1349
|
+
end
|
1350
|
+
|
1355
1351
|
before :each do
|
1356
1352
|
allow( subject ).to receive( :options ) { options }
|
1357
1353
|
allow( hosts[0] ).to receive( :node_name )
|
@@ -1371,11 +1367,10 @@ describe ClassMixedWithDSLHelpers do
|
|
1371
1367
|
end
|
1372
1368
|
|
1373
1369
|
describe '#sleep_until_nc_started' do
|
1374
|
-
let( :options )
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
}
|
1370
|
+
let( :options ) do # defaults from presets.rb
|
1371
|
+
{ :nodeclassifier_port => 4433 }
|
1372
|
+
end
|
1373
|
+
|
1379
1374
|
before :each do
|
1380
1375
|
allow( subject ).to receive( :options ) { options }
|
1381
1376
|
allow( hosts[0] ).to receive( :node_name )
|
@@ -1406,7 +1406,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
1406
1406
|
it 'sets correct file paths when agent version is set to latest' do
|
1407
1407
|
host['platform'] = platform
|
1408
1408
|
agentversion = 'latest'
|
1409
|
-
collection = '
|
1409
|
+
collection = 'puppet'
|
1410
1410
|
opts = { :puppet_agent_version => "#{agentversion}" , :pe_promoted_builds_url => "#{downloadurl}" }
|
1411
1411
|
|
1412
1412
|
expect(subject).to receive(:fetch_http_file).once.with(
|
@@ -1424,10 +1424,10 @@ describe ClassMixedWithDSLInstallUtils do
|
|
1424
1424
|
subject.install_puppet_agent_pe_promoted_repo_on( host, opts )
|
1425
1425
|
end
|
1426
1426
|
|
1427
|
-
it 'sets correct file paths for agent version
|
1427
|
+
it 'sets correct file paths for agent version 1.x.x' do
|
1428
1428
|
host['platform'] = platform
|
1429
|
-
agentversion = '
|
1430
|
-
collection = '
|
1429
|
+
agentversion = '1.x.x'
|
1430
|
+
collection = 'pc1'
|
1431
1431
|
opts = { :puppet_agent_version => "#{agentversion}" , :pe_promoted_builds_url => "#{downloadurl}"}
|
1432
1432
|
|
1433
1433
|
expect(subject).to receive(:fetch_http_file).once.with(
|
@@ -1467,7 +1467,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
1467
1467
|
|
1468
1468
|
it 'sets correct file paths for agent version > 5.99' do
|
1469
1469
|
host['platform'] = platform
|
1470
|
-
agentversion = '6.0'
|
1470
|
+
agentversion = '6.0.0'
|
1471
1471
|
collection = 'puppet6'
|
1472
1472
|
opts = { :puppet_agent_version => "#{agentversion}" , :pe_promoted_builds_url => "#{downloadurl}"}
|
1473
1473
|
|
@@ -1492,8 +1492,8 @@ describe ClassMixedWithDSLInstallUtils do
|
|
1492
1492
|
let(:host) { make_host('master', platform: 'el-7-x86_64') }
|
1493
1493
|
|
1494
1494
|
context 'with default arguments' do
|
1495
|
-
it "installs the latest puppetserver from the default 'puppet
|
1496
|
-
expect(subject).to receive(:install_puppetlabs_release_repo_on).with(host, 'puppet
|
1495
|
+
it "installs the latest puppetserver from the default 'puppet' release stream" do
|
1496
|
+
expect(subject).to receive(:install_puppetlabs_release_repo_on).with(host, 'puppet', include(release_yum_repo_url: "http://yum.puppet.com"))
|
1497
1497
|
expect(subject).to receive(:install_package).with(host, 'puppetserver', nil)
|
1498
1498
|
subject.install_puppetserver_on(host)
|
1499
1499
|
end
|
@@ -1632,19 +1632,4 @@ describe ClassMixedWithDSLInstallUtils do
|
|
1632
1632
|
end
|
1633
1633
|
|
1634
1634
|
end
|
1635
|
-
|
1636
|
-
describe '#get_latest_puppet_agent_build_from_url' do
|
1637
|
-
let(:urls) {['https://downloads.puppet.com/mac/10.9/PC1/x86_64',
|
1638
|
-
'https://downloads.puppet.com/mac/10.10/PC1/x86_64',
|
1639
|
-
'https://downloads.puppet.com/mac/10.11/PC1/x86_64',
|
1640
|
-
'https://downloads.puppet.com/mac/10.12/PC1/x86_64',
|
1641
|
-
'https://downloads.puppet.com/windows']}
|
1642
|
-
|
1643
|
-
it "gets the right version" do
|
1644
|
-
urls.each do |url|
|
1645
|
-
expect(subject.get_latest_puppet_agent_build_from_url(url)).to match(/\d*.\d*.\d*/)
|
1646
|
-
end
|
1647
|
-
end
|
1648
|
-
end
|
1649
|
-
|
1650
1635
|
end
|
@@ -137,6 +137,20 @@ describe ClassMixedWithDSLInstallUtils do
|
|
137
137
|
|
138
138
|
end
|
139
139
|
|
140
|
+
describe '#puppetserver_version_on' do
|
141
|
+
it 'returns the tag on a released version' do
|
142
|
+
result = object_double(Beaker::Result.new({}, 'puppetserver --version'), :stdout => "puppetserver version: 6.13.0", :exit_code => 0)
|
143
|
+
expect(subject).to receive(:on).with(hosts.first, 'puppetserver --version', accept_all_exit_codes: true).and_return(result)
|
144
|
+
expect(subject.puppetserver_version_on(hosts.first)).to eq('6.13.0')
|
145
|
+
end
|
146
|
+
|
147
|
+
it 'returns the tag on a nightly version' do
|
148
|
+
result = object_double(Beaker::Result.new({}, 'puppetserver --version'), :stdout => "puppetserver version: 7.0.0.SNAPSHOT.2020.10.14T0512", :exit_code => 0)
|
149
|
+
expect(subject).to receive(:on).with(hosts.first, 'puppetserver --version', accept_all_exit_codes: true).and_return(result)
|
150
|
+
expect(subject.puppetserver_version_on(hosts.first)).to eq('7.0.0')
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
140
154
|
describe '#puppet_collection_for' do
|
141
155
|
it 'raises an error when given an invalid package' do
|
142
156
|
expect { subject.puppet_collection_for(:foo, '5.5.4') }.to raise_error
|
data/spec/spec_helper.rb
CHANGED
@@ -1,4 +1,27 @@
|
|
1
|
-
|
1
|
+
begin
|
2
|
+
require 'simplecov'
|
3
|
+
require 'simplecov-console'
|
4
|
+
require 'codecov'
|
5
|
+
rescue LoadError
|
6
|
+
else
|
7
|
+
SimpleCov.start do
|
8
|
+
track_files 'lib/**/*.rb'
|
9
|
+
|
10
|
+
add_filter '/spec'
|
11
|
+
|
12
|
+
enable_coverage :branch
|
13
|
+
|
14
|
+
# do not track vendored files
|
15
|
+
add_filter '/vendor'
|
16
|
+
add_filter '/.vendor'
|
17
|
+
end
|
18
|
+
|
19
|
+
SimpleCov.formatters = [
|
20
|
+
SimpleCov::Formatter::Console,
|
21
|
+
SimpleCov::Formatter::Codecov,
|
22
|
+
]
|
23
|
+
end
|
24
|
+
|
2
25
|
# require 'pp' statement needed before fakefs, otherwise they can collide. Ref:
|
3
26
|
# https://github.com/fakefs/fakefs#fakefs-----typeerror-superclass-mismatch-for-class-file
|
4
27
|
require 'pp'
|
@@ -20,4 +43,4 @@ RSpec.configure do |config|
|
|
20
43
|
config.include FakeFS::SpecHelpers
|
21
44
|
config.include TestFileHelpers
|
22
45
|
config.include HostHelpers
|
23
|
-
end
|
46
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beaker-puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.22.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Vox Pupuli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -42,22 +42,22 @@ dependencies:
|
|
42
42
|
name: fakefs
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0.6'
|
48
48
|
- - "<"
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version:
|
50
|
+
version: '2.0'
|
51
51
|
type: :development
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
|
-
- - "
|
55
|
+
- - ">="
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '0.6'
|
58
58
|
- - "<"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
60
|
+
version: '2.0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rake
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,34 +72,6 @@ dependencies:
|
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '13.0'
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
|
-
name: simplecov
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - ">="
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: '0'
|
82
|
-
type: :development
|
83
|
-
prerelease: false
|
84
|
-
version_requirements: !ruby/object:Gem::Requirement
|
85
|
-
requirements:
|
86
|
-
- - ">="
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '0'
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: pry
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - "~>"
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: '0.10'
|
96
|
-
type: :development
|
97
|
-
prerelease: false
|
98
|
-
version_requirements: !ruby/object:Gem::Requirement
|
99
|
-
requirements:
|
100
|
-
- - "~>"
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: '0.10'
|
103
75
|
- !ruby/object:Gem::Dependency
|
104
76
|
name: beaker-vmpooler
|
105
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,20 +128,6 @@ dependencies:
|
|
156
128
|
- - "~>"
|
157
129
|
- !ruby/object:Gem::Version
|
158
130
|
version: '4.1'
|
159
|
-
- !ruby/object:Gem::Dependency
|
160
|
-
name: stringify-hash
|
161
|
-
requirement: !ruby/object:Gem::Requirement
|
162
|
-
requirements:
|
163
|
-
- - "~>"
|
164
|
-
- !ruby/object:Gem::Version
|
165
|
-
version: 0.0.0
|
166
|
-
type: :runtime
|
167
|
-
prerelease: false
|
168
|
-
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
requirements:
|
170
|
-
- - "~>"
|
171
|
-
- !ruby/object:Gem::Version
|
172
|
-
version: 0.0.0
|
173
131
|
- !ruby/object:Gem::Dependency
|
174
132
|
name: in-parallel
|
175
133
|
requirement: !ruby/object:Gem::Requirement
|
@@ -200,19 +158,20 @@ dependencies:
|
|
200
158
|
version: '0'
|
201
159
|
description: For use for the Beaker acceptance testing tool
|
202
160
|
email:
|
203
|
-
-
|
161
|
+
- voxpupuli@groups.io
|
204
162
|
executables:
|
205
163
|
- beaker-puppet
|
206
164
|
extensions: []
|
207
165
|
extra_rdoc_files: []
|
208
166
|
files:
|
209
167
|
- ".github/dependabot.yml"
|
168
|
+
- ".github/workflows/release.yml"
|
169
|
+
- ".github/workflows/test.yml"
|
210
170
|
- ".gitignore"
|
211
171
|
- ".simplecov"
|
212
|
-
-
|
172
|
+
- CHANGELOG.md
|
213
173
|
- CODEOWNERS
|
214
174
|
- Gemfile
|
215
|
-
- HISTORY.md
|
216
175
|
- LICENSE
|
217
176
|
- README.md
|
218
177
|
- Rakefile
|
@@ -290,7 +249,7 @@ files:
|
|
290
249
|
- spec/helpers.rb
|
291
250
|
- spec/spec_helper.rb
|
292
251
|
- tasks/ci.rake
|
293
|
-
homepage: https://github.com/
|
252
|
+
homepage: https://github.com/voxpupuli/beaker-puppet
|
294
253
|
licenses:
|
295
254
|
- Apache2
|
296
255
|
metadata: {}
|
@@ -309,7 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
309
268
|
- !ruby/object:Gem::Version
|
310
269
|
version: '0'
|
311
270
|
requirements: []
|
312
|
-
rubygems_version: 3.
|
271
|
+
rubygems_version: 3.2.32
|
313
272
|
signing_key:
|
314
273
|
specification_version: 4
|
315
274
|
summary: Beaker's Puppet DSL Extension Helpers!
|