puppet 6.14.0-universal-darwin → 6.15.0-universal-darwin

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.

Files changed (195) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +15 -15
  3. data/ext/windows/service/daemon.rb +3 -3
  4. data/lib/puppet.rb +1 -1
  5. data/lib/puppet/agent.rb +2 -10
  6. data/lib/puppet/application/agent.rb +2 -1
  7. data/lib/puppet/application/filebucket.rb +5 -14
  8. data/lib/puppet/application/ssl.rb +2 -2
  9. data/lib/puppet/configurer.rb +7 -3
  10. data/lib/puppet/configurer/plugin_handler.rb +1 -1
  11. data/lib/puppet/defaults.rb +22 -2
  12. data/lib/puppet/environments.rb +4 -5
  13. data/lib/puppet/face/plugin.rb +1 -1
  14. data/lib/puppet/file_system/file_impl.rb +13 -9
  15. data/lib/puppet/forge/repository.rb +1 -1
  16. data/lib/puppet/functions/call.rb +1 -1
  17. data/lib/puppet/functions/reduce.rb +2 -4
  18. data/lib/puppet/http.rb +2 -0
  19. data/lib/puppet/http/client.rb +191 -52
  20. data/lib/puppet/http/external_client.rb +96 -0
  21. data/lib/puppet/http/redirector.rb +34 -0
  22. data/lib/puppet/http/resolver.rb +46 -3
  23. data/lib/puppet/http/resolver/server_list.rb +75 -15
  24. data/lib/puppet/http/resolver/settings.rb +22 -2
  25. data/lib/puppet/http/resolver/srv.rb +28 -2
  26. data/lib/puppet/http/response.rb +63 -1
  27. data/lib/puppet/http/retry_after_handler.rb +39 -0
  28. data/lib/puppet/http/service.rb +67 -1
  29. data/lib/puppet/http/service/ca.rb +71 -9
  30. data/lib/puppet/http/service/compiler.rb +213 -11
  31. data/lib/puppet/http/service/file_server.rb +105 -4
  32. data/lib/puppet/http/service/report.rb +36 -3
  33. data/lib/puppet/http/session.rb +59 -8
  34. data/lib/puppet/indirector/catalog/rest.rb +2 -1
  35. data/lib/puppet/indirector/facts/rest.rb +2 -1
  36. data/lib/puppet/indirector/file_bucket_file/rest.rb +48 -0
  37. data/lib/puppet/indirector/file_metadata/rest.rb +4 -2
  38. data/lib/puppet/indirector/node/rest.rb +2 -1
  39. data/lib/puppet/indirector/report/yaml.rb +23 -0
  40. data/lib/puppet/indirector/status/rest.rb +2 -1
  41. data/lib/puppet/metatype/manager.rb +80 -80
  42. data/lib/puppet/network/http/base_pool.rb +6 -1
  43. data/lib/puppet/network/http/pool.rb +2 -4
  44. data/lib/puppet/network/http_pool.rb +1 -0
  45. data/lib/puppet/node/environment.rb +11 -1
  46. data/lib/puppet/pal/pal_impl.rb +1 -29
  47. data/lib/puppet/parser/compiler.rb +14 -7
  48. data/lib/puppet/parser/functions.rb +18 -13
  49. data/lib/puppet/pops/loaders.rb +7 -5
  50. data/lib/puppet/provider/group/windows_adsi.rb +3 -3
  51. data/lib/puppet/provider/package/apt.rb +61 -1
  52. data/lib/puppet/provider/package/dnfmodule.rb +39 -12
  53. data/lib/puppet/provider/package/gem.rb +41 -7
  54. data/lib/puppet/provider/package/pacman.rb +2 -5
  55. data/lib/puppet/provider/package/pip.rb +105 -33
  56. data/lib/puppet/provider/package/pip3.rb +0 -2
  57. data/lib/puppet/provider/package/pkgdmg.rb +1 -1
  58. data/lib/puppet/provider/package/pkgng.rb +16 -4
  59. data/lib/puppet/provider/package/puppet_gem.rb +6 -2
  60. data/lib/puppet/provider/package/rpm.rb +6 -213
  61. data/lib/puppet/provider/package/yum.rb +92 -19
  62. data/lib/puppet/provider/service/systemd.rb +2 -1
  63. data/lib/puppet/reports/http.rb +13 -11
  64. data/lib/puppet/resource/type_collection.rb +20 -16
  65. data/lib/puppet/ssl.rb +1 -0
  66. data/lib/puppet/ssl/host.rb +4 -4
  67. data/lib/puppet/ssl/oids.rb +1 -0
  68. data/lib/puppet/ssl/state_machine.rb +50 -33
  69. data/lib/puppet/transaction/report.rb +2 -2
  70. data/lib/puppet/type.rb +6 -1
  71. data/lib/puppet/type/file/source.rb +4 -2
  72. data/lib/puppet/type/package.rb +25 -2
  73. data/lib/puppet/type/user.rb +0 -19
  74. data/lib/puppet/util/at_fork.rb +1 -1
  75. data/lib/puppet/util/autoload.rb +3 -0
  76. data/lib/puppet/util/instance_loader.rb +14 -10
  77. data/lib/puppet/util/package/version/debian.rb +175 -0
  78. data/lib/puppet/util/package/version/gem.rb +15 -0
  79. data/lib/puppet/util/package/version/pip.rb +167 -0
  80. data/lib/puppet/util/package/version/range.rb +50 -0
  81. data/lib/puppet/util/package/version/range/gt.rb +14 -0
  82. data/lib/puppet/util/package/version/range/gt_eq.rb +14 -0
  83. data/lib/puppet/util/package/version/range/lt.rb +14 -0
  84. data/lib/puppet/util/package/version/range/lt_eq.rb +14 -0
  85. data/lib/puppet/util/package/version/range/min_max.rb +21 -0
  86. data/lib/puppet/util/package/version/range/simple.rb +11 -0
  87. data/lib/puppet/util/package/version/rpm.rb +73 -0
  88. data/lib/puppet/util/pidlock.rb +13 -7
  89. data/lib/puppet/util/platform.rb +5 -0
  90. data/lib/puppet/util/rpm_compare.rb +193 -0
  91. data/lib/puppet/util/windows/adsi.rb +2 -2
  92. data/lib/puppet/util/windows/process.rb +15 -14
  93. data/lib/puppet/util/windows/security.rb +1 -0
  94. data/lib/puppet/util/windows/sid.rb +3 -3
  95. data/lib/puppet/version.rb +1 -1
  96. data/locales/puppet.pot +207 -201
  97. data/man/man5/puppet.conf.5 +11 -3
  98. data/man/man8/puppet-agent.8 +1 -1
  99. data/man/man8/puppet-apply.8 +1 -1
  100. data/man/man8/puppet-catalog.8 +1 -1
  101. data/man/man8/puppet-config.8 +1 -1
  102. data/man/man8/puppet-describe.8 +1 -1
  103. data/man/man8/puppet-device.8 +1 -1
  104. data/man/man8/puppet-doc.8 +1 -1
  105. data/man/man8/puppet-epp.8 +1 -1
  106. data/man/man8/puppet-facts.8 +1 -1
  107. data/man/man8/puppet-filebucket.8 +1 -1
  108. data/man/man8/puppet-generate.8 +1 -1
  109. data/man/man8/puppet-help.8 +1 -1
  110. data/man/man8/puppet-key.8 +1 -1
  111. data/man/man8/puppet-lookup.8 +1 -1
  112. data/man/man8/puppet-man.8 +1 -1
  113. data/man/man8/puppet-module.8 +1 -1
  114. data/man/man8/puppet-node.8 +1 -1
  115. data/man/man8/puppet-parser.8 +1 -1
  116. data/man/man8/puppet-plugin.8 +1 -1
  117. data/man/man8/puppet-report.8 +1 -1
  118. data/man/man8/puppet-resource.8 +1 -1
  119. data/man/man8/puppet-script.8 +1 -1
  120. data/man/man8/puppet-ssl.8 +1 -1
  121. data/man/man8/puppet-status.8 +1 -1
  122. data/man/man8/puppet.8 +2 -2
  123. data/spec/fixtures/ssl/unknown-127.0.0.1-key.pem +67 -0
  124. data/spec/fixtures/ssl/unknown-127.0.0.1.pem +48 -0
  125. data/spec/fixtures/ssl/unknown-ca-key.pem +67 -0
  126. data/spec/fixtures/ssl/unknown-ca.pem +59 -0
  127. data/spec/fixtures/unit/provider/package/dnfmodule/{dnf-module-list-installed.txt → dnf-module-list-enabled.txt} +2 -0
  128. data/spec/fixtures/unit/provider/package/pkgng/pkg.version +2 -0
  129. data/spec/fixtures/unit/provider/package/yum/yum-check-update-subscription-manager.txt +9 -0
  130. data/spec/fixtures/unit/provider/service/systemd/list_unit_files_services +9 -0
  131. data/spec/integration/application/agent_spec.rb +329 -0
  132. data/spec/integration/application/apply_spec.rb +132 -3
  133. data/spec/integration/application/filebucket_spec.rb +190 -0
  134. data/spec/integration/application/plugin_spec.rb +50 -0
  135. data/spec/integration/http/client_spec.rb +34 -40
  136. data/spec/integration/indirector/report/yaml.rb +83 -0
  137. data/spec/integration/module_tool/forge_spec.rb +2 -15
  138. data/spec/integration/network/http_pool_spec.rb +11 -19
  139. data/spec/integration/node/environment_spec.rb +15 -0
  140. data/spec/integration/util/windows/adsi_spec.rb +1 -1
  141. data/spec/lib/puppet/test_ca.rb +2 -2
  142. data/spec/lib/puppet_spec/https.rb +10 -7
  143. data/spec/lib/puppet_spec/puppetserver.rb +119 -0
  144. data/spec/shared_contexts/https.rb +29 -0
  145. data/spec/unit/agent_spec.rb +33 -25
  146. data/spec/unit/application/agent_spec.rb +5 -1
  147. data/spec/unit/application/device_spec.rb +2 -2
  148. data/spec/unit/application/filebucket_spec.rb +22 -2
  149. data/spec/unit/configurer_spec.rb +1 -1
  150. data/spec/unit/defaults_spec.rb +24 -1
  151. data/spec/unit/environments_spec.rb +8 -0
  152. data/spec/unit/file_system_spec.rb +10 -0
  153. data/spec/unit/http/client_spec.rb +105 -46
  154. data/spec/unit/http/external_client_spec.rb +201 -0
  155. data/spec/unit/http/resolver_spec.rb +20 -0
  156. data/spec/unit/http/service/ca_spec.rb +25 -2
  157. data/spec/unit/http/service/compiler_spec.rb +184 -6
  158. data/spec/unit/http/service/file_server_spec.rb +35 -3
  159. data/spec/unit/http/service/report_spec.rb +3 -1
  160. data/spec/unit/http/service_spec.rb +3 -3
  161. data/spec/unit/http/session_spec.rb +56 -7
  162. data/spec/unit/indirector/file_bucket_file/rest_spec.rb +82 -2
  163. data/spec/unit/network/http/pool_spec.rb +3 -3
  164. data/spec/unit/node/environment_spec.rb +16 -0
  165. data/spec/unit/provider/group/windows_adsi_spec.rb +43 -10
  166. data/spec/unit/provider/package/apt_spec.rb +30 -0
  167. data/spec/unit/provider/package/dnfmodule_spec.rb +33 -14
  168. data/spec/unit/provider/package/gem_spec.rb +40 -0
  169. data/spec/unit/provider/package/pacman_spec.rb +6 -21
  170. data/spec/unit/provider/package/pip_spec.rb +26 -3
  171. data/spec/unit/provider/package/pkgdmg_spec.rb +1 -1
  172. data/spec/unit/provider/package/pkgng_spec.rb +38 -0
  173. data/spec/unit/provider/package/puppet_gem_spec.rb +8 -0
  174. data/spec/unit/provider/package/rpm_spec.rb +0 -212
  175. data/spec/unit/provider/package/yum_spec.rb +235 -1
  176. data/spec/unit/provider/service/systemd_spec.rb +10 -1
  177. data/spec/unit/provider/user/windows_adsi_spec.rb +3 -3
  178. data/spec/unit/puppet_pal_2pec.rb +0 -29
  179. data/spec/unit/reports/http_spec.rb +70 -52
  180. data/spec/unit/ssl/host_spec.rb +4 -2
  181. data/spec/unit/ssl/oids_spec.rb +1 -0
  182. data/spec/unit/ssl/state_machine_spec.rb +38 -6
  183. data/spec/unit/transaction/report_spec.rb +4 -0
  184. data/spec/unit/util/at_fork_spec.rb +2 -2
  185. data/spec/unit/util/package/version/debian_spec.rb +83 -0
  186. data/spec/unit/util/package/version/pip_spec.rb +464 -0
  187. data/spec/unit/util/package/version/range_spec.rb +154 -0
  188. data/spec/unit/util/package/version/rpm_spec.rb +121 -0
  189. data/spec/unit/util/pidlock_spec.rb +83 -47
  190. data/spec/unit/util/rpm_compare_spec.rb +196 -0
  191. data/spec/unit/util/windows/adsi_spec.rb +4 -4
  192. data/spec/unit/util/windows/sid_spec.rb +2 -2
  193. data/tasks/generate_cert_fixtures.rake +15 -1
  194. metadata +51 -6
  195. data/spec/integration/faces/plugin_spec.rb +0 -63
@@ -0,0 +1,196 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+ require 'puppet/util/rpm_compare'
5
+
6
+ describe Puppet::Util::RpmCompare do
7
+ class RpmTest
8
+ extend Puppet::Util::RpmCompare
9
+ end
10
+
11
+ describe '.rpmvercmp' do
12
+ # test cases munged directly from rpm's own
13
+ # tests/rpmvercmp.at
14
+ it { expect(RpmTest.rpmvercmp('1.0', '1.0')).to eq(0) }
15
+ it { expect(RpmTest.rpmvercmp('1.0', '2.0')).to eq(-1) }
16
+ it { expect(RpmTest.rpmvercmp('2.0', '1.0')).to eq(1) }
17
+ it { expect(RpmTest.rpmvercmp('2.0.1', '2.0.1')).to eq(0) }
18
+ it { expect(RpmTest.rpmvercmp('2.0', '2.0.1')).to eq(-1) }
19
+ it { expect(RpmTest.rpmvercmp('2.0.1', '2.0')).to eq(1) }
20
+ it { expect(RpmTest.rpmvercmp('2.0.1a', '2.0.1a')).to eq(0) }
21
+ it { expect(RpmTest.rpmvercmp('2.0.1a', '2.0.1')).to eq(1) }
22
+ it { expect(RpmTest.rpmvercmp('2.0.1', '2.0.1a')).to eq(-1) }
23
+ it { expect(RpmTest.rpmvercmp('5.5p1', '5.5p1')).to eq(0) }
24
+ it { expect(RpmTest.rpmvercmp('5.5p1', '5.5p2')).to eq(-1) }
25
+ it { expect(RpmTest.rpmvercmp('5.5p2', '5.5p1')).to eq(1) }
26
+ it { expect(RpmTest.rpmvercmp('5.5p10', '5.5p10')).to eq(0) }
27
+ it { expect(RpmTest.rpmvercmp('5.5p1', '5.5p10')).to eq(-1) }
28
+ it { expect(RpmTest.rpmvercmp('5.5p10', '5.5p1')).to eq(1) }
29
+ it { expect(RpmTest.rpmvercmp('10xyz', '10.1xyz')).to eq(-1) }
30
+ it { expect(RpmTest.rpmvercmp('10.1xyz', '10xyz')).to eq(1) }
31
+ it { expect(RpmTest.rpmvercmp('xyz10', 'xyz10')).to eq(0) }
32
+ it { expect(RpmTest.rpmvercmp('xyz10', 'xyz10.1')).to eq(-1) }
33
+ it { expect(RpmTest.rpmvercmp('xyz10.1', 'xyz10')).to eq(1) }
34
+ it { expect(RpmTest.rpmvercmp('xyz.4', 'xyz.4')).to eq(0) }
35
+ it { expect(RpmTest.rpmvercmp('xyz.4', '8')).to eq(-1) }
36
+ it { expect(RpmTest.rpmvercmp('8', 'xyz.4')).to eq(1) }
37
+ it { expect(RpmTest.rpmvercmp('xyz.4', '2')).to eq(-1) }
38
+ it { expect(RpmTest.rpmvercmp('2', 'xyz.4')).to eq(1) }
39
+ it { expect(RpmTest.rpmvercmp('5.5p2', '5.6p1')).to eq(-1) }
40
+ it { expect(RpmTest.rpmvercmp('5.6p1', '5.5p2')).to eq(1) }
41
+ it { expect(RpmTest.rpmvercmp('5.6p1', '6.5p1')).to eq(-1) }
42
+ it { expect(RpmTest.rpmvercmp('6.5p1', '5.6p1')).to eq(1) }
43
+ it { expect(RpmTest.rpmvercmp('6.0.rc1', '6.0')).to eq(1) }
44
+ it { expect(RpmTest.rpmvercmp('6.0', '6.0.rc1')).to eq(-1) }
45
+ it { expect(RpmTest.rpmvercmp('10b2', '10a1')).to eq(1) }
46
+ it { expect(RpmTest.rpmvercmp('10a2', '10b2')).to eq(-1) }
47
+ it { expect(RpmTest.rpmvercmp('1.0aa', '1.0aa')).to eq(0) }
48
+ it { expect(RpmTest.rpmvercmp('1.0a', '1.0aa')).to eq(-1) }
49
+ it { expect(RpmTest.rpmvercmp('1.0aa', '1.0a')).to eq(1) }
50
+ it { expect(RpmTest.rpmvercmp('10.0001', '10.0001')).to eq(0) }
51
+ it { expect(RpmTest.rpmvercmp('10.0001', '10.1')).to eq(0) }
52
+ it { expect(RpmTest.rpmvercmp('10.1', '10.0001')).to eq(0) }
53
+ it { expect(RpmTest.rpmvercmp('10.0001', '10.0039')).to eq(-1) }
54
+ it { expect(RpmTest.rpmvercmp('10.0039', '10.0001')).to eq(1) }
55
+ it { expect(RpmTest.rpmvercmp('4.999.9', '5.0')).to eq(-1) }
56
+ it { expect(RpmTest.rpmvercmp('5.0', '4.999.9')).to eq(1) }
57
+ it { expect(RpmTest.rpmvercmp('20101121', '20101121')).to eq(0) }
58
+ it { expect(RpmTest.rpmvercmp('20101121', '20101122')).to eq(-1) }
59
+ it { expect(RpmTest.rpmvercmp('20101122', '20101121')).to eq(1) }
60
+ it { expect(RpmTest.rpmvercmp('2_0', '2_0')).to eq(0) }
61
+ it { expect(RpmTest.rpmvercmp('2.0', '2_0')).to eq(0) }
62
+ it { expect(RpmTest.rpmvercmp('2_0', '2.0')).to eq(0) }
63
+ it { expect(RpmTest.rpmvercmp('a', 'a')).to eq(0) }
64
+ it { expect(RpmTest.rpmvercmp('a+', 'a+')).to eq(0) }
65
+ it { expect(RpmTest.rpmvercmp('a+', 'a_')).to eq(0) }
66
+ it { expect(RpmTest.rpmvercmp('a_', 'a+')).to eq(0) }
67
+ it { expect(RpmTest.rpmvercmp('+a', '+a')).to eq(0) }
68
+ it { expect(RpmTest.rpmvercmp('+a', '_a')).to eq(0) }
69
+ it { expect(RpmTest.rpmvercmp('_a', '+a')).to eq(0) }
70
+ it { expect(RpmTest.rpmvercmp('+_', '+_')).to eq(0) }
71
+ it { expect(RpmTest.rpmvercmp('_+', '+_')).to eq(0) }
72
+ it { expect(RpmTest.rpmvercmp('_+', '_+')).to eq(0) }
73
+ it { expect(RpmTest.rpmvercmp('+', '_')).to eq(0) }
74
+ it { expect(RpmTest.rpmvercmp('_', '+')).to eq(0) }
75
+ it { expect(RpmTest.rpmvercmp('1.0~rc1', '1.0~rc1')).to eq(0) }
76
+ it { expect(RpmTest.rpmvercmp('1.0~rc1', '1.0')).to eq(-1) }
77
+ it { expect(RpmTest.rpmvercmp('1.0', '1.0~rc1')).to eq(1) }
78
+ it { expect(RpmTest.rpmvercmp('1.0~rc1', '1.0~rc2')).to eq(-1) }
79
+ it { expect(RpmTest.rpmvercmp('1.0~rc2', '1.0~rc1')).to eq(1) }
80
+ it { expect(RpmTest.rpmvercmp('1.0~rc1~git123', '1.0~rc1~git123')).to eq(0) }
81
+ it { expect(RpmTest.rpmvercmp('1.0~rc1~git123', '1.0~rc1')).to eq(-1) }
82
+ it { expect(RpmTest.rpmvercmp('1.0~rc1', '1.0~rc1~git123')).to eq(1) }
83
+ it { expect(RpmTest.rpmvercmp('1.0~rc1', '1.0arc1')).to eq(-1) }
84
+ it { expect(RpmTest.rpmvercmp('', '~')).to eq(1) }
85
+ it { expect(RpmTest.rpmvercmp('~', '~~')).to eq(1) }
86
+ it { expect(RpmTest.rpmvercmp('~', '~+~')).to eq(1) }
87
+ it { expect(RpmTest.rpmvercmp('~', '~a')).to eq(-1) }
88
+
89
+ # non-upstream test cases
90
+ it { expect(RpmTest.rpmvercmp('405', '406')).to eq(-1) }
91
+ it { expect(RpmTest.rpmvercmp('1', '0')).to eq(1) }
92
+ end
93
+
94
+ describe '.rpm_compareEVR' do
95
+ it 'evaluates identical version-release as equal' do
96
+ expect(RpmTest.rpm_compareEVR('1.2.3-1.el5', '1.2.3-1.el5')).to eq(0)
97
+ end
98
+
99
+ it 'evaluates identical version as equal' do
100
+ expect(RpmTest.rpm_compareEVR('1.2.3', '1.2.3')).to eq(0)
101
+ end
102
+
103
+ it 'evaluates identical version but older release as less' do
104
+ expect(RpmTest.rpm_compareEVR('1.2.3-1.el5', '1.2.3-2.el5')).to eq(-1)
105
+ end
106
+
107
+ it 'evaluates identical version but newer release as greater' do
108
+ expect(RpmTest.rpm_compareEVR('1.2.3-3.el5', '1.2.3-2.el5')).to eq(1)
109
+ end
110
+
111
+ it 'evaluates a newer epoch as greater' do
112
+ expect(RpmTest.rpm_compareEVR('1:1.2.3-4.5', '1.2.3-4.5')).to eq(1)
113
+ end
114
+
115
+ # these tests describe PUP-1244 logic yet to be implemented
116
+ it 'evaluates any version as equal to the same version followed by release' do
117
+ expect(RpmTest.rpm_compareEVR('1.2.3', '1.2.3-2.el5')).to eq(0)
118
+ end
119
+
120
+ # test cases for PUP-682
121
+ it 'evaluates same-length numeric revisions numerically' do
122
+ expect(RpmTest.rpm_compareEVR('2.2-405', '2.2-406')).to eq(-1)
123
+ end
124
+ end
125
+
126
+ describe '.rpm_parse_evr' do
127
+ it 'parses full simple evr' do
128
+ version = RpmTest.rpm_parse_evr('0:1.2.3-4.el5')
129
+ expect([version[:epoch], version[:version], version[:release]]).to \
130
+ eq(['0', '1.2.3', '4.el5'])
131
+ end
132
+
133
+ it 'parses version only' do
134
+ version = RpmTest.rpm_parse_evr('1.2.3')
135
+ expect([version[:epoch], version[:version], version[:release]]).to \
136
+ eq([nil, '1.2.3', nil])
137
+ end
138
+
139
+ it 'parses version-release' do
140
+ version = RpmTest.rpm_parse_evr('1.2.3-4.5.el6')
141
+ expect([version[:epoch], version[:version], version[:release]]).to \
142
+ eq([nil, '1.2.3', '4.5.el6'])
143
+ end
144
+
145
+ it 'parses release with git hash' do
146
+ version = RpmTest.rpm_parse_evr('1.2.3-4.1234aefd')
147
+ expect([version[:epoch], version[:version], version[:release]]).to \
148
+ eq([nil, '1.2.3', '4.1234aefd'])
149
+ end
150
+
151
+ it 'parses single integer versions' do
152
+ version = RpmTest.rpm_parse_evr('12345')
153
+ expect([version[:epoch], version[:version], version[:release]]).to \
154
+ eq([nil, '12345', nil])
155
+ end
156
+
157
+ it 'parses text in the epoch to 0' do
158
+ version = RpmTest.rpm_parse_evr('foo0:1.2.3-4')
159
+ expect([version[:epoch], version[:version], version[:release]]).to \
160
+ eq([nil, '1.2.3', '4'])
161
+ end
162
+
163
+ it 'parses revisions with text' do
164
+ version = RpmTest.rpm_parse_evr('1.2.3-SNAPSHOT20140107')
165
+ expect([version[:epoch], version[:version], version[:release]]).to \
166
+ eq([nil, '1.2.3', 'SNAPSHOT20140107'])
167
+ end
168
+
169
+ # test cases for PUP-682
170
+ it 'parses revisions with text and numbers' do
171
+ version = RpmTest.rpm_parse_evr('2.2-SNAPSHOT20121119105647')
172
+ expect([version[:epoch], version[:version], version[:release]]).to \
173
+ eq([nil, '2.2', 'SNAPSHOT20121119105647'])
174
+ end
175
+ end
176
+
177
+ describe '.compare_values' do
178
+ it 'treats two nil values as equal' do
179
+ expect(RpmTest.compare_values(nil, nil)).to eq(0)
180
+ end
181
+
182
+ it 'treats a nil value as less than a non-nil value' do
183
+ expect(RpmTest.compare_values(nil, '0')).to eq(-1)
184
+ end
185
+
186
+ it 'treats a non-nil value as greater than a nil value' do
187
+ expect(RpmTest.compare_values('0', nil)).to eq(1)
188
+ end
189
+
190
+ it 'passes two non-nil values on to rpmvercmp' do
191
+ allow(RpmTest).to receive(:rpmvercmp).and_return(0)
192
+ expect(RpmTest).to receive(:rpmvercmp).with('s1', 's2')
193
+ RpmTest.compare_values('s1', 's2')
194
+ end
195
+ end
196
+ end
@@ -466,8 +466,8 @@ describe Puppet::Util::Windows::ADSI, :if => Puppet::Util::Platform.windows? do
466
466
  expect(Puppet::Util::Windows::SID).to receive(:octet_string_to_principal).with([0]).and_return(sids[0])
467
467
  expect(Puppet::Util::Windows::SID).to receive(:octet_string_to_principal).with([1]).and_return(sids[1])
468
468
 
469
- expect(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('user2').and_return(sids[1])
470
- expect(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('DOMAIN2\user3').and_return(sids[2])
469
+ expect(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('user2', false).and_return(sids[1])
470
+ expect(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('DOMAIN2\user3', false).and_return(sids[2])
471
471
 
472
472
  expect(Puppet::Util::Windows::ADSI).to receive(:sid_uri).with(sids[0]).and_return("WinNT://DOMAIN/user1,user")
473
473
  expect(Puppet::Util::Windows::ADSI).to receive(:sid_uri).with(sids[2]).and_return("WinNT://DOMAIN2/user3,user")
@@ -493,8 +493,8 @@ describe Puppet::Util::Windows::ADSI, :if => Puppet::Util::Platform.windows? do
493
493
  expect(Puppet::Util::Windows::SID).to receive(:octet_string_to_principal).with([0]).and_return(sids[0])
494
494
  expect(Puppet::Util::Windows::SID).to receive(:octet_string_to_principal).with([1]).and_return(sids[1])
495
495
 
496
- expect(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('user2').and_return(sids[1])
497
- expect(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('DOMAIN2\user3').and_return(sids[2])
496
+ expect(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('user2', any_args).and_return(sids[1])
497
+ expect(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('DOMAIN2\user3', any_args).and_return(sids[2])
498
498
 
499
499
  expect(Puppet::Util::Windows::ADSI).to receive(:sid_uri).with(sids[2]).and_return("WinNT://DOMAIN2/user3,user")
500
500
 
@@ -201,9 +201,9 @@ describe "Puppet::Util::Windows::SID", :if => Puppet::Util::Platform.windows? do
201
201
  principal = subject.ads_to_principal(unresolvable_user)
202
202
 
203
203
  expect(principal).to be_an_instance_of(Puppet::Util::Windows::SID::Principal)
204
- expect(principal.account).to eq('S-1-1-1 (unresolvable)')
204
+ expect(principal.account).to eq('S-1-1-1')
205
205
  expect(principal.domain).to eq(nil)
206
- expect(principal.domain_account).to eq('S-1-1-1 (unresolvable)')
206
+ expect(principal.domain_account).to eq('S-1-1-1')
207
207
  expect(principal.sid).to eq('S-1-1-1')
208
208
  expect(principal.sid_bytes).to eq(valid_octet_invalid_user)
209
209
  expect(principal.account_type).to eq(:SidTypeUnknown)
@@ -49,6 +49,10 @@ task(:gen_cert_fixtures) do
49
49
  #
50
50
  # bad-basic-constraints.pem /CN=Test CA (bad isCA constraint)
51
51
  #
52
+ # unknown-ca.pemm /CN=Unknown CA
53
+ # |
54
+ # unknown-127.0.0.1.pem +- /CN=127.0.0.1
55
+ #
52
56
  # Keys
53
57
  # ====
54
58
  #
@@ -61,10 +65,20 @@ task(:gen_cert_fixtures) do
61
65
  # `request.pem` contains a valid CSR for /CN=pending, while `tampered_csr.pem`
62
66
  # is the same as `request.pem`, but it's public key has been replaced.
63
67
  #
64
- ca = Puppet::TestCa.new
65
68
  dir = File.join(RAKE_ROOT, 'spec/fixtures/ssl')
66
69
 
70
+ # Create self-signed CA & key
71
+ unknown_ca = Puppet::TestCa.new('Unknown CA')
72
+ save(dir, 'unknown-ca.pem', unknown_ca.ca_cert)
73
+ save(dir, 'unknown-ca-key.pem', unknown_ca.key)
74
+
75
+ # Create an SSL cert for 127.0.0.1
76
+ signed = unknown_ca.create_cert('127.0.0.1', unknown_ca.ca_cert, unknown_ca.key, subject_alt_names: 'DNS:127.0.0.1,DNS:127.0.0.2')
77
+ save(dir, 'unknown-127.0.0.1.pem', signed[:cert])
78
+ save(dir, 'unknown-127.0.0.1-key.pem', signed[:private_key])
79
+
67
80
  # Create Test CA & CRL
81
+ ca = Puppet::TestCa.new
68
82
  save(dir, 'ca.pem', ca.ca_cert)
69
83
  save(dir, 'crl.pem', ca.ca_crl)
70
84
 
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: 6.14.0
4
+ version: 6.15.0
5
5
  platform: universal-darwin
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-07 00:00:00.000000000 Z
11
+ date: 2020-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facter
@@ -575,6 +575,7 @@ files:
575
575
  - lib/puppet/http.rb
576
576
  - lib/puppet/http/client.rb
577
577
  - lib/puppet/http/errors.rb
578
+ - lib/puppet/http/external_client.rb
578
579
  - lib/puppet/http/redirector.rb
579
580
  - lib/puppet/http/resolver.rb
580
581
  - lib/puppet/http/resolver/server_list.rb
@@ -1287,6 +1288,17 @@ files:
1287
1288
  - lib/puppet/util/network_device/transport.rb
1288
1289
  - lib/puppet/util/network_device/transport/base.rb
1289
1290
  - lib/puppet/util/package.rb
1291
+ - lib/puppet/util/package/version/debian.rb
1292
+ - lib/puppet/util/package/version/gem.rb
1293
+ - lib/puppet/util/package/version/pip.rb
1294
+ - lib/puppet/util/package/version/range.rb
1295
+ - lib/puppet/util/package/version/range/gt.rb
1296
+ - lib/puppet/util/package/version/range/gt_eq.rb
1297
+ - lib/puppet/util/package/version/range/lt.rb
1298
+ - lib/puppet/util/package/version/range/lt_eq.rb
1299
+ - lib/puppet/util/package/version/range/min_max.rb
1300
+ - lib/puppet/util/package/version/range/simple.rb
1301
+ - lib/puppet/util/package/version/rpm.rb
1290
1302
  - lib/puppet/util/pidlock.rb
1291
1303
  - lib/puppet/util/platform.rb
1292
1304
  - lib/puppet/util/plist.rb
@@ -1309,6 +1321,7 @@ files:
1309
1321
  - lib/puppet/util/reference.rb
1310
1322
  - lib/puppet/util/resource_template.rb
1311
1323
  - lib/puppet/util/retry_action.rb
1324
+ - lib/puppet/util/rpm_compare.rb
1312
1325
  - lib/puppet/util/rubygems.rb
1313
1326
  - lib/puppet/util/run_mode.rb
1314
1327
  - lib/puppet/util/selinux.rb
@@ -1451,6 +1464,10 @@ files:
1451
1464
  - spec/fixtures/ssl/signed.pem
1452
1465
  - spec/fixtures/ssl/tampered-cert.pem
1453
1466
  - spec/fixtures/ssl/tampered-csr.pem
1467
+ - spec/fixtures/ssl/unknown-127.0.0.1-key.pem
1468
+ - spec/fixtures/ssl/unknown-127.0.0.1.pem
1469
+ - spec/fixtures/ssl/unknown-ca-key.pem
1470
+ - spec/fixtures/ssl/unknown-ca.pem
1454
1471
  - spec/fixtures/stdlib.tgz
1455
1472
  - spec/fixtures/unit/application/environments/production/data/common.yaml
1456
1473
  - spec/fixtures/unit/application/environments/production/environment.conf
@@ -1720,7 +1737,7 @@ files:
1720
1737
  - spec/fixtures/unit/provider/cron/crontab/vixie_header.txt
1721
1738
  - spec/fixtures/unit/provider/cron/parsed/managed
1722
1739
  - spec/fixtures/unit/provider/cron/parsed/simple
1723
- - spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-installed.txt
1740
+ - spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-enabled.txt
1724
1741
  - spec/fixtures/unit/provider/package/gem/gem-list-single-package
1725
1742
  - spec/fixtures/unit/provider/package/gem/line-with-1.8.5-warning
1726
1743
  - spec/fixtures/unit/provider/package/openbsd/pkginfo.detail
@@ -1748,6 +1765,7 @@ files:
1748
1765
  - spec/fixtures/unit/provider/package/yum/yum-check-update-plugin-output.txt
1749
1766
  - spec/fixtures/unit/provider/package/yum/yum-check-update-security.txt
1750
1767
  - spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt
1768
+ - spec/fixtures/unit/provider/package/yum/yum-check-update-subscription-manager.txt
1751
1769
  - spec/fixtures/unit/provider/package/zypper/zypper-list-updates-SLES11sp1.out
1752
1770
  - spec/fixtures/unit/provider/package/zypper/zypper-list-updates-empty.out
1753
1771
  - spec/fixtures/unit/provider/parsedfile/aliases.txt
@@ -1782,9 +1800,12 @@ files:
1782
1800
  - spec/fixtures/yaml/report2.6.x.yaml
1783
1801
  - spec/fixtures/yaml/test.local.yaml
1784
1802
  - spec/integration/agent/logging_spec.rb
1803
+ - spec/integration/application/agent_spec.rb
1785
1804
  - spec/integration/application/apply_spec.rb
1786
1805
  - spec/integration/application/doc_spec.rb
1806
+ - spec/integration/application/filebucket_spec.rb
1787
1807
  - spec/integration/application/lookup_spec.rb
1808
+ - spec/integration/application/plugin_spec.rb
1788
1809
  - spec/integration/configurer_spec.rb
1789
1810
  - spec/integration/data_binding_spec.rb
1790
1811
  - spec/integration/defaults_spec.rb
@@ -1795,7 +1816,6 @@ files:
1795
1816
  - spec/integration/environments/settings_spec.rb
1796
1817
  - spec/integration/faces/config_spec.rb
1797
1818
  - spec/integration/faces/documentation_spec.rb
1798
- - spec/integration/faces/plugin_spec.rb
1799
1819
  - spec/integration/file_bucket/file_spec.rb
1800
1820
  - spec/integration/file_serving/content_spec.rb
1801
1821
  - spec/integration/file_serving/fileset_spec.rb
@@ -1808,6 +1828,7 @@ files:
1808
1828
  - spec/integration/indirector/facts/facter_spec.rb
1809
1829
  - spec/integration/indirector/file_content/file_server_spec.rb
1810
1830
  - spec/integration/indirector/file_metadata/file_server_spec.rb
1831
+ - spec/integration/indirector/report/yaml.rb
1811
1832
  - spec/integration/module_tool/forge_spec.rb
1812
1833
  - spec/integration/module_tool/tar/mini_spec.rb
1813
1834
  - spec/integration/network/authconfig_spec.rb
@@ -1896,6 +1917,7 @@ files:
1896
1917
  - spec/lib/puppet_spec/modules.rb
1897
1918
  - spec/lib/puppet_spec/network.rb
1898
1919
  - spec/lib/puppet_spec/pops.rb
1920
+ - spec/lib/puppet_spec/puppetserver.rb
1899
1921
  - spec/lib/puppet_spec/scope.rb
1900
1922
  - spec/lib/puppet_spec/settings.rb
1901
1923
  - spec/lib/puppet_spec/ssl.rb
@@ -1915,6 +1937,7 @@ files:
1915
1937
  - spec/shared_behaviours/things_that_declare_options.rb
1916
1938
  - spec/shared_contexts/checksum.rb
1917
1939
  - spec/shared_contexts/digests.rb
1940
+ - spec/shared_contexts/https.rb
1918
1941
  - spec/shared_contexts/types_setup.rb
1919
1942
  - spec/shared_examples/rhel_package_provider.rb
1920
1943
  - spec/spec_helper.rb
@@ -2092,6 +2115,7 @@ files:
2092
2115
  - spec/unit/hiera/scope_spec.rb
2093
2116
  - spec/unit/hiera_puppet_spec.rb
2094
2117
  - spec/unit/http/client_spec.rb
2118
+ - spec/unit/http/external_client_spec.rb
2095
2119
  - spec/unit/http/resolver_spec.rb
2096
2120
  - spec/unit/http/response_spec.rb
2097
2121
  - spec/unit/http/service/ca_spec.rb
@@ -2568,6 +2592,10 @@ files:
2568
2592
  - spec/unit/util/network_device/config_spec.rb
2569
2593
  - spec/unit/util/network_device/transport/base_spec.rb
2570
2594
  - spec/unit/util/network_device_spec.rb
2595
+ - spec/unit/util/package/version/debian_spec.rb
2596
+ - spec/unit/util/package/version/pip_spec.rb
2597
+ - spec/unit/util/package/version/range_spec.rb
2598
+ - spec/unit/util/package/version/rpm_spec.rb
2571
2599
  - spec/unit/util/package_spec.rb
2572
2600
  - spec/unit/util/pidlock_spec.rb
2573
2601
  - spec/unit/util/plist_spec.rb
@@ -2582,6 +2610,7 @@ files:
2582
2610
  - spec/unit/util/reference_spec.rb
2583
2611
  - spec/unit/util/resource_template_spec.rb
2584
2612
  - spec/unit/util/retry_action_spec.rb
2613
+ - spec/unit/util/rpm_compare_spec.rb
2585
2614
  - spec/unit/util/rubygems_spec.rb
2586
2615
  - spec/unit/util/run_mode_spec.rb
2587
2616
  - spec/unit/util/selinux_spec.rb
@@ -2710,6 +2739,10 @@ test_files:
2710
2739
  - spec/fixtures/ssl/signed.pem
2711
2740
  - spec/fixtures/ssl/tampered-cert.pem
2712
2741
  - spec/fixtures/ssl/tampered-csr.pem
2742
+ - spec/fixtures/ssl/unknown-127.0.0.1-key.pem
2743
+ - spec/fixtures/ssl/unknown-127.0.0.1.pem
2744
+ - spec/fixtures/ssl/unknown-ca-key.pem
2745
+ - spec/fixtures/ssl/unknown-ca.pem
2713
2746
  - spec/fixtures/stdlib.tgz
2714
2747
  - spec/fixtures/unit/application/environments/production/data/common.yaml
2715
2748
  - spec/fixtures/unit/application/environments/production/environment.conf
@@ -2979,7 +3012,7 @@ test_files:
2979
3012
  - spec/fixtures/unit/provider/cron/crontab/vixie_header.txt
2980
3013
  - spec/fixtures/unit/provider/cron/parsed/managed
2981
3014
  - spec/fixtures/unit/provider/cron/parsed/simple
2982
- - spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-installed.txt
3015
+ - spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-enabled.txt
2983
3016
  - spec/fixtures/unit/provider/package/gem/gem-list-single-package
2984
3017
  - spec/fixtures/unit/provider/package/gem/line-with-1.8.5-warning
2985
3018
  - spec/fixtures/unit/provider/package/openbsd/pkginfo.detail
@@ -3007,6 +3040,7 @@ test_files:
3007
3040
  - spec/fixtures/unit/provider/package/yum/yum-check-update-plugin-output.txt
3008
3041
  - spec/fixtures/unit/provider/package/yum/yum-check-update-security.txt
3009
3042
  - spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt
3043
+ - spec/fixtures/unit/provider/package/yum/yum-check-update-subscription-manager.txt
3010
3044
  - spec/fixtures/unit/provider/package/zypper/zypper-list-updates-SLES11sp1.out
3011
3045
  - spec/fixtures/unit/provider/package/zypper/zypper-list-updates-empty.out
3012
3046
  - spec/fixtures/unit/provider/parsedfile/aliases.txt
@@ -3041,9 +3075,12 @@ test_files:
3041
3075
  - spec/fixtures/yaml/report2.6.x.yaml
3042
3076
  - spec/fixtures/yaml/test.local.yaml
3043
3077
  - spec/integration/agent/logging_spec.rb
3078
+ - spec/integration/application/agent_spec.rb
3044
3079
  - spec/integration/application/apply_spec.rb
3045
3080
  - spec/integration/application/doc_spec.rb
3081
+ - spec/integration/application/filebucket_spec.rb
3046
3082
  - spec/integration/application/lookup_spec.rb
3083
+ - spec/integration/application/plugin_spec.rb
3047
3084
  - spec/integration/configurer_spec.rb
3048
3085
  - spec/integration/data_binding_spec.rb
3049
3086
  - spec/integration/defaults_spec.rb
@@ -3054,7 +3091,6 @@ test_files:
3054
3091
  - spec/integration/environments/settings_spec.rb
3055
3092
  - spec/integration/faces/config_spec.rb
3056
3093
  - spec/integration/faces/documentation_spec.rb
3057
- - spec/integration/faces/plugin_spec.rb
3058
3094
  - spec/integration/file_bucket/file_spec.rb
3059
3095
  - spec/integration/file_serving/content_spec.rb
3060
3096
  - spec/integration/file_serving/fileset_spec.rb
@@ -3067,6 +3103,7 @@ test_files:
3067
3103
  - spec/integration/indirector/facts/facter_spec.rb
3068
3104
  - spec/integration/indirector/file_content/file_server_spec.rb
3069
3105
  - spec/integration/indirector/file_metadata/file_server_spec.rb
3106
+ - spec/integration/indirector/report/yaml.rb
3070
3107
  - spec/integration/module_tool/forge_spec.rb
3071
3108
  - spec/integration/module_tool/tar/mini_spec.rb
3072
3109
  - spec/integration/network/authconfig_spec.rb
@@ -3155,6 +3192,7 @@ test_files:
3155
3192
  - spec/lib/puppet_spec/modules.rb
3156
3193
  - spec/lib/puppet_spec/network.rb
3157
3194
  - spec/lib/puppet_spec/pops.rb
3195
+ - spec/lib/puppet_spec/puppetserver.rb
3158
3196
  - spec/lib/puppet_spec/scope.rb
3159
3197
  - spec/lib/puppet_spec/settings.rb
3160
3198
  - spec/lib/puppet_spec/ssl.rb
@@ -3174,6 +3212,7 @@ test_files:
3174
3212
  - spec/shared_behaviours/things_that_declare_options.rb
3175
3213
  - spec/shared_contexts/checksum.rb
3176
3214
  - spec/shared_contexts/digests.rb
3215
+ - spec/shared_contexts/https.rb
3177
3216
  - spec/shared_contexts/types_setup.rb
3178
3217
  - spec/shared_examples/rhel_package_provider.rb
3179
3218
  - spec/spec_helper.rb
@@ -3351,6 +3390,7 @@ test_files:
3351
3390
  - spec/unit/hiera/scope_spec.rb
3352
3391
  - spec/unit/hiera_puppet_spec.rb
3353
3392
  - spec/unit/http/client_spec.rb
3393
+ - spec/unit/http/external_client_spec.rb
3354
3394
  - spec/unit/http/resolver_spec.rb
3355
3395
  - spec/unit/http/response_spec.rb
3356
3396
  - spec/unit/http/service/ca_spec.rb
@@ -3827,6 +3867,10 @@ test_files:
3827
3867
  - spec/unit/util/network_device/config_spec.rb
3828
3868
  - spec/unit/util/network_device/transport/base_spec.rb
3829
3869
  - spec/unit/util/network_device_spec.rb
3870
+ - spec/unit/util/package/version/debian_spec.rb
3871
+ - spec/unit/util/package/version/pip_spec.rb
3872
+ - spec/unit/util/package/version/range_spec.rb
3873
+ - spec/unit/util/package/version/rpm_spec.rb
3830
3874
  - spec/unit/util/package_spec.rb
3831
3875
  - spec/unit/util/pidlock_spec.rb
3832
3876
  - spec/unit/util/plist_spec.rb
@@ -3841,6 +3885,7 @@ test_files:
3841
3885
  - spec/unit/util/reference_spec.rb
3842
3886
  - spec/unit/util/resource_template_spec.rb
3843
3887
  - spec/unit/util/retry_action_spec.rb
3888
+ - spec/unit/util/rpm_compare_spec.rb
3844
3889
  - spec/unit/util/rubygems_spec.rb
3845
3890
  - spec/unit/util/run_mode_spec.rb
3846
3891
  - spec/unit/util/selinux_spec.rb