puppet 5.5.3-x86-mingw32 → 5.5.6-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/CONTRIBUTING.md +1 -4
- data/Gemfile +5 -1
- data/Gemfile.lock +167 -0
- data/Rakefile +4 -34
- data/ext/build_defaults.yaml +0 -2
- data/lib/puppet/application/cert.rb +3 -1
- data/lib/puppet/defaults.rb +55 -26
- data/lib/puppet/face/certificate.rb +2 -0
- data/lib/puppet/indirector/ldap.rb +6 -0
- data/lib/puppet/node/environment.rb +4 -2
- data/lib/puppet/parser/functions/tagged.rb +1 -4
- data/lib/puppet/pops/issues.rb +4 -0
- data/lib/puppet/pops/validation/checker4_0.rb +100 -0
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +4 -3
- data/lib/puppet/provider/augeas/augeas.rb +198 -4
- data/lib/puppet/provider/service/smf.rb +2 -3
- data/lib/puppet/provider/service/upstart.rb +10 -2
- data/lib/puppet/test/test_helper.rb +0 -3
- data/lib/puppet/type/file/source.rb +10 -1
- data/lib/puppet/version.rb +1 -1
- data/locales/puppet.pot +132 -118
- data/man/man5/puppet.conf.5 +23 -23
- data/man/man8/puppet-agent.8 +1 -1
- data/man/man8/puppet-apply.8 +1 -1
- data/man/man8/puppet-ca.8 +3 -3
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-cert.8 +2 -2
- data/man/man8/puppet-certificate.8 +3 -3
- data/man/man8/puppet-certificate_request.8 +1 -1
- data/man/man8/puppet-certificate_revocation_list.8 +1 -1
- data/man/man8/puppet-config.8 +1 -1
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +1 -1
- data/man/man8/puppet-doc.8 +1 -1
- data/man/man8/puppet-epp.8 +1 -1
- data/man/man8/puppet-facts.8 +1 -1
- data/man/man8/puppet-filebucket.8 +1 -1
- data/man/man8/puppet-generate.8 +1 -1
- data/man/man8/puppet-help.8 +1 -1
- data/man/man8/puppet-key.8 +1 -1
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-man.8 +1 -1
- data/man/man8/puppet-master.8 +1 -1
- data/man/man8/puppet-module.8 +1 -1
- data/man/man8/puppet-node.8 +1 -1
- data/man/man8/puppet-parser.8 +1 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-report.8 +1 -1
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-script.8 +1 -1
- data/man/man8/puppet-status.8 +1 -1
- data/man/man8/puppet.8 +3 -3
- data/spec/integration/type/file_spec.rb +18 -3
- data/spec/integration/util/settings_spec.rb +1 -0
- data/spec/integration/util/windows/security_spec.rb +78 -1
- data/spec/unit/application/master_spec.rb +2 -0
- data/spec/unit/configurer/downloader_spec.rb +5 -0
- data/spec/unit/defaults_spec.rb +13 -0
- data/spec/unit/face/help_spec.rb +2 -1
- data/spec/unit/indirector/ldap_spec.rb +22 -1
- data/spec/unit/node/environment_spec.rb +14 -0
- data/spec/unit/parser/functions/tagged_spec.rb +16 -0
- data/spec/unit/pops/validator/validator_spec.rb +139 -4
- data/spec/unit/provider/augeas/augeas_spec.rb +66 -1
- data/spec/unit/provider/service/smf_spec.rb +2 -6
- data/spec/unit/provider/service/upstart_spec.rb +37 -0
- data/spec/unit/settings/autosign_setting_spec.rb +2 -2
- data/spec/unit/settings/file_setting_spec.rb +6 -0
- data/spec/unit/ssl/certificate_authority_spec.rb +1 -0
- metadata +4 -3
@@ -1,4 +1,3 @@
|
|
1
|
-
#! /usr/bin/env ruby
|
2
1
|
require 'spec_helper'
|
3
2
|
require 'puppet/util/package'
|
4
3
|
|
@@ -235,6 +234,50 @@ describe provider_class do
|
|
235
234
|
expect(@provider.process_values(command)).to eq(true)
|
236
235
|
end
|
237
236
|
|
237
|
+
it "should return true for an array match with double quotes and spaces" do
|
238
|
+
command = ["values", "fake value", "== [ \"set\" , \"of\" , \"values\" ] "]
|
239
|
+
expect(@provider.process_values(command)).to eq(true)
|
240
|
+
end
|
241
|
+
|
242
|
+
it "should return true for an array match with internally escaped single quotes" do
|
243
|
+
@provider.aug.stubs(:match).returns(["set", "o'values", "here"])
|
244
|
+
@provider.aug.stubs(:get).returns('set').then.returns("o'values").then.returns('here')
|
245
|
+
command = ["values", "fake value", "== [ 'set', 'o\\'values', 'here']"]
|
246
|
+
expect(@provider.process_values(command)).to eq(true)
|
247
|
+
end
|
248
|
+
|
249
|
+
it "should return true for an array match with octal character sequences" do
|
250
|
+
command = ["values", "fake value", "== [\"\\x73et\", \"of\", \"values\"]"]
|
251
|
+
expect(@provider.process_values(command)).to eq(true)
|
252
|
+
end
|
253
|
+
|
254
|
+
it "should return true for an array match with hex character sequences" do
|
255
|
+
command = ["values", "fake value", "== [\"\\163et\", \"of\", \"values\"]"]
|
256
|
+
expect(@provider.process_values(command)).to eq(true)
|
257
|
+
end
|
258
|
+
|
259
|
+
it "should return true for an array match with short unicode escape sequences" do
|
260
|
+
command = ["values", "fake value", "== [\"\\u0073et\", \"of\", \"values\"]"]
|
261
|
+
expect(@provider.process_values(command)).to eq(true)
|
262
|
+
end
|
263
|
+
|
264
|
+
it "should return true for an array match with single character long unicode escape sequences" do
|
265
|
+
command = ["values", "fake value", "== [\"\\u{0073}et\", \"of\", \"values\"]"]
|
266
|
+
expect(@provider.process_values(command)).to eq(true)
|
267
|
+
end
|
268
|
+
|
269
|
+
it "should return true for an array match with multi-character long unicode escape sequences" do
|
270
|
+
command = ["values", "fake value", "== [\"\\u{0073 0065 0074}\", \"of\", \"values\"]"]
|
271
|
+
expect(@provider.process_values(command)).to eq(true)
|
272
|
+
end
|
273
|
+
|
274
|
+
it "should return true for an array match with literal backslashes" do
|
275
|
+
@provider.aug.stubs(:match).returns(["set", "o\\values", "here"])
|
276
|
+
@provider.aug.stubs(:get).returns('set').then.returns("o\\values").then.returns('here')
|
277
|
+
command = ["values", "fake value", "== [ 'set', 'o\\\\values', 'here']"]
|
278
|
+
expect(@provider.process_values(command)).to eq(true)
|
279
|
+
end
|
280
|
+
|
238
281
|
it "should return false for an array non match" do
|
239
282
|
command = ["values", "fake value", "== ['this', 'should', 'not', 'match']"]
|
240
283
|
expect(@provider.process_values(command)).to eq(false)
|
@@ -249,6 +292,18 @@ describe provider_class do
|
|
249
292
|
command = ["values", "fake value", "!= ['this', 'should', 'not', 'match']"]
|
250
293
|
expect(@provider.process_values(command)).to eq(true)
|
251
294
|
end
|
295
|
+
|
296
|
+
it "should return true for an array non match with double quotes and spaces" do
|
297
|
+
command = ["values", "fake value", "!= [ \"this\" , \"should\" ,\"not\", \"match\" ] "]
|
298
|
+
expect(@provider.process_values(command)).to eq(true)
|
299
|
+
end
|
300
|
+
|
301
|
+
it "should return true for an empty array match" do
|
302
|
+
@provider.aug.stubs(:match).returns([])
|
303
|
+
@provider.aug.stubs(:get)
|
304
|
+
command = ["values", "fake value", "== []"]
|
305
|
+
expect(@provider.process_values(command)).to eq(true)
|
306
|
+
end
|
252
307
|
end
|
253
308
|
|
254
309
|
describe "match filters" do
|
@@ -294,6 +349,11 @@ describe provider_class do
|
|
294
349
|
expect(@provider.process_match(command)).to eq(true)
|
295
350
|
end
|
296
351
|
|
352
|
+
it "should return true for an array match with double quotes and spaces" do
|
353
|
+
command = ["match", "fake value", "== [ \"set\" , \"of\" , \"values\" ] "]
|
354
|
+
expect(@provider.process_match(command)).to eq(true)
|
355
|
+
end
|
356
|
+
|
297
357
|
it "should return false for an array non match" do
|
298
358
|
command = ["match", "fake value", "== ['this', 'should', 'not', 'match']"]
|
299
359
|
expect(@provider.process_match(command)).to eq(false)
|
@@ -308,6 +368,11 @@ describe provider_class do
|
|
308
368
|
command = ["match", "fake value", "!= ['this', 'should', 'not', 'match']"]
|
309
369
|
expect(@provider.process_match(command)).to eq(true)
|
310
370
|
end
|
371
|
+
|
372
|
+
it "should return true for an array non match with double quotes and spaces" do
|
373
|
+
command = ["match", "fake value", "!= [ \"this\" , \"should\" ,\"not\", \"match\" ] "]
|
374
|
+
expect(@provider.process_match(command)).to eq(true)
|
375
|
+
end
|
311
376
|
end
|
312
377
|
|
313
378
|
describe "need to run" do
|
@@ -18,8 +18,6 @@ describe provider_class, :if => Puppet.features.posix? do
|
|
18
18
|
|
19
19
|
FileTest.stubs(:file?).with('/usr/sbin/svcadm').returns true
|
20
20
|
FileTest.stubs(:executable?).with('/usr/sbin/svcadm').returns true
|
21
|
-
FileTest.stubs(:file?).with('/usr/sbin/svccfg').returns true
|
22
|
-
FileTest.stubs(:executable?).with('/usr/sbin/svccfg').returns true
|
23
21
|
FileTest.stubs(:file?).with('/usr/bin/svcs').returns true
|
24
22
|
FileTest.stubs(:executable?).with('/usr/bin/svcs').returns true
|
25
23
|
Facter.stubs(:value).with(:operatingsystem).returns('Solaris')
|
@@ -76,9 +74,9 @@ describe provider_class, :if => Puppet.features.posix? do
|
|
76
74
|
@provider.expects(:svcs).with('-H', '-o', 'state,nstate', "/system/myservice").returns("online\t-")
|
77
75
|
@provider.status
|
78
76
|
end
|
79
|
-
it "should return
|
77
|
+
it "should return stopped if svcs can't find the service" do
|
80
78
|
@provider.stubs(:svcs).raises(Puppet::ExecutionFailure.new("no svc found"))
|
81
|
-
expect(@provider.status).to eq(:
|
79
|
+
expect(@provider.status).to eq(:stopped)
|
82
80
|
end
|
83
81
|
it "should return running if online in svcs output" do
|
84
82
|
@provider.stubs(:svcs).returns("online\t-")
|
@@ -168,14 +166,12 @@ describe provider_class, :if => Puppet.features.posix? do
|
|
168
166
|
|
169
167
|
describe "when stopping" do
|
170
168
|
it "should execute external command 'svcadm disable /system/myservice'" do
|
171
|
-
@provider.stubs(:status).returns :running
|
172
169
|
@provider.expects(:texecute).with(:stop, ["/usr/sbin/svcadm", :disable, '-s', "/system/myservice"], true)
|
173
170
|
@provider.expects(:wait).with('offline', 'disabled', 'uninitialized')
|
174
171
|
@provider.stop
|
175
172
|
end
|
176
173
|
|
177
174
|
it "should error if timeout occurs while stopping the service" do
|
178
|
-
@provider.stubs(:status).returns :running
|
179
175
|
@provider.expects(:texecute).with(:stop, ["/usr/sbin/svcadm", :disable, '-s', "/system/myservice"], true)
|
180
176
|
Timeout.expects(:timeout).with(60).raises(Timeout::Error)
|
181
177
|
expect { @provider.stop }.to raise_error Puppet::Error, ('Timed out waiting for /system/myservice to transition states')
|
@@ -34,6 +34,43 @@ describe Puppet::Type.type(:service).provider(:upstart) do
|
|
34
34
|
expect(described_class.default?).to be_truthy
|
35
35
|
end
|
36
36
|
|
37
|
+
context "upstart daemon existence confine" do
|
38
|
+
# We have a separate method here because our search for the upstart daemon
|
39
|
+
# confine expects it to be the last confine declared in the upstart provider.
|
40
|
+
# If in the future we add other confines below it or change its order, these
|
41
|
+
# unit tests will fail. Placing knowledge of where this confine is located
|
42
|
+
# in one place makes updating it less painful in case we ever need to do this.
|
43
|
+
def assert_upstart_daemon_existence_confine_is(expected_value)
|
44
|
+
upstart_daemon_existence_confine = provider_class.confine_collection.instance_variable_get(:@confines)[-1]
|
45
|
+
expect(upstart_daemon_existence_confine.valid?).to be(expected_value)
|
46
|
+
end
|
47
|
+
|
48
|
+
let(:initctl_version) { ['/sbin/initctl', 'version', '--quiet'] }
|
49
|
+
before(:each) do
|
50
|
+
# Stub out /sbin/initctl
|
51
|
+
Puppet::Util.stubs(:which).with('/sbin/initctl').returns('/sbin/initctl')
|
52
|
+
|
53
|
+
# Both of our tests are asserting the confine :true block that shells out to
|
54
|
+
# `initctl version --quiet`. Its expression is evaluated at provider load-time.
|
55
|
+
# Hence before each test, we want to reload the upstart provider so that the
|
56
|
+
# confine is re-evaluated.
|
57
|
+
Puppet::Type.type(:service).unprovide(:upstart)
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should return true when the daemon is running" do
|
61
|
+
Puppet::Util::Execution.expects(:execute).with(initctl_version, instance_of(Hash))
|
62
|
+
assert_upstart_daemon_existence_confine_is(true)
|
63
|
+
end
|
64
|
+
|
65
|
+
it "should return false when the daemon is not running" do
|
66
|
+
Puppet::Util::Execution.expects(:execute)
|
67
|
+
.with(initctl_version, instance_of(Hash))
|
68
|
+
.raises(Puppet::ExecutionFailure, "initctl failed!")
|
69
|
+
|
70
|
+
assert_upstart_daemon_existence_confine_is(false)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
37
74
|
describe "excluding services" do
|
38
75
|
it "ignores tty and serial on Redhat systems" do
|
39
76
|
Facter.stubs(:value).with(:osfamily).returns('RedHat')
|
@@ -72,11 +72,11 @@ describe Puppet::Settings::AutosignSetting do
|
|
72
72
|
end
|
73
73
|
|
74
74
|
describe "converting the setting to a resource" do
|
75
|
-
it "converts the file path to a file resource" do
|
75
|
+
it "converts the file path to a file resource", :if => !Puppet::Util::Platform.windows? do
|
76
76
|
path = File.expand_path('/path/to/autosign.conf')
|
77
77
|
settings.stubs(:value).with('autosign', nil, false).returns(path)
|
78
78
|
Puppet::FileSystem.stubs(:exist?).with(path).returns true
|
79
|
-
Puppet.
|
79
|
+
Puppet.features.expects(:root?).returns(true)
|
80
80
|
|
81
81
|
setting.mode = '0664'
|
82
82
|
setting.owner = 'service'
|
@@ -182,12 +182,14 @@ describe Puppet::Settings::FileSetting do
|
|
182
182
|
end
|
183
183
|
|
184
184
|
it "should set the mode on the file if a mode is provided as an octal number" do
|
185
|
+
Puppet[:manage_internal_file_permissions] = true
|
185
186
|
@file.mode = 0755
|
186
187
|
|
187
188
|
expect(@file.to_resource[:mode]).to eq('755')
|
188
189
|
end
|
189
190
|
|
190
191
|
it "should set the mode on the file if a mode is provided as a string" do
|
192
|
+
Puppet[:manage_internal_file_permissions] = true
|
191
193
|
@file.mode = '0755'
|
192
194
|
|
193
195
|
expect(@file.to_resource[:mode]).to eq('755')
|
@@ -202,6 +204,7 @@ describe Puppet::Settings::FileSetting do
|
|
202
204
|
end
|
203
205
|
|
204
206
|
it "should set the owner if running as root and the owner is provided" do
|
207
|
+
Puppet[:manage_internal_file_permissions] = true
|
205
208
|
Puppet.features.expects(:root?).returns true
|
206
209
|
Puppet.features.stubs(:microsoft_windows?).returns false
|
207
210
|
|
@@ -218,6 +221,7 @@ describe Puppet::Settings::FileSetting do
|
|
218
221
|
end
|
219
222
|
|
220
223
|
it "should set the group if running as root and the group is provided" do
|
224
|
+
Puppet[:manage_internal_file_permissions] = true
|
221
225
|
Puppet.features.expects(:root?).returns true
|
222
226
|
Puppet.features.stubs(:microsoft_windows?).returns false
|
223
227
|
|
@@ -235,6 +239,7 @@ describe Puppet::Settings::FileSetting do
|
|
235
239
|
|
236
240
|
|
237
241
|
it "should not set owner if not running as root" do
|
242
|
+
Puppet[:manage_internal_file_permissions] = true
|
238
243
|
Puppet.features.expects(:root?).returns false
|
239
244
|
Puppet.features.stubs(:microsoft_windows?).returns false
|
240
245
|
@file.stubs(:owner).returns "foo"
|
@@ -242,6 +247,7 @@ describe Puppet::Settings::FileSetting do
|
|
242
247
|
end
|
243
248
|
|
244
249
|
it "should not set group if not running as root" do
|
250
|
+
Puppet[:manage_internal_file_permissions] = true
|
245
251
|
Puppet.features.expects(:root?).returns false
|
246
252
|
Puppet.features.stubs(:microsoft_windows?).returns false
|
247
253
|
@file.stubs(:group).returns "foo"
|
@@ -943,6 +943,7 @@ describe Puppet::SSL::CertificateAuthority do
|
|
943
943
|
end
|
944
944
|
|
945
945
|
it "should be deprecated" do
|
946
|
+
Puppet.expects(:deprecation_warning).with(regexp_matches(/Accessing 'cacert' as a setting is deprecated/))
|
946
947
|
Puppet.expects(:deprecation_warning).with(regexp_matches(/certificate_is_alive\? is deprecated/))
|
947
948
|
@ca.certificate_is_alive?(@cert)
|
948
949
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.5.
|
4
|
+
version: 5.5.6
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facter
|
@@ -186,6 +186,7 @@ files:
|
|
186
186
|
- COMMITTERS.md
|
187
187
|
- CONTRIBUTING.md
|
188
188
|
- Gemfile
|
189
|
+
- Gemfile.lock
|
189
190
|
- LICENSE
|
190
191
|
- MAINTAINERS
|
191
192
|
- README.md
|
@@ -2774,7 +2775,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
2774
2775
|
version: 1.3.1
|
2775
2776
|
requirements: []
|
2776
2777
|
rubyforge_project: puppet
|
2777
|
-
rubygems_version: 2.
|
2778
|
+
rubygems_version: 2.7.7
|
2778
2779
|
signing_key:
|
2779
2780
|
specification_version: 4
|
2780
2781
|
summary: Puppet, an automated configuration management tool
|