puppet 6.19.1-x64-mingw32 → 6.23.0-x64-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.

Files changed (293) hide show
  1. checksums.yaml +4 -4
  2. data/CODEOWNERS +2 -16
  3. data/Gemfile +3 -1
  4. data/Gemfile.lock +51 -40
  5. data/ext/osx/puppet.plist +2 -0
  6. data/ext/project_data.yaml +2 -2
  7. data/lib/puppet/application.rb +10 -6
  8. data/lib/puppet/application/agent.rb +12 -4
  9. data/lib/puppet/application/apply.rb +4 -2
  10. data/lib/puppet/application/device.rb +2 -0
  11. data/lib/puppet/application/filebucket.rb +2 -2
  12. data/lib/puppet/application/resource.rb +2 -1
  13. data/lib/puppet/application/script.rb +2 -0
  14. data/lib/puppet/application/ssl.rb +11 -0
  15. data/lib/puppet/application_support.rb +7 -0
  16. data/lib/puppet/configurer.rb +28 -18
  17. data/lib/puppet/configurer/downloader.rb +2 -1
  18. data/lib/puppet/defaults.rb +51 -23
  19. data/lib/puppet/environments.rb +54 -55
  20. data/lib/puppet/face/config.rb +10 -0
  21. data/lib/puppet/face/epp.rb +12 -2
  22. data/lib/puppet/face/facts.rb +158 -0
  23. data/lib/puppet/ffi/posix.rb +10 -0
  24. data/lib/puppet/ffi/posix/constants.rb +14 -0
  25. data/lib/puppet/ffi/posix/functions.rb +24 -0
  26. data/lib/puppet/file_serving/fileset.rb +14 -2
  27. data/lib/puppet/file_system/memory_file.rb +8 -1
  28. data/lib/puppet/file_system/windows.rb +2 -0
  29. data/lib/puppet/functions/all.rb +1 -1
  30. data/lib/puppet/functions/camelcase.rb +1 -1
  31. data/lib/puppet/functions/capitalize.rb +2 -2
  32. data/lib/puppet/functions/downcase.rb +2 -2
  33. data/lib/puppet/functions/epp.rb +1 -0
  34. data/lib/puppet/functions/get.rb +5 -5
  35. data/lib/puppet/functions/group_by.rb +13 -5
  36. data/lib/puppet/functions/inline_epp.rb +1 -0
  37. data/lib/puppet/functions/lest.rb +1 -1
  38. data/lib/puppet/functions/new.rb +100 -100
  39. data/lib/puppet/functions/partition.rb +12 -4
  40. data/lib/puppet/functions/require.rb +5 -5
  41. data/lib/puppet/functions/sort.rb +3 -3
  42. data/lib/puppet/functions/tree_each.rb +7 -9
  43. data/lib/puppet/functions/type.rb +4 -4
  44. data/lib/puppet/functions/upcase.rb +2 -2
  45. data/lib/puppet/http/resolver/server_list.rb +15 -4
  46. data/lib/puppet/http/service/compiler.rb +69 -0
  47. data/lib/puppet/http/service/file_server.rb +2 -1
  48. data/lib/puppet/indirector/catalog/compiler.rb +1 -0
  49. data/lib/puppet/indirector/fact_search.rb +60 -0
  50. data/lib/puppet/indirector/facts/facter.rb +24 -3
  51. data/lib/puppet/indirector/facts/json.rb +27 -0
  52. data/lib/puppet/indirector/facts/yaml.rb +3 -58
  53. data/lib/puppet/indirector/file_metadata/rest.rb +1 -0
  54. data/lib/puppet/indirector/json.rb +5 -1
  55. data/lib/puppet/indirector/node/json.rb +8 -0
  56. data/lib/puppet/indirector/report/json.rb +34 -0
  57. data/lib/puppet/module_tool/applications/installer.rb +48 -2
  58. data/lib/puppet/module_tool/errors/shared.rb +17 -2
  59. data/lib/puppet/network/formats.rb +69 -1
  60. data/lib/puppet/network/http/factory.rb +4 -0
  61. data/lib/puppet/pal/pal_impl.rb +70 -17
  62. data/lib/puppet/parser/ast/leaf.rb +3 -2
  63. data/lib/puppet/parser/functions/fqdn_rand.rb +14 -6
  64. data/lib/puppet/parser/templatewrapper.rb +1 -1
  65. data/lib/puppet/pops/evaluator/deferred_resolver.rb +5 -3
  66. data/lib/puppet/pops/evaluator/evaluator_impl.rb +22 -3
  67. data/lib/puppet/pops/model/ast_transformer.rb +1 -1
  68. data/lib/puppet/pops/types/p_sem_ver_type.rb +8 -2
  69. data/lib/puppet/pops/types/p_sensitive_type.rb +10 -0
  70. data/lib/puppet/property/list.rb +1 -1
  71. data/lib/puppet/provider/group/groupadd.rb +13 -8
  72. data/lib/puppet/provider/package/apt.rb +34 -2
  73. data/lib/puppet/provider/package/aptitude.rb +6 -0
  74. data/lib/puppet/provider/package/dnfmodule.rb +1 -1
  75. data/lib/puppet/provider/package/nim.rb +11 -6
  76. data/lib/puppet/provider/service/debian.rb +2 -0
  77. data/lib/puppet/provider/service/systemd.rb +14 -4
  78. data/lib/puppet/provider/service/windows.rb +38 -0
  79. data/lib/puppet/provider/user/aix.rb +2 -2
  80. data/lib/puppet/provider/user/directoryservice.rb +25 -12
  81. data/lib/puppet/provider/user/useradd.rb +62 -8
  82. data/lib/puppet/reference/configuration.rb +7 -6
  83. data/lib/puppet/settings.rb +33 -28
  84. data/lib/puppet/settings/alias_setting.rb +37 -0
  85. data/lib/puppet/settings/base_setting.rb +26 -2
  86. data/lib/puppet/settings/environment_conf.rb +1 -0
  87. data/lib/puppet/transaction/additional_resource_generator.rb +1 -1
  88. data/lib/puppet/type/file.rb +19 -1
  89. data/lib/puppet/type/file/selcontext.rb +1 -1
  90. data/lib/puppet/type/package.rb +3 -3
  91. data/lib/puppet/type/service.rb +18 -38
  92. data/lib/puppet/type/tidy.rb +21 -2
  93. data/lib/puppet/type/user.rb +38 -20
  94. data/lib/puppet/util/autoload.rb +1 -8
  95. data/lib/puppet/util/fact_dif.rb +81 -0
  96. data/lib/puppet/util/monkey_patches.rb +7 -0
  97. data/lib/puppet/util/posix.rb +54 -5
  98. data/lib/puppet/util/rubygems.rb +5 -1
  99. data/lib/puppet/util/selinux.rb +30 -4
  100. data/lib/puppet/util/windows/adsi.rb +46 -0
  101. data/lib/puppet/util/windows/api_types.rb +1 -1
  102. data/lib/puppet/util/windows/principal.rb +9 -2
  103. data/lib/puppet/util/windows/service.rb +1 -1
  104. data/lib/puppet/util/windows/sid.rb +4 -2
  105. data/lib/puppet/version.rb +1 -1
  106. data/locales/puppet.pot +372 -288
  107. data/man/man5/puppet.conf.5 +282 -254
  108. data/man/man8/puppet-agent.8 +2 -2
  109. data/man/man8/puppet-apply.8 +2 -2
  110. data/man/man8/puppet-catalog.8 +1 -1
  111. data/man/man8/puppet-config.8 +1 -1
  112. data/man/man8/puppet-describe.8 +1 -1
  113. data/man/man8/puppet-device.8 +2 -2
  114. data/man/man8/puppet-doc.8 +1 -1
  115. data/man/man8/puppet-epp.8 +1 -1
  116. data/man/man8/puppet-facts.8 +90 -1
  117. data/man/man8/puppet-filebucket.8 +3 -3
  118. data/man/man8/puppet-generate.8 +1 -1
  119. data/man/man8/puppet-help.8 +1 -1
  120. data/man/man8/puppet-key.8 +1 -1
  121. data/man/man8/puppet-lookup.8 +1 -1
  122. data/man/man8/puppet-man.8 +1 -1
  123. data/man/man8/puppet-module.8 +1 -1
  124. data/man/man8/puppet-node.8 +4 -1
  125. data/man/man8/puppet-parser.8 +1 -1
  126. data/man/man8/puppet-plugin.8 +1 -1
  127. data/man/man8/puppet-report.8 +4 -1
  128. data/man/man8/puppet-resource.8 +1 -1
  129. data/man/man8/puppet-script.8 +2 -2
  130. data/man/man8/puppet-ssl.8 +5 -1
  131. data/man/man8/puppet-status.8 +1 -1
  132. data/man/man8/puppet.8 +2 -2
  133. data/spec/fixtures/integration/application/agent/cached_deferred_catalog.json +91 -0
  134. data/spec/fixtures/ssl/127.0.0.1-key.pem +107 -57
  135. data/spec/fixtures/ssl/127.0.0.1.pem +52 -31
  136. data/spec/fixtures/ssl/bad-basic-constraints.pem +57 -35
  137. data/spec/fixtures/ssl/bad-int-basic-constraints.pem +57 -35
  138. data/spec/fixtures/ssl/ca.pem +57 -35
  139. data/spec/fixtures/ssl/crl.pem +28 -18
  140. data/spec/fixtures/ssl/ec-key.pem +11 -11
  141. data/spec/fixtures/ssl/ec.pem +33 -24
  142. data/spec/fixtures/ssl/encrypted-ec-key.pem +12 -12
  143. data/spec/fixtures/ssl/encrypted-key.pem +108 -58
  144. data/spec/fixtures/ssl/intermediate-agent-crl.pem +28 -19
  145. data/spec/fixtures/ssl/intermediate-agent.pem +57 -36
  146. data/spec/fixtures/ssl/intermediate-crl.pem +31 -21
  147. data/spec/fixtures/ssl/intermediate.pem +57 -36
  148. data/spec/fixtures/ssl/pluto-key.pem +107 -57
  149. data/spec/fixtures/ssl/pluto.pem +52 -30
  150. data/spec/fixtures/ssl/request-key.pem +107 -57
  151. data/spec/fixtures/ssl/request.pem +47 -26
  152. data/spec/fixtures/ssl/revoked-key.pem +107 -57
  153. data/spec/fixtures/ssl/revoked.pem +52 -30
  154. data/spec/fixtures/ssl/signed-key.pem +107 -57
  155. data/spec/fixtures/ssl/signed.pem +52 -30
  156. data/spec/fixtures/ssl/tampered-cert.pem +52 -30
  157. data/spec/fixtures/ssl/tampered-csr.pem +47 -26
  158. data/spec/fixtures/ssl/unknown-127.0.0.1-key.pem +107 -57
  159. data/spec/fixtures/ssl/unknown-127.0.0.1.pem +50 -29
  160. data/spec/fixtures/ssl/unknown-ca-key.pem +107 -57
  161. data/spec/fixtures/ssl/unknown-ca.pem +55 -33
  162. data/spec/fixtures/unit/provider/service/systemd/list_unit_files_services_vendor_preset +9 -0
  163. data/spec/fixtures/unit/provider/user/aix/aix_passwd_file.out +4 -0
  164. data/spec/integration/application/agent_spec.rb +160 -3
  165. data/spec/integration/application/apply_spec.rb +19 -0
  166. data/spec/integration/application/plugin_spec.rb +1 -1
  167. data/spec/integration/application/resource_spec.rb +30 -0
  168. data/spec/integration/defaults_spec.rb +0 -7
  169. data/spec/integration/environments/setting_hooks_spec.rb +1 -1
  170. data/spec/integration/http/client_spec.rb +12 -0
  171. data/spec/integration/indirector/direct_file_server_spec.rb +1 -3
  172. data/spec/integration/resource/type_collection_spec.rb +2 -6
  173. data/spec/integration/transaction_spec.rb +4 -9
  174. data/spec/integration/util/windows/adsi_spec.rb +21 -1
  175. data/spec/integration/util/windows/principal_spec.rb +21 -0
  176. data/spec/integration/util/windows/registry_spec.rb +6 -10
  177. data/spec/lib/puppet/test_ca.rb +2 -2
  178. data/spec/lib/puppet_spec/settings.rb +6 -1
  179. data/spec/spec_helper.rb +12 -5
  180. data/spec/unit/agent_spec.rb +8 -6
  181. data/spec/unit/application/agent_spec.rb +7 -3
  182. data/spec/unit/application/config_spec.rb +224 -4
  183. data/spec/unit/application/facts_spec.rb +482 -3
  184. data/spec/unit/application/filebucket_spec.rb +0 -2
  185. data/spec/unit/application/ssl_spec.rb +23 -0
  186. data/spec/unit/application_spec.rb +51 -9
  187. data/spec/unit/configurer/downloader_spec.rb +6 -0
  188. data/spec/unit/configurer_spec.rb +23 -0
  189. data/spec/unit/confine/feature_spec.rb +1 -1
  190. data/spec/unit/confine_spec.rb +8 -2
  191. data/spec/unit/defaults_spec.rb +36 -1
  192. data/spec/unit/environments_spec.rb +221 -68
  193. data/spec/unit/face/config_spec.rb +27 -32
  194. data/spec/unit/face/facts_spec.rb +4 -0
  195. data/spec/unit/face/node_spec.rb +0 -11
  196. data/spec/unit/file_serving/configuration/parser_spec.rb +0 -1
  197. data/spec/unit/file_serving/fileset_spec.rb +60 -0
  198. data/spec/unit/file_serving/metadata_spec.rb +3 -3
  199. data/spec/unit/file_serving/terminus_helper_spec.rb +11 -4
  200. data/spec/unit/file_system_spec.rb +9 -0
  201. data/spec/unit/forge/module_release_spec.rb +2 -7
  202. data/spec/unit/functions/inline_epp_spec.rb +26 -1
  203. data/spec/unit/gettext/config_spec.rb +12 -0
  204. data/spec/unit/http/service/compiler_spec.rb +172 -0
  205. data/spec/unit/http/service_spec.rb +1 -1
  206. data/spec/unit/indirector/catalog/compiler_spec.rb +14 -10
  207. data/spec/unit/indirector/face_spec.rb +0 -1
  208. data/spec/unit/indirector/facts/facter_spec.rb +95 -1
  209. data/spec/unit/indirector/facts/json_spec.rb +255 -0
  210. data/spec/unit/indirector/file_bucket_file/selector_spec.rb +26 -8
  211. data/spec/unit/indirector/indirection_spec.rb +8 -12
  212. data/spec/unit/indirector/key/file_spec.rb +0 -1
  213. data/spec/unit/indirector/node/json_spec.rb +33 -0
  214. data/spec/{integration/indirector/report/yaml.rb → unit/indirector/report/json_spec.rb} +13 -24
  215. data/spec/unit/indirector/report/yaml_spec.rb +72 -8
  216. data/spec/unit/indirector_spec.rb +2 -2
  217. data/spec/unit/module_tool/applications/installer_spec.rb +66 -0
  218. data/spec/unit/network/authconfig_spec.rb +0 -3
  219. data/spec/unit/network/formats_spec.rb +41 -0
  220. data/spec/unit/network/http/api/indirected_routes_spec.rb +0 -9
  221. data/spec/unit/network/http/factory_spec.rb +19 -0
  222. data/spec/unit/network/http/handler_spec.rb +0 -5
  223. data/spec/unit/parser/compiler_spec.rb +3 -19
  224. data/spec/unit/parser/functions/fqdn_rand_spec.rb +15 -1
  225. data/spec/unit/parser/resource_spec.rb +14 -8
  226. data/spec/unit/parser/templatewrapper_spec.rb +4 -3
  227. data/spec/unit/pops/evaluator/deferred_resolver_spec.rb +20 -0
  228. data/spec/unit/pops/types/p_sem_ver_type_spec.rb +18 -0
  229. data/spec/unit/pops/types/p_sensitive_type_spec.rb +18 -0
  230. data/spec/unit/property_spec.rb +1 -0
  231. data/spec/unit/provider/group/groupadd_spec.rb +5 -2
  232. data/spec/unit/provider/nameservice_spec.rb +66 -65
  233. data/spec/unit/provider/package/apt_spec.rb +28 -23
  234. data/spec/unit/provider/package/aptitude_spec.rb +1 -1
  235. data/spec/unit/provider/package/base_spec.rb +6 -5
  236. data/spec/unit/provider/package/dnfmodule_spec.rb +10 -1
  237. data/spec/unit/provider/package/nim_spec.rb +42 -0
  238. data/spec/unit/provider/package/pacman_spec.rb +18 -12
  239. data/spec/unit/provider/package/pip_spec.rb +6 -11
  240. data/spec/unit/provider/package/pkgdmg_spec.rb +0 -4
  241. data/spec/unit/provider/service/init_spec.rb +1 -0
  242. data/spec/unit/provider/service/openwrt_spec.rb +3 -1
  243. data/spec/unit/provider/service/systemd_spec.rb +53 -8
  244. data/spec/unit/provider/service/windows_spec.rb +202 -0
  245. data/spec/unit/provider/user/aix_spec.rb +5 -0
  246. data/spec/unit/provider/user/directoryservice_spec.rb +67 -35
  247. data/spec/unit/provider/user/hpux_spec.rb +1 -1
  248. data/spec/unit/provider/user/pw_spec.rb +2 -0
  249. data/spec/unit/provider/user/useradd_spec.rb +71 -3
  250. data/spec/unit/provider_spec.rb +8 -10
  251. data/spec/unit/puppet_pal_catalog_spec.rb +45 -0
  252. data/spec/unit/resource/capability_finder_spec.rb +6 -1
  253. data/spec/unit/resource/catalog_spec.rb +1 -1
  254. data/spec/unit/resource/type_spec.rb +1 -1
  255. data/spec/unit/resource_spec.rb +11 -10
  256. data/spec/unit/settings_spec.rb +419 -242
  257. data/spec/unit/ssl/base_spec.rb +0 -1
  258. data/spec/unit/ssl/host_spec.rb +0 -5
  259. data/spec/unit/ssl/ssl_provider_spec.rb +14 -8
  260. data/spec/unit/ssl/state_machine_spec.rb +19 -5
  261. data/spec/unit/transaction/additional_resource_generator_spec.rb +3 -9
  262. data/spec/unit/transaction/event_manager_spec.rb +14 -11
  263. data/spec/unit/transaction_spec.rb +18 -11
  264. data/spec/unit/type/file/content_spec.rb +0 -1
  265. data/spec/unit/type/file/selinux_spec.rb +3 -5
  266. data/spec/unit/type/file_spec.rb +0 -6
  267. data/spec/unit/type/group_spec.rb +13 -6
  268. data/spec/unit/type/resources_spec.rb +7 -7
  269. data/spec/unit/type/service_spec.rb +60 -189
  270. data/spec/unit/type/tidy_spec.rb +17 -8
  271. data/spec/unit/type/user_spec.rb +45 -0
  272. data/spec/unit/type_spec.rb +2 -2
  273. data/spec/unit/util/at_fork_spec.rb +2 -2
  274. data/spec/unit/util/autoload_spec.rb +5 -1
  275. data/spec/unit/util/backups_spec.rb +1 -2
  276. data/spec/unit/util/execution_spec.rb +15 -11
  277. data/spec/unit/util/inifile_spec.rb +6 -14
  278. data/spec/unit/util/log_spec.rb +8 -7
  279. data/spec/unit/util/logging_spec.rb +3 -3
  280. data/spec/unit/util/posix_spec.rb +363 -15
  281. data/spec/unit/util/rubygems_spec.rb +2 -2
  282. data/spec/unit/util/selinux_spec.rb +163 -68
  283. data/spec/unit/util/storage_spec.rb +3 -1
  284. data/spec/unit/util/suidmanager_spec.rb +44 -41
  285. data/spec/unit/util/windows/sid_spec.rb +6 -0
  286. data/spec/unit/util_spec.rb +13 -6
  287. data/tasks/generate_cert_fixtures.rake +2 -2
  288. metadata +33 -16
  289. data/spec/integration/application/config_spec.rb +0 -74
  290. data/spec/lib/matchers/include.rb +0 -27
  291. data/spec/lib/matchers/include_spec.rb +0 -32
  292. data/spec/unit/face/catalog_spec.rb +0 -6
  293. data/spec/unit/face/module_spec.rb +0 -3
@@ -6,21 +6,30 @@ Certificate:
6
6
  Issuer: CN=Unknown CA
7
7
  Validity
8
8
  Not Before: Jan 1 00:00:00 1970 GMT
9
- Not After : Mar 10 06:54:16 2030 GMT
9
+ Not After : Apr 18 18:46:23 2031 GMT
10
10
  Subject: CN=Unknown CA
11
11
  Subject Public Key Info:
12
12
  Public Key Algorithm: rsaEncryption
13
- RSA Public-Key: (1024 bit)
13
+ RSA Public-Key: (2048 bit)
14
14
  Modulus:
15
- 00:c1:5e:5d:26:ae:73:17:5a:70:37:ac:42:25:ca:
16
- 05:10:86:17:23:6c:28:84:48:2a:4a:d4:b0:3a:2a:
17
- d8:33:ae:58:67:6f:9b:4f:a6:b4:87:b1:ec:37:00:
18
- 69:8d:d5:cf:71:8a:96:e1:4a:f8:c8:81:36:f9:43:
19
- ad:d8:d6:76:83:27:99:a4:48:17:c2:ef:9c:22:40:
20
- 4b:c6:58:21:88:e5:1d:37:79:4e:ba:31:e6:52:ec:
21
- 8c:23:ed:d6:ce:3b:58:ad:82:c7:ae:28:47:d4:e7:
22
- cc:31:ac:78:c9:02:87:d0:b1:91:09:f6:1e:9a:c3:
23
- 4f:f6:5a:fe:a2:21:0e:c0:95
15
+ 00:ea:16:4c:26:71:56:ac:35:bb:2b:f6:1b:18:58:
16
+ 16:0f:1c:39:3f:4d:02:e4:b2:a7:8b:bd:fe:99:57:
17
+ f2:a5:a8:15:01:79:0d:1d:f6:d9:12:db:d5:26:a2:
18
+ f6:58:af:4b:2c:aa:46:7a:53:63:9f:1f:1a:9e:1c:
19
+ fc:9a:8e:20:c8:c8:c8:db:4d:50:8d:4e:19:83:a1:
20
+ 9d:54:49:26:7b:3a:e0:77:1d:7d:88:01:80:46:32:
21
+ 70:47:16:08:71:de:12:94:67:fd:71:1f:41:56:93:
22
+ 15:91:68:bd:05:3b:67:96:1f:7a:4d:d5:1e:b6:ac:
23
+ 41:1f:f0:ce:d3:2d:96:d9:7c:ad:cd:be:b3:32:66:
24
+ 18:03:2c:83:98:f1:e8:96:6f:85:0f:e1:1f:93:d0:
25
+ f9:09:43:8c:b1:ea:43:26:32:a5:c6:d2:32:75:2d:
26
+ ed:72:9d:bf:3a:bb:f3:4e:d0:0c:ac:ba:6b:fd:7f:
27
+ 66:d8:12:40:4e:49:e7:d4:ec:70:03:71:37:cb:5e:
28
+ cc:d3:4f:f3:d2:cc:e2:39:eb:79:6c:71:e5:d1:0e:
29
+ 45:4c:7a:3d:6f:39:e8:16:e7:de:60:eb:01:e7:80:
30
+ 4e:42:1d:1c:33:0a:eb:f9:10:2c:5c:ed:0c:58:0b:
31
+ 8c:fd:6d:f4:19:49:8a:a2:81:ab:04:b0:cb:7a:61:
32
+ 1f:d3
24
33
  Exponent: 65537 (0x10001)
25
34
  X509v3 extensions:
26
35
  X509v3 Basic Constraints: critical
@@ -28,32 +37,45 @@ Certificate:
28
37
  X509v3 Key Usage: critical
29
38
  Certificate Sign, CRL Sign
30
39
  X509v3 Subject Key Identifier:
31
- E9:58:70:FE:F1:C1:AA:5A:70:7A:C1:02:11:1D:9A:F4:60:4F:70:76
40
+ 16:C5:98:B8:84:0B:0A:43:CB:5A:D2:E0:55:C0:64:AB:89:F8:50:FD
32
41
  Netscape Comment:
33
42
  Puppet Server Internal Certificate
34
43
  X509v3 Authority Key Identifier:
35
- keyid:E9:58:70:FE:F1:C1:AA:5A:70:7A:C1:02:11:1D:9A:F4:60:4F:70:76
44
+ keyid:16:C5:98:B8:84:0B:0A:43:CB:5A:D2:E0:55:C0:64:AB:89:F8:50:FD
36
45
 
37
46
  Signature Algorithm: sha256WithRSAEncryption
38
- 00:45:89:e8:68:a7:50:8c:92:84:3c:c4:e6:10:00:29:27:99:
39
- c6:82:aa:aa:b5:0b:ef:97:58:bc:bb:e6:e7:93:7c:a7:ea:e5:
40
- 9a:61:1d:e3:4f:3f:f9:ac:c4:96:14:a5:1f:77:a6:01:dc:08:
41
- 15:9c:3f:66:29:92:80:49:e9:db:d9:22:fb:c3:86:bf:40:ab:
42
- 46:bf:c5:47:bb:c8:89:df:d4:ca:36:f5:08:c4:08:c6:0b:d6:
43
- 9e:8a:86:41:1e:7e:6f:a9:75:ef:8a:94:a9:fd:1a:9b:0f:55:
44
- 3a:55:e5:04:82:71:c3:47:78:62:8e:07:ed:dc:4e:ac:f9:33:
45
- 7b:27
47
+ 7d:0b:a0:2e:d4:fb:6b:29:04:d6:86:4e:89:94:4c:b5:d4:f7:
48
+ 79:5a:38:95:51:9a:80:03:82:93:c8:a7:4e:93:4a:4b:41:1a:
49
+ 85:f3:46:57:e1:70:50:ad:bb:4e:b9:d6:0c:00:e5:9e:4c:f7:
50
+ 26:3b:88:61:27:ad:fa:39:a7:36:e1:62:87:7a:dc:7d:f9:f6:
51
+ c1:ee:bc:db:f7:65:a1:b0:2a:06:ae:4b:cb:99:82:f5:8e:38:
52
+ 51:ac:c9:92:33:b9:7b:50:8b:c6:72:36:d3:f2:73:7d:58:13:
53
+ 00:21:4d:c6:70:9d:eb:70:58:bf:dc:34:94:7e:bc:ef:17:2d:
54
+ 9d:00:bd:55:f9:48:11:c0:8f:88:ea:a8:7c:5d:fb:88:fd:8c:
55
+ b4:00:1d:61:a7:4b:2a:90:ef:96:c1:28:2a:a0:95:ad:bb:b3:
56
+ af:3a:d5:93:1c:54:d7:c5:5b:26:a3:24:87:df:bd:68:74:fa:
57
+ e6:07:4e:13:b9:5f:54:19:ae:da:00:8c:ca:d6:ff:b7:94:6b:
58
+ 4f:ff:71:ca:2b:7d:ee:7e:32:ff:03:3e:60:a4:30:d4:7d:9c:
59
+ ab:97:0e:f7:80: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
81
  -----END CERTIFICATE-----
@@ -0,0 +1,9 @@
1
+ UNIT FILE STATE VENDOR PRESET
2
+ arp-ethers.service disabled disabled
3
+ auditd.service enabled enabled
4
+ dbus.service enabled disabled
5
+ udev.service enabled-runtime disabled
6
+ umountfs.service linked-runtime disabled
7
+ umountnfs.service masked disabled
8
+ umountroot.service masked-runtime disabled
9
+ urandom.service indirect enabled
@@ -6,6 +6,10 @@ test_aix_user:
6
6
  no_password_user:
7
7
  lastupdate = another_last_update
8
8
 
9
+ tab_password_user:
10
+ password = some_password
11
+ lastupdate = another_last_update
12
+
9
13
  daemon:
10
14
  password = *
11
15
 
@@ -100,10 +100,10 @@ describe "puppet agent", unless: Puppet::Util::Platform.jruby? do
100
100
  end
101
101
 
102
102
  context 'rich data' do
103
- it "applies deferred values" do
103
+ it "calls a deferred 4x function" do
104
104
  catalog_handler = -> (req, res) {
105
105
  catalog = compile_to_catalog(<<-MANIFEST, node)
106
- notify { 'deferred':
106
+ notify { 'deferred4x':
107
107
  message => Deferred('join', [[1,2,3], ':'])
108
108
  }
109
109
  MANIFEST
@@ -118,7 +118,66 @@ describe "puppet agent", unless: Puppet::Util::Platform.jruby? do
118
118
  agent.command_line.args << '--test'
119
119
  agent.run
120
120
  }.to exit_with(2)
121
- .and output(%r{Notice: /Stage\[main\]/Main/Notify\[deferred\]/message: defined 'message' as '1:2:3'}).to_stdout
121
+ .and output(%r{Notice: /Stage\[main\]/Main/Notify\[deferred4x\]/message: defined 'message' as '1:2:3'}).to_stdout
122
+ end
123
+ end
124
+
125
+ it "calls a deferred 3x function" do
126
+ catalog_handler = -> (req, res) {
127
+ catalog = compile_to_catalog(<<-MANIFEST, node)
128
+ notify { 'deferred3x':
129
+ message => Deferred('sprintf', ['%s', 'I am deferred'])
130
+ }
131
+ MANIFEST
132
+
133
+ res.body = formatter.render(catalog)
134
+ res['Content-Type'] = formatter.mime
135
+ }
136
+
137
+ server.start_server(mounts: {catalog: catalog_handler}) do |port|
138
+ Puppet[:serverport] = port
139
+ expect {
140
+ agent.command_line.args << '--test'
141
+ agent.run
142
+ }.to exit_with(2)
143
+ .and output(%r{Notice: /Stage\[main\]/Main/Notify\[deferred3x\]/message: defined 'message' as 'I am deferred'}).to_stdout
144
+ end
145
+ end
146
+
147
+ it "re-evaluates a deferred function in a cached catalog" do
148
+ Puppet[:report] = false
149
+ Puppet[:use_cached_catalog] = true
150
+ Puppet[:usecacheonfailure] = false
151
+
152
+ catalog_dir = File.join(Puppet[:client_datadir], 'catalog')
153
+ Puppet::FileSystem.mkpath(catalog_dir)
154
+ cached_catalog_path = "#{File.join(catalog_dir, Puppet[:certname])}.json"
155
+
156
+ # our catalog contains a deferred function that calls `binary_file`
157
+ # to read `source`. The function returns a Binary object, whose
158
+ # base64 value is printed to stdout
159
+ source = tmpfile('deferred_source')
160
+ catalog = File.read(my_fixture('cached_deferred_catalog.json'))
161
+ catalog.gsub!('__SOURCE_PATH__', source)
162
+ File.write(cached_catalog_path, catalog)
163
+
164
+ # verify we get a different result each time the deferred function
165
+ # is evaluated, and reads `source`.
166
+ {
167
+ '1234' => 'MTIzNA==',
168
+ '5678' => 'NTY3OA=='
169
+ }.each_pair do |content, base64|
170
+ File.write(source, content)
171
+
172
+ expect {
173
+ agent.command_line.args << '-t'
174
+ agent.run
175
+
176
+ }.to exit_with(2)
177
+ .and output(/Notice: #{base64}/).to_stdout
178
+
179
+ # reset state so we can run again
180
+ Puppet::Application.clear!
122
181
  end
123
182
  end
124
183
 
@@ -476,4 +535,102 @@ describe "puppet agent", unless: Puppet::Util::Platform.jruby? do
476
535
  th.kill # kill thread so we don't wait too much
477
536
  end
478
537
  end
538
+
539
+ context 'cached catalogs' do
540
+ it 'falls back to a cached catalog' do
541
+ catalog_handler = -> (req, res) {
542
+ catalog = compile_to_catalog(<<-MANIFEST, node)
543
+ notify { 'a message': }
544
+ MANIFEST
545
+
546
+ res.body = formatter.render(catalog)
547
+ res['Content-Type'] = formatter.mime
548
+ }
549
+
550
+ server.start_server(mounts: {catalog: catalog_handler}) do |port|
551
+ Puppet[:serverport] = port
552
+ expect {
553
+ agent.command_line.args << '--test'
554
+ agent.run
555
+ }.to exit_with(2)
556
+ .and output(%r{Caching catalog for #{Puppet[:certname]}}).to_stdout
557
+ end
558
+
559
+ # reset state so we can run again
560
+ Puppet::Application.clear!
561
+
562
+ # --test above turns off `usecacheonfailure` so re-enable here
563
+ Puppet[:usecacheonfailure] = true
564
+
565
+ # run agent without server
566
+ expect {
567
+ agent.command_line.args << '--no-daemonize' << '--onetime' << '--server' << '127.0.0.1'
568
+ agent.run
569
+ }.to exit_with(2)
570
+ .and output(a_string_matching(
571
+ /Using cached catalog from environment 'production'/
572
+ ).and matching(
573
+ /Notify\[a message\]\/message:/
574
+ )).to_stdout
575
+ .and output(/the agent run will continue/).to_stderr
576
+ end
577
+
578
+ it 'preserves the old cached catalog if validation fails with the old one' do
579
+ catalog_handler = -> (req, res) {
580
+ catalog = compile_to_catalog(<<-MANIFEST, node)
581
+ exec { 'unqualified_command': }
582
+ MANIFEST
583
+
584
+ res.body = formatter.render(catalog)
585
+ res['Content-Type'] = formatter.mime
586
+ }
587
+
588
+ server.start_server(mounts: {catalog: catalog_handler}) do |port|
589
+ Puppet[:serverport] = port
590
+ expect {
591
+ agent.command_line.args << '--test'
592
+ agent.run
593
+ }.to exit_with(1)
594
+ .and output(/Using configured environment/).to_stdout
595
+ .and output(%r{Validation of Exec\[unqualified_command\] failed: 'unqualified_command' is not qualified and no path was specified}).to_stderr
596
+ end
597
+
598
+ # cached catalog should not be updated
599
+ cached_catalog = "#{File.join(Puppet[:client_datadir], 'catalog', Puppet[:certname])}.json"
600
+ expect(File).to_not be_exist(cached_catalog)
601
+ end
602
+ end
603
+
604
+ context "reporting" do
605
+ it "stores a finalized report" do
606
+ catalog_handler = -> (req, res) {
607
+ catalog = compile_to_catalog(<<-MANIFEST, node)
608
+ notify { 'foo':
609
+ require => Notify['bar']
610
+ }
611
+
612
+ notify { 'bar':
613
+ require => Notify['foo']
614
+ }
615
+ MANIFEST
616
+
617
+ res.body = formatter.render(catalog)
618
+ res['Content-Type'] = formatter.mime
619
+ }
620
+
621
+ server.start_server(mounts: {catalog: catalog_handler}) do |port|
622
+ Puppet[:serverport] = port
623
+ expect {
624
+ agent.command_line.args << '--test'
625
+ agent.run
626
+ }.to exit_with(1)
627
+ .and output(%r{Applying configuration}).to_stdout
628
+ .and output(%r{Found 1 dependency cycle}).to_stderr
629
+
630
+ report = Puppet::Transaction::Report.convert_from(:yaml, File.read(Puppet[:lastrunreport]))
631
+ expect(report.status).to eq("failed")
632
+ expect(report.metrics).to_not be_empty
633
+ end
634
+ end
635
+ end
479
636
  end
@@ -663,4 +663,23 @@ class amod::bad_type {
663
663
  end
664
664
  end
665
665
  end
666
+
667
+ context 'rich data' do
668
+ it "calls a deferred 4x function" do
669
+ apply.command_line.args = ['-e', 'notify { "deferred3x": message => Deferred("join", [[1,2,3], ":"]) }']
670
+
671
+ expect {
672
+ apply.run
673
+ }.to exit_with(0) # for some reason apply returns 0 instead of 2
674
+ .and output(%r{Notice: /Stage\[main\]/Main/Notify\[deferred3x\]/message: defined 'message' as '1:2:3'}).to_stdout
675
+ end
676
+
677
+ it "calls a deferred 3x function" do
678
+ apply.command_line.args = ['-e', 'notify { "deferred4x": message => Deferred("sprintf", ["%s", "I am deferred"]) }']
679
+ expect {
680
+ apply.run
681
+ }.to exit_with(0) # for some reason apply returns 0 instead of 2
682
+ .and output(%r{Notice: /Stage\[main\]/Main/Notify\[deferred4x\]/message: defined 'message' as 'I am deferred'}).to_stdout
683
+ end
684
+ end
666
685
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
  require 'puppet/face'
3
3
  require 'puppet_spec/puppetserver'
4
4
 
5
- describe "puppet plugin" do
5
+ describe "puppet plugin", unless: Puppet::Util::Platform.jruby? do
6
6
  include_context "https client"
7
7
 
8
8
  let(:server) { PuppetSpec::Puppetserver.new }
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+ require 'puppet_spec/files'
3
+
4
+ describe "puppet resource", unless: Puppet::Util::Platform.jruby? do
5
+ include PuppetSpec::Files
6
+
7
+ let(:resource) { Puppet::Application[:resource] }
8
+
9
+ describe "when handling file and tidy types" do
10
+ let!(:dir) { dir_containing('testdir', 'testfile' => 'contents') }
11
+
12
+ it 'does not raise when generating file resources' do
13
+ resource.command_line.args = ['file', dir, 'ensure=directory', 'recurse=true']
14
+
15
+ expect {
16
+ resource.run
17
+ }.to output(/ensure.+=> 'directory'/).to_stdout
18
+ end
19
+
20
+ it 'correctly cleans up a given path' do
21
+ resource.command_line.args = ['tidy', dir, 'rmdirs=true', 'recurse=true']
22
+
23
+ expect {
24
+ resource.run
25
+ }.to output(/Notice: \/File\[#{dir}\]\/ensure: removed/).to_stdout
26
+
27
+ expect(Puppet::FileSystem.exist?(dir)).to be false
28
+ end
29
+ end
30
+ end
@@ -36,13 +36,6 @@ describe "Puppet defaults" do
36
36
  end
37
37
  end
38
38
 
39
- describe "when setting the :serverport" do
40
- it "should also set the :masterport to the same value" do
41
- Puppet.settings[:serverport] = 9000
42
- expect(Puppet.settings[:masterport]).to eq(9000)
43
- end
44
- end
45
-
46
39
  describe "when setting the :factpath" do
47
40
  it "should add the :factpath to Facter's search paths" do
48
41
  expect(Facter).to receive(:search).with("/my/fact/path")
@@ -12,7 +12,7 @@ describe "setting hooks" do
12
12
  end
13
13
 
14
14
  it "accesses correct directory environment settings after initializing a setting with an on_write hook" do
15
- expect(Puppet.settings.setting(:certname).call_hook).to eq(:on_write_only)
15
+ expect(Puppet.settings.setting(:strict).call_hook).to eq(:on_write_only)
16
16
 
17
17
  File.open(File.join(confdir, "puppet.conf"), "w:UTF-8") do |f|
18
18
  f.puts("environmentpath=#{environmentpath}")
@@ -151,4 +151,16 @@ describe Puppet::HTTP::Client, unless: Puppet::Util::Platform.jruby? do
151
151
  end
152
152
  end
153
153
  end
154
+
155
+ context 'ciphersuites' do
156
+ it "does not connect when using an SSLv3 ciphersuite", :if => Puppet::Util::Package.versioncmp(OpenSSL::OPENSSL_LIBRARY_VERSION.split[1], '1.1.1e') > 0 do
157
+ Puppet[:ciphers] = "DES-CBC3-SHA"
158
+
159
+ https_server.start_server do |port|
160
+ expect {
161
+ client.get(URI("https://127.0.0.1:#{port}"), options: {ssl_context: root_context})
162
+ }.to raise_error(Puppet::HTTP::ConnectionError, /no cipher match|sslv3 alert handshake failure/)
163
+ end
164
+ end
165
+ end
154
166
  end
@@ -1,5 +1,4 @@
1
1
  require 'spec_helper'
2
- require 'matchers/include'
3
2
 
4
3
  require 'puppet/indirector/file_content/file'
5
4
  require 'puppet/indirector/file_metadata/file'
@@ -30,7 +29,6 @@ end
30
29
 
31
30
  describe Puppet::Indirector::DirectFileServer, " when interacting with FileServing::Fileset and the model" do
32
31
  include PuppetSpec::Files
33
- include Matchers::Include
34
32
 
35
33
  matcher :file_with_content do |name, content|
36
34
  match do |actual|
@@ -52,7 +50,7 @@ describe Puppet::Indirector::DirectFileServer, " when interacting with FileServi
52
50
  terminus = Puppet::Indirector::FileContent::File.new
53
51
  request = terminus.indirection.request(:search, Puppet::Util.path_to_uri(path).to_s, nil, :recurse => true)
54
52
 
55
- expect(terminus.search(request)).to include_in_any_order(
53
+ expect(terminus.search(request)).to contain_exactly(
56
54
  file_with_content(File.join(path, "one"), "one content"),
57
55
  file_with_content(File.join(path, "two"), "two content"),
58
56
  directory_named(path))