beaker-puppet 1.15.1 → 1.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 875b73fe27f2c9ad51408aeb125f0676ea37f969
4
- data.tar.gz: abec417de80b055b94dc501d306b696e4c922db7
3
+ metadata.gz: f195bb6d82d2cf6a4cb6ff976c15df17f54b3e0f
4
+ data.tar.gz: 00e7a6b8fd9a31a78d545f88bbe912980be3d0e9
5
5
  SHA512:
6
- metadata.gz: 701bb774daef21e191e8eb38fbebc33ba5e0e30c7294b44cd737a69371678978635a1990c486550d270c2bd14ef038a729e67c72dfb760fcb379afc0d6d89ad9
7
- data.tar.gz: eda9b9ab46a82dfc3ad99aadccde76d7da3bfa25fd4b75c232312109bed904291d34e835af6fbd72e5c720da1224be04e3118f5790443c45badb0bea84f45120
6
+ metadata.gz: ea339a35f641981d7e9d4ad068a6cde85440f9e89402ecbd9b3410bf6d51bd76e2ff5d611eb31d5fd852f4635051a0d153cb33f882b008f5bb8d19de2f12ca13
7
+ data.tar.gz: cae6d89f572103b163d308a38948cea7dfb4b96467e4df93eb1b676ff83db440bf6ef51c39596a6badac38fdf2703f27d0f66a2e7cdf6a0a466c0545fa6b54a3
@@ -93,15 +93,17 @@ module Beaker
93
93
  # must be one of
94
94
  # * :puppet_agent (you can get this version from the `aio_agent_version_fact`)
95
95
  # * :puppet
96
+ # * :puppetserver
96
97
  #
97
98
  #
98
- # @param package [Symbol] the package name. must be one of :puppet_agent, :puppet
99
+ # @param package [Symbol] the package name. must be one of :puppet_agent, :puppet, :puppetserver
99
100
  # @param version [String] a version number or the string 'latest'
100
101
  # @returns [String|nil] the name of the corresponding puppet collection, if any
101
102
  def puppet_collection_for(package, version)
102
103
  valid_packages = [
103
104
  :puppet_agent,
104
- :puppet
105
+ :puppet,
106
+ :puppetserver
105
107
  ]
106
108
 
107
109
  unless valid_packages.include?(package)
@@ -109,15 +111,20 @@ module Beaker
109
111
  end
110
112
 
111
113
  case package
112
- when :puppet_agent, :puppet
114
+ when :puppet_agent, :puppet, :puppetserver
113
115
  version = version.to_s
114
116
  return 'puppet' if version.strip == 'latest'
115
117
 
116
118
  x, y, z = version.to_s.split('.').map(&:to_i)
117
119
  return nil if x.nil? || y.nil? || z.nil?
118
120
 
119
- pc1_x = package == :puppet ? 4 : 1
120
- return 'pc1' if x == pc1_x
121
+ pc1_x = {
122
+ puppet: 4,
123
+ puppet_agent: 1,
124
+ puppetserver: 2
125
+ }
126
+
127
+ return 'pc1' if x == pc1_x[package]
121
128
 
122
129
  # A y version >= 99 indicates a pre-release version of the next x release
123
130
  x += 1 if y >= 99
@@ -1,3 +1,3 @@
1
1
  module BeakerPuppet
2
- VERSION = '1.15.1'
2
+ VERSION = '1.16.0'
3
3
  end
@@ -22,8 +22,8 @@ test_name "Install repositories on target machines..." do
22
22
  # host_path: ~/puppet
23
23
  # container_path: /build/puppet
24
24
  #
25
- if agent[:mount_folders]
26
- mount = agent[:mount_folders][repository[:name]]
25
+ if host[:mount_folders]
26
+ mount = host[:mount_folders][repository[:name]]
27
27
  repository[:path] = "file://#{mount[:container_path]}"
28
28
  end
29
29
  repo_dir = host.tmpdir(repository[:name])
@@ -203,5 +203,36 @@ describe ClassMixedWithDSLInstallUtils do
203
203
  end
204
204
  end
205
205
  end
206
+
207
+ context 'when the :puppetserver package is passed in' do
208
+ context 'given a valid version' do
209
+ {
210
+ '2.0.0' => 'pc1',
211
+ '2.0.x' => 'pc1',
212
+ '5.3.1' => 'puppet5',
213
+ '5.3.x' => 'puppet5',
214
+ '5.99.0' => 'puppet6',
215
+ '6.1.99-foo' => 'puppet6',
216
+ '6.99.99' => 'puppet7',
217
+ '7.0.0' => 'puppet7',
218
+ }.each do |version, collection|
219
+ it "returns collection '#{collection}' for version '#{version}'" do
220
+ expect(subject.puppet_collection_for(:puppetserver, version)).to eq(collection)
221
+ end
222
+ end
223
+ end
224
+
225
+ it "returns the default, latest puppet collection given the version 'latest'" do
226
+ expect(subject.puppet_collection_for(:puppetserver, 'latest')).to eq('puppet')
227
+ end
228
+
229
+ context 'given an invalid version' do
230
+ [nil, '', '0.1.0', '3.8.1', '', 'not-semver', 'not.semver.either'].each do |version|
231
+ it "returns a nil collection value for version '#{version}'" do
232
+ expect(subject.puppet_collection_for(:puppetserver, version)).to be_nil
233
+ end
234
+ end
235
+ end
236
+ end
206
237
  end
207
238
  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.15.1
4
+ version: 1.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-28 00:00:00.000000000 Z
11
+ date: 2019-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec