beaker-puppet 1.19.1 → 1.22.0
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/release.yml +32 -0
- data/.github/workflows/test.yml +36 -0
- data/CHANGELOG.md +634 -0
- data/CODEOWNERS +0 -3
- data/Gemfile +7 -5
- data/README.md +34 -38
- data/Rakefile +13 -0
- data/beaker-puppet.gemspec +4 -7
- data/lib/beaker-puppet.rb +0 -1
- data/lib/beaker-puppet/helpers/host_helpers.rb +5 -1
- data/lib/beaker-puppet/helpers/puppet_helpers.rb +2 -2
- data/lib/beaker-puppet/install_utils/foss_utils.rb +17 -7
- data/lib/beaker-puppet/install_utils/puppet_utils.rb +1 -3
- data/lib/beaker-puppet/install_utils/windows_utils.rb +2 -2
- data/lib/beaker-puppet/version.rb +1 -1
- data/setup/git/000_EnvSetup.rb +1 -1
- data/spec/beaker-puppet/helpers/host_helpers_spec.rb +29 -0
- 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/beaker-puppet/install_utils/windows_utils_spec.rb +1 -1
- data/spec/spec_helper.rb +25 -2
- metadata +15 -53
- data/HISTORY.md +0 -42
data/CODEOWNERS
CHANGED
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 = "v#{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
|
|
data/lib/beaker-puppet.rb
CHANGED
@@ -7,7 +7,11 @@ module Beaker
|
|
7
7
|
module HostHelpers
|
8
8
|
|
9
9
|
def ruby_command(host)
|
10
|
-
|
10
|
+
if host['platform'] =~ /windows/ && !host.is_cygwin?
|
11
|
+
"cmd /V /C \"set PATH=#{host['privatebindir']};!PATH! && ruby\""
|
12
|
+
else
|
13
|
+
"env PATH=\"#{host['privatebindir']}:${PATH}\" ruby"
|
14
|
+
end
|
11
15
|
end
|
12
16
|
|
13
17
|
# Returns an array containing the owner, group and mode of
|
@@ -12,7 +12,7 @@ module Beaker
|
|
12
12
|
|
13
13
|
# Return the regular expression pattern for an IPv4 address
|
14
14
|
def ipv4_regex
|
15
|
-
|
15
|
+
Resolv::IPv4::Regex
|
16
16
|
end
|
17
17
|
|
18
18
|
# Return the IP address that given hostname returns when resolved on
|
@@ -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
|
@@ -416,6 +419,8 @@ module Beaker
|
|
416
419
|
install_puppet_agent_from_msi_on(host, opts)
|
417
420
|
when /osx/
|
418
421
|
install_puppet_agent_from_dmg_on(host, opts)
|
422
|
+
when /archlinux/
|
423
|
+
install_puppet_from_pacman_on(host, opts)
|
419
424
|
else
|
420
425
|
if opts[:default_action] == 'gem_install'
|
421
426
|
opts[:version] = opts[:puppet_gem_version]
|
@@ -949,7 +954,7 @@ module Beaker
|
|
949
954
|
on host, "echo '#{path_with_gem}' >> ~/.bashrc"
|
950
955
|
end
|
951
956
|
|
952
|
-
gemflags = '--no-
|
957
|
+
gemflags = '--no-document --no-format-executable'
|
953
958
|
|
954
959
|
if opts[:facter_version]
|
955
960
|
on host, "gem install facter -v'#{opts[:facter_version]}' #{gemflags}"
|
@@ -1031,8 +1036,11 @@ module Beaker
|
|
1031
1036
|
# package. We'll have to remember to update this block when
|
1032
1037
|
# we update the signing keys
|
1033
1038
|
if variant == 'sles' && version >= '11'
|
1034
|
-
|
1035
|
-
|
1039
|
+
%w[puppet puppet-20250406].each do |gpg_key|
|
1040
|
+
on host, "wget -O /tmp/#{gpg_key} https://yum.puppet.com/RPM-GPG-KEY-#{gpg_key}"
|
1041
|
+
on host, "rpm --import /tmp/#{gpg_key}"
|
1042
|
+
on host, "rm -f /tmp/#{gpg_key}"
|
1043
|
+
end
|
1036
1044
|
end
|
1037
1045
|
|
1038
1046
|
if variant == 'cisco_nexus'
|
@@ -1355,7 +1363,7 @@ module Beaker
|
|
1355
1363
|
opts[:download_url] = "#{opts[:pe_promoted_builds_url]}/puppet-agent/#{ pe_ver }/#{ opts[:puppet_agent_version] }/repos"
|
1356
1364
|
opts[:copy_base_local] ||= File.join('tmp', 'repo_configs')
|
1357
1365
|
opts[:copy_dir_external] ||= host.external_copy_base
|
1358
|
-
opts[:puppet_collection] ||=
|
1366
|
+
opts[:puppet_collection] ||= puppet_collection_for(:puppet_agent, opts[:puppet_agent_version])
|
1359
1367
|
add_role(host, 'aio') #we are installing agent, so we want aio role
|
1360
1368
|
release_path = opts[:download_url]
|
1361
1369
|
variant, version, arch, codename = host['platform'].to_array
|
@@ -1432,7 +1440,7 @@ module Beaker
|
|
1432
1440
|
def install_puppetserver_on(host, opts = {})
|
1433
1441
|
opts = sanitize_opts(opts)
|
1434
1442
|
|
1435
|
-
# Default to installing latest
|
1443
|
+
# Default to installing latest
|
1436
1444
|
opts[:version] ||= 'latest'
|
1437
1445
|
|
1438
1446
|
# If inside the Puppet VPN, install from development builds.
|
@@ -1453,8 +1461,10 @@ module Beaker
|
|
1453
1461
|
# here would be incorrect - that refers to FOSS puppet 3 only).
|
1454
1462
|
host[:type] = :aio
|
1455
1463
|
|
1456
|
-
if opts[:version] == 'latest'
|
1457
|
-
|
1464
|
+
if opts[:version] == 'latest'
|
1465
|
+
if opts[:nightlies]
|
1466
|
+
release_stream += '-nightly' unless release_stream.end_with? "-nightly"
|
1467
|
+
end
|
1458
1468
|
|
1459
1469
|
# Since we have modified the collection, we don't want to pass `latest`
|
1460
1470
|
# 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
|
@@ -177,8 +177,8 @@ module Beaker
|
|
177
177
|
# emit the misc/versions.txt file which contains component versions for
|
178
178
|
# puppet, facter, hiera, pxp-agent, packaging and vendored Ruby
|
179
179
|
[
|
180
|
-
'
|
181
|
-
'
|
180
|
+
'"${env:ProgramFiles}/Puppet Labs/puppet/misc/versions.txt"',
|
181
|
+
'"${env:ProgramFiles(x86)}/Puppet Labs/puppet/misc/versions.txt"'
|
182
182
|
].each do |path|
|
183
183
|
if file_exists_on(host, path)
|
184
184
|
logger.info(file_contents_on(host, path)) && break
|
data/setup/git/000_EnvSetup.rb
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class ClassMixedWithDSLHelpers
|
4
|
+
include Beaker::DSL::Helpers::HostHelpers
|
5
|
+
end
|
6
|
+
|
7
|
+
describe ClassMixedWithDSLHelpers do
|
8
|
+
let(:privatebindir) { 'C:\\Program Files\\Puppet Labs\\Puppet\\bin' }
|
9
|
+
|
10
|
+
context 'when platform is windows and non cygwin' do
|
11
|
+
let(:winhost) { make_host('winhost_non_cygwin', { :platform => 'windows',
|
12
|
+
:privatebindir => privatebindir,
|
13
|
+
:is_cygwin => 'false' }) }
|
14
|
+
|
15
|
+
it 'run the correct ruby_command' do
|
16
|
+
expect(subject.ruby_command(winhost)).to eq("cmd /V /C \"set PATH=#{privatebindir};!PATH! && ruby\"")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context 'when platform is windows and cygwin' do
|
21
|
+
let(:winhost) { make_host('winhost', { :platform => Beaker::Platform.new('windows-2016-a64'),
|
22
|
+
:privatebindir => privatebindir,
|
23
|
+
:is_cygwin => true }) }
|
24
|
+
|
25
|
+
it 'run the correct ruby_command' do
|
26
|
+
expect(subject.ruby_command(winhost)).to eq("env PATH=\"#{privatebindir}:${PATH}\" ruby")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -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
|