puppet 3.0.0.rc5 → 3.0.0.rc7

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 (398) hide show
  1. data/LICENSE +1 -1
  2. data/README_DEVELOPER.md +209 -1
  3. data/README_HIERA.md +148 -0
  4. data/Rakefile +25 -27
  5. data/bin/extlookup2hiera +56 -0
  6. data/conf/auth.conf +34 -34
  7. data/examples/hiera/README.md +91 -0
  8. data/examples/hiera/etc/hiera.yaml +15 -0
  9. data/examples/hiera/etc/hieradb/common.yaml +3 -0
  10. data/examples/hiera/etc/hieradb/dc1.yaml +6 -0
  11. data/examples/hiera/etc/hieradb/development.yaml +2 -0
  12. data/examples/hiera/etc/puppet.conf +3 -0
  13. data/examples/hiera/modules/data/manifests/common.pp +3 -0
  14. data/examples/hiera/modules/ntp/manifests/config.pp +5 -0
  15. data/examples/hiera/modules/ntp/manifests/data.pp +3 -0
  16. data/examples/hiera/modules/ntp/templates/ntp.conf.erb +3 -0
  17. data/examples/hiera/modules/users/manifests/common.pp +3 -0
  18. data/examples/hiera/modules/users/manifests/dc1.pp +3 -0
  19. data/examples/hiera/modules/users/manifests/development.pp +3 -0
  20. data/examples/hiera/site.pp +3 -0
  21. data/ext/build_defaults.yaml +23 -0
  22. data/ext/debian/README.Debian +8 -0
  23. data/ext/debian/README.source +2 -0
  24. data/ext/debian/TODO.Debian +1 -0
  25. data/ext/debian/changelog.erb +1104 -0
  26. data/ext/debian/compat +1 -0
  27. data/ext/debian/control +143 -0
  28. data/ext/debian/copyright +361 -0
  29. data/ext/debian/docs +1 -0
  30. data/ext/debian/fileserver.conf +17 -0
  31. data/ext/debian/puppet-common.dirs +8 -0
  32. data/ext/debian/puppet-common.install +4 -0
  33. data/ext/debian/puppet-common.lintian-overrides +5 -0
  34. data/ext/debian/puppet-common.manpages +2 -0
  35. data/ext/debian/puppet-common.postinst +35 -0
  36. data/ext/debian/puppet-common.postrm +32 -0
  37. data/ext/debian/puppet-el.dirs +1 -0
  38. data/ext/debian/puppet-el.emacsen-install +25 -0
  39. data/ext/debian/puppet-el.emacsen-remove +11 -0
  40. data/ext/debian/puppet-el.emacsen-startup +9 -0
  41. data/ext/debian/puppet-el.install +1 -0
  42. data/ext/debian/puppet-testsuite.install +2 -0
  43. data/ext/debian/puppet-testsuite.lintian-overrides +4 -0
  44. data/ext/debian/puppet.conf +14 -0
  45. data/ext/debian/puppet.default +7 -0
  46. data/ext/debian/puppet.init +118 -0
  47. data/ext/debian/puppet.lintian-overrides +3 -0
  48. data/ext/debian/puppet.logrotate +11 -0
  49. data/ext/debian/puppet.manpages +32 -0
  50. data/ext/debian/puppet.postinst +20 -0
  51. data/ext/debian/puppet.postrm +20 -0
  52. data/ext/debian/puppet.preinst +20 -0
  53. data/ext/debian/puppetmaster-common.install +2 -0
  54. data/ext/debian/puppetmaster-common.manpages +2 -0
  55. data/ext/debian/puppetmaster-common.puppetqd.default +27 -0
  56. data/ext/debian/puppetmaster-common.puppetqd.init +84 -0
  57. data/ext/debian/puppetmaster-passenger.dirs +4 -0
  58. data/ext/debian/puppetmaster-passenger.postinst +66 -0
  59. data/ext/debian/puppetmaster-passenger.postrm +33 -0
  60. data/ext/debian/puppetmaster.README.debian +16 -0
  61. data/ext/debian/puppetmaster.default +38 -0
  62. data/ext/debian/puppetmaster.init +158 -0
  63. data/ext/debian/puppetmaster.lintian-overrides +3 -0
  64. data/ext/debian/puppetmaster.postinst +20 -0
  65. data/ext/debian/puppetmaster.postrm +5 -0
  66. data/ext/debian/puppetmaster.preinst +22 -0
  67. data/ext/debian/rules +128 -0
  68. data/ext/debian/source/format +1 -0
  69. data/ext/debian/source/options +1 -0
  70. data/ext/debian/vim-puppet.README.Debian +13 -0
  71. data/ext/debian/vim-puppet.dirs +3 -0
  72. data/ext/debian/vim-puppet.yaml +5 -0
  73. data/ext/debian/watch +2 -0
  74. data/ext/emacs/puppet-mode.el +1 -0
  75. data/ext/envpuppet +4 -0
  76. data/ext/envpuppet.bat +3 -2
  77. data/{conf → ext}/freebsd/puppetd +0 -0
  78. data/{conf → ext}/freebsd/puppetmasterd +0 -0
  79. data/{conf → ext}/gentoo/conf.d/puppet +0 -0
  80. data/{conf → ext}/gentoo/conf.d/puppetmaster +0 -0
  81. data/{conf → ext}/gentoo/init.d/puppet +0 -0
  82. data/{conf → ext}/gentoo/init.d/puppetmaster +0 -0
  83. data/{conf → ext}/gentoo/puppet/fileserver.conf +0 -0
  84. data/{conf → ext}/gentoo/puppet/puppet.conf +0 -0
  85. data/ext/ips/puppet-agent +49 -0
  86. data/ext/ips/puppet-master +44 -0
  87. data/ext/ips/puppet.conf +29 -0
  88. data/ext/ips/puppet.p5m.erb +12 -0
  89. data/ext/ips/puppetagent.xml +46 -0
  90. data/ext/ips/puppetmaster.xml +42 -0
  91. data/ext/ips/rules +19 -0
  92. data/ext/ips/transforms +34 -0
  93. data/{conf → ext}/osx/PackageInfo.plist +0 -0
  94. data/{conf → ext}/osx/createpackage.sh +1 -1
  95. data/ext/osx/file_mapping.yaml +33 -0
  96. data/ext/osx/preflight.erb +37 -0
  97. data/{tasks/rake/templates → ext/osx}/prototype.plist.erb +0 -0
  98. data/ext/packaging/README-Solaris.md +117 -0
  99. data/ext/packaging/README.md +89 -0
  100. data/ext/packaging/tasks/00_utils.rb +236 -0
  101. data/ext/packaging/tasks/10_setupvars.rake +62 -0
  102. data/ext/packaging/tasks/apple.rake +201 -0
  103. data/ext/packaging/tasks/clean.rake +5 -0
  104. data/ext/packaging/tasks/deb.rake +105 -0
  105. data/ext/packaging/tasks/gem.rake +52 -0
  106. data/ext/packaging/tasks/ips.rake +78 -0
  107. data/ext/packaging/tasks/mock.rake +88 -0
  108. data/ext/packaging/tasks/release.rake +20 -0
  109. data/ext/packaging/tasks/rpm.rake +39 -0
  110. data/ext/packaging/tasks/ship.rake +34 -0
  111. data/ext/packaging/tasks/sign.rake +76 -0
  112. data/ext/packaging/tasks/tar.rake +20 -0
  113. data/ext/project_data.yaml +25 -0
  114. data/ext/rack/files/apache2.conf +2 -1
  115. data/{conf → ext}/redhat/client.init +0 -0
  116. data/{conf → ext}/redhat/client.sysconfig +0 -0
  117. data/{conf → ext}/redhat/fileserver.conf +0 -0
  118. data/{conf → ext}/redhat/logrotate +0 -0
  119. data/{conf → ext}/redhat/puppet.conf +0 -0
  120. data/{conf/redhat/puppet.spec → ext/redhat/puppet.spec.erb} +140 -33
  121. data/{conf → ext}/redhat/queue.init +0 -0
  122. data/{conf → ext}/redhat/rundir-perms.patch +0 -0
  123. data/{conf → ext}/redhat/server.init +0 -0
  124. data/{conf → ext}/redhat/server.sysconfig +0 -0
  125. data/{conf → ext}/solaris/pkginfo +0 -0
  126. data/{conf → ext}/solaris/smf/puppetd.xml +0 -0
  127. data/{conf → ext}/solaris/smf/puppetmasterd.xml +0 -0
  128. data/{conf → ext}/solaris/smf/svc-puppetd +0 -0
  129. data/{conf → ext}/solaris/smf/svc-puppetmasterd +0 -0
  130. data/{conf → ext}/suse/client.init +0 -0
  131. data/{conf → ext}/suse/fileserver.conf +0 -0
  132. data/{conf → ext}/suse/logrotate +0 -0
  133. data/{conf → ext}/suse/puppet.conf +0 -0
  134. data/{conf → ext}/suse/puppet.spec +1 -1
  135. data/{conf → ext}/suse/server.init +0 -0
  136. data/ext/systemd/puppetagent.service +13 -0
  137. data/ext/systemd/puppetmaster.service +13 -0
  138. data/{conf → ext}/windows/eventlog/Rakefile +0 -0
  139. data/{conf → ext}/windows/eventlog/puppetres.dll +0 -0
  140. data/{conf → ext}/windows/eventlog/puppetres.mc +0 -0
  141. data/ext/windows/service/daemon.bat +6 -0
  142. data/ext/windows/service/daemon.rb +90 -0
  143. data/install.rb +22 -32
  144. data/lib/hiera/backend/puppet_backend.rb +102 -0
  145. data/lib/hiera/scope.rb +42 -0
  146. data/lib/hiera_puppet.rb +89 -0
  147. data/lib/puppet.rb +1 -1
  148. data/lib/puppet/agent.rb +2 -2
  149. data/lib/puppet/agent/locker.rb +12 -9
  150. data/lib/puppet/application.rb +10 -8
  151. data/lib/puppet/application/agent.rb +12 -8
  152. data/lib/puppet/application/apply.rb +2 -2
  153. data/lib/puppet/application/cert.rb +6 -6
  154. data/lib/puppet/application/certificate.rb +1 -4
  155. data/lib/puppet/application/describe.rb +1 -1
  156. data/lib/puppet/application/device.rb +5 -2
  157. data/lib/puppet/application/doc.rb +1 -1
  158. data/lib/puppet/application/face_base.rb +3 -13
  159. data/lib/puppet/application/filebucket.rb +1 -1
  160. data/lib/puppet/application/inspect.rb +1 -1
  161. data/lib/puppet/application/kick.rb +4 -2
  162. data/lib/puppet/application/master.rb +2 -2
  163. data/lib/puppet/application/queue.rb +3 -1
  164. data/lib/puppet/application/resource.rb +1 -1
  165. data/lib/puppet/configurer.rb +11 -7
  166. data/lib/puppet/configurer/downloader.rb +1 -4
  167. data/lib/puppet/daemon.rb +4 -4
  168. data/lib/puppet/defaults.rb +64 -60
  169. data/lib/puppet/external/dot.rb +1 -1
  170. data/lib/puppet/external/pson/common.rb +15 -0
  171. data/lib/puppet/external/pson/pure.rb +0 -62
  172. data/lib/puppet/external/pson/pure/generator.rb +1 -1
  173. data/lib/puppet/external/pson/pure/parser.rb +2 -2
  174. data/lib/puppet/face/ca.rb +19 -14
  175. data/lib/puppet/face/config.rb +2 -2
  176. data/lib/puppet/face/facts.rb +1 -1
  177. data/lib/puppet/face/help/action.erb +0 -1
  178. data/lib/puppet/face/help/face.erb +0 -1
  179. data/lib/puppet/face/help/man.erb +3 -6
  180. data/lib/puppet/face/module/install.rb +1 -1
  181. data/lib/puppet/face/module/list.rb +1 -1
  182. data/lib/puppet/face/module/uninstall.rb +1 -1
  183. data/lib/puppet/face/node.rb +1 -1
  184. data/lib/puppet/face/node/clean.rb +30 -25
  185. data/lib/puppet/feature/base.rb +0 -3
  186. data/lib/puppet/feature/rails.rb +2 -1
  187. data/lib/puppet/file_serving/terminus_selector.rb +1 -1
  188. data/lib/puppet/indirector/catalog/active_record.rb +5 -0
  189. data/lib/puppet/indirector/catalog/static_compiler.rb +2 -3
  190. data/lib/puppet/indirector/certificate/disabled_ca.rb +22 -0
  191. data/lib/puppet/indirector/certificate_request/disabled_ca.rb +22 -0
  192. data/lib/puppet/indirector/certificate_revocation_list/disabled_ca.rb +22 -0
  193. data/lib/puppet/indirector/face.rb +3 -3
  194. data/lib/puppet/indirector/facts/active_record.rb +5 -0
  195. data/lib/puppet/indirector/facts/facter.rb +1 -4
  196. data/lib/puppet/indirector/facts/inventory_active_record.rb +6 -0
  197. data/lib/puppet/indirector/file_bucket_file/file.rb +2 -1
  198. data/lib/puppet/indirector/indirection.rb +2 -2
  199. data/lib/puppet/indirector/key/disabled_ca.rb +22 -0
  200. data/lib/puppet/indirector/node/active_record.rb +5 -0
  201. data/lib/puppet/indirector/request.rb +4 -0
  202. data/lib/puppet/indirector/resource/active_record.rb +5 -0
  203. data/lib/puppet/network/authentication.rb +30 -0
  204. data/lib/puppet/network/http.rb +0 -13
  205. data/lib/puppet/network/http/connection.rb +10 -2
  206. data/lib/puppet/network/http/handler.rb +8 -0
  207. data/lib/puppet/network/http/mongrel/rest.rb +5 -0
  208. data/lib/puppet/network/http/rack/rest.rb +7 -0
  209. data/lib/puppet/network/http/webrick.rb +3 -6
  210. data/lib/puppet/network/http/webrick/rest.rb +4 -0
  211. data/lib/puppet/network/server.rb +9 -33
  212. data/lib/puppet/node.rb +1 -1
  213. data/lib/puppet/node/facts.rb +0 -1
  214. data/lib/puppet/parser/compiler.rb +1 -1
  215. data/lib/puppet/parser/functions.rb +12 -1
  216. data/lib/puppet/parser/functions/hiera.rb +8 -0
  217. data/lib/puppet/parser/functions/hiera_array.rb +8 -0
  218. data/lib/puppet/parser/functions/hiera_hash.rb +8 -0
  219. data/lib/puppet/parser/functions/hiera_include.rb +11 -0
  220. data/lib/puppet/parser/functions/shellquote.rb +21 -29
  221. data/lib/puppet/parser/lexer.rb +2 -1
  222. data/lib/puppet/parser/scope.rb +8 -0
  223. data/lib/puppet/provider/exec/windows.rb +1 -1
  224. data/lib/puppet/provider/group/groupadd.rb +2 -3
  225. data/lib/puppet/provider/package/pkg.rb +37 -10
  226. data/lib/puppet/provider/service/daemontools.rb +1 -1
  227. data/lib/puppet/provider/service/launchd.rb +1 -1
  228. data/lib/puppet/provider/service/redhat.rb +1 -1
  229. data/lib/puppet/provider/service/runit.rb +1 -1
  230. data/lib/puppet/provider/user/useradd.rb +8 -3
  231. data/lib/puppet/provider/user/windows_adsi.rb +11 -0
  232. data/lib/puppet/provider/zfs/zfs.rb +29 -2
  233. data/lib/puppet/provider/zone/solaris.rb +144 -39
  234. data/lib/puppet/provider/zpool/zpool.rb +7 -10
  235. data/lib/puppet/settings.rb +50 -86
  236. data/lib/puppet/settings/duration_setting.rb +34 -0
  237. data/lib/puppet/settings/terminus_setting.rb +16 -0
  238. data/lib/puppet/ssl/base.rb +49 -9
  239. data/lib/puppet/ssl/certificate.rb +13 -9
  240. data/lib/puppet/ssl/certificate_authority.rb +4 -0
  241. data/lib/puppet/ssl/certificate_authority/interface.rb +10 -17
  242. data/lib/puppet/ssl/certificate_factory.rb +4 -21
  243. data/lib/puppet/ssl/certificate_request.rb +1 -10
  244. data/lib/puppet/ssl/certificate_revocation_list.rb +1 -3
  245. data/lib/puppet/ssl/digest.rb +20 -0
  246. data/lib/puppet/ssl/host.rb +31 -6
  247. data/lib/puppet/test/test_helper.rb +1 -1
  248. data/lib/puppet/transaction/report.rb +2 -1
  249. data/lib/puppet/type.rb +1 -1
  250. data/lib/puppet/type/augeas.rb +1 -1
  251. data/lib/puppet/type/cron.rb +1 -1
  252. data/lib/puppet/type/exec.rb +7 -8
  253. data/lib/puppet/type/file.rb +1 -1
  254. data/lib/puppet/type/file/content.rb +2 -2
  255. data/lib/puppet/type/file/ensure.rb +1 -1
  256. data/lib/puppet/type/file/mode.rb +1 -1
  257. data/lib/puppet/type/file/selcontext.rb +6 -2
  258. data/lib/puppet/type/file/source.rb +1 -1
  259. data/lib/puppet/type/schedule.rb +1 -1
  260. data/lib/puppet/type/scheduled_task.rb +1 -1
  261. data/lib/puppet/type/tidy.rb +1 -1
  262. data/lib/puppet/type/zone.rb +126 -253
  263. data/lib/puppet/util.rb +10 -23
  264. data/lib/puppet/util/adsi.rb +22 -14
  265. data/lib/puppet/util/log/destinations.rb +7 -0
  266. data/lib/puppet/util/log/rate_limited_logger.rb +40 -0
  267. data/lib/puppet/util/metric.rb +2 -2
  268. data/lib/puppet/util/monkey_patches.rb +8 -0
  269. data/lib/puppet/util/platform.rb +7 -0
  270. data/lib/puppet/util/selinux.rb +31 -36
  271. data/lib/puppet/util/windows/error.rb +1 -1
  272. data/lib/puppet/util/windows/process.rb +3 -3
  273. data/lib/puppet/util/windows/security.rb +7 -7
  274. data/lib/puppet/util/windows/user.rb +65 -2
  275. data/lib/puppet/util/zaml.rb +90 -46
  276. data/lib/puppet/version.rb +1 -1
  277. data/spec/fixtures/hiera.yaml +9 -0
  278. data/spec/fixtures/manifests/site.pp +0 -0
  279. data/spec/integration/defaults_spec.rb +25 -11
  280. data/spec/integration/faces/ca_spec.rb +11 -16
  281. data/spec/integration/network/server/webrick_spec.rb +14 -27
  282. data/spec/integration/node_spec.rb +4 -1
  283. data/spec/integration/parser/functions/require_spec.rb +3 -3
  284. data/spec/integration/parser/undef_param_spec.rb +88 -0
  285. data/spec/integration/provider/mount_spec.rb +4 -1
  286. data/spec/integration/ssl/certificate_authority_spec.rb +18 -0
  287. data/spec/lib/puppet_spec/files.rb +3 -3
  288. data/spec/lib/puppet_spec/settings.rb +0 -1
  289. data/spec/shared_contexts/platform.rb +8 -0
  290. data/spec/spec_helper.rb +6 -0
  291. data/spec/unit/agent/locker_spec.rb +8 -2
  292. data/spec/unit/application/agent_spec.rb +29 -7
  293. data/spec/unit/application/apply_spec.rb +1 -1
  294. data/spec/unit/application/device_spec.rb +18 -1
  295. data/spec/unit/application/face_base_spec.rb +16 -2
  296. data/spec/unit/application/kick_spec.rb +8 -0
  297. data/spec/unit/application/queue_spec.rb +5 -0
  298. data/spec/unit/application_spec.rb +13 -23
  299. data/spec/unit/configurer/downloader_spec.rb +2 -11
  300. data/spec/unit/configurer_spec.rb +6 -0
  301. data/spec/unit/face/node_spec.rb +1 -1
  302. data/spec/unit/hiera/backend/puppet_backend_spec.rb +140 -0
  303. data/spec/unit/hiera/scope_spec.rb +62 -0
  304. data/spec/unit/hiera_puppet_spec.rb +111 -0
  305. data/spec/unit/indirector/catalog/active_record_spec.rb +4 -0
  306. data/spec/unit/indirector/catalog/static_compiler_spec.rb +194 -0
  307. data/spec/unit/indirector/certificate/disabled_ca_spec.rb +33 -0
  308. data/spec/unit/indirector/certificate_request/disabled_ca_spec.rb +33 -0
  309. data/spec/unit/indirector/certificate_revocation_list/disabled_ca_spec.rb +33 -0
  310. data/spec/unit/indirector/facts/active_record_spec.rb +37 -26
  311. data/spec/unit/indirector/facts/inventory_active_record_spec.rb +5 -0
  312. data/spec/unit/indirector/hiera_spec.rb +2 -1
  313. data/spec/unit/indirector/key/disabled_ca_spec.rb +33 -0
  314. data/spec/unit/indirector/node/active_record_spec.rb +7 -0
  315. data/spec/unit/indirector/request_spec.rb +22 -0
  316. data/spec/unit/indirector/resource/active_record_spec.rb +5 -0
  317. data/spec/unit/module_tool/application_spec.rb +1 -1
  318. data/spec/unit/network/authentication_spec.rb +86 -0
  319. data/spec/unit/network/http/connection_spec.rb +21 -0
  320. data/spec/unit/network/http/handler_spec.rb +12 -0
  321. data/spec/unit/network/http/rack/rest_spec.rb +7 -0
  322. data/spec/unit/network/http/webrick_spec.rb +11 -26
  323. data/spec/unit/network/server_spec.rb +79 -192
  324. data/spec/unit/node/facts_spec.rb +2 -2
  325. data/spec/unit/parser/ast/vardef_spec.rb +4 -4
  326. data/spec/unit/parser/files_spec.rb +3 -0
  327. data/spec/unit/parser/functions/defined_spec.rb +5 -5
  328. data/spec/unit/parser/functions/fqdn_rand_spec.rb +1 -1
  329. data/spec/unit/parser/functions/hiera_array_spec.rb +23 -0
  330. data/spec/unit/parser/functions/hiera_hash_spec.rb +19 -0
  331. data/spec/unit/parser/functions/hiera_include_spec.rb +19 -0
  332. data/spec/unit/parser/functions/hiera_spec.rb +21 -0
  333. data/spec/unit/parser/functions/include_spec.rb +3 -3
  334. data/spec/unit/parser/functions/realize_spec.rb +3 -3
  335. data/spec/unit/parser/functions/require_spec.rb +5 -5
  336. data/spec/unit/parser/functions/shellquote_spec.rb +0 -4
  337. data/spec/unit/parser/functions_spec.rb +6 -10
  338. data/spec/unit/parser/lexer_spec.rb +13 -0
  339. data/spec/unit/parser/scope_spec.rb +16 -1
  340. data/spec/unit/provider/exec/posix_spec.rb +7 -6
  341. data/spec/unit/provider/group/groupadd_spec.rb +36 -30
  342. data/spec/unit/provider/package/pkg_spec.rb +16 -2
  343. data/spec/unit/provider/service/redhat_spec.rb +2 -2
  344. data/spec/unit/provider/sshkey/parsed_spec.rb +4 -0
  345. data/spec/unit/provider/user/user_role_add_spec.rb +125 -126
  346. data/spec/unit/provider/user/useradd_spec.rb +147 -118
  347. data/spec/unit/provider/user/windows_adsi_spec.rb +22 -0
  348. data/spec/unit/provider/zone/solaris_spec.rb +126 -7
  349. data/spec/unit/provider/zpool/zpool_spec.rb +4 -3
  350. data/spec/unit/puppet_spec.rb +7 -0
  351. data/spec/unit/settings/duration_setting_spec.rb +45 -0
  352. data/spec/unit/settings/terminus_setting_spec.rb +28 -0
  353. data/spec/unit/settings_spec.rb +21 -23
  354. data/spec/unit/ssl/base_spec.rb +68 -19
  355. data/spec/unit/ssl/certificate_authority/interface_spec.rb +19 -30
  356. data/spec/unit/ssl/certificate_authority_spec.rb +3 -2
  357. data/spec/unit/ssl/certificate_factory_spec.rb +15 -6
  358. data/spec/unit/ssl/certificate_request_spec.rb +80 -113
  359. data/spec/unit/ssl/certificate_revocation_list_spec.rb +1 -1
  360. data/spec/unit/ssl/certificate_spec.rb +26 -2
  361. data/spec/unit/ssl/digest_spec.rb +35 -0
  362. data/spec/unit/ssl/host_spec.rb +73 -27
  363. data/spec/unit/ssl/key_spec.rb +0 -4
  364. data/spec/unit/type/exec_spec.rb +1 -1
  365. data/spec/unit/type/file_spec.rb +2 -1
  366. data/spec/unit/type/scheduled_task_spec.rb +2 -2
  367. data/spec/unit/type/zone_spec.rb +52 -10
  368. data/spec/unit/util/adsi_spec.rb +19 -0
  369. data/spec/unit/util/checksums_spec.rb +2 -3
  370. data/spec/unit/util/execution_spec.rb +1 -1
  371. data/spec/unit/util/log/destinations_spec.rb +1 -0
  372. data/spec/unit/util/log/rate_limited_logger_spec.rb +51 -0
  373. data/spec/unit/util/logging_spec.rb +6 -6
  374. data/spec/unit/util/selinux_spec.rb +24 -32
  375. data/spec/unit/util/zaml_spec.rb +94 -6
  376. data/spec/unit/util_spec.rb +17 -0
  377. data/spec/watchr.rb +2 -6
  378. data/tasks/{rake/manpages.rake → manpages.rake} +0 -0
  379. data/tasks/{rake/parser.rake → parser.rake} +0 -0
  380. metadata +1003 -119
  381. data/CHANGELOG +0 -9233
  382. data/conf/osx/preflight +0 -24
  383. data/lib/puppet/network/http/mongrel.rb +0 -35
  384. data/lib/puppet/util/config_timeout.rb +0 -24
  385. data/spec/unit/network/http/mongrel/rest_spec.rb +0 -257
  386. data/spec/unit/network/http/mongrel_spec.rb +0 -91
  387. data/spec/unit/network/http_spec.rb +0 -31
  388. data/spec/unit/util/config_timeout_spec.rb +0 -57
  389. data/tasks/rake/apple.rake +0 -176
  390. data/tasks/rake/changelog.rake +0 -15
  391. data/tasks/rake/ci.rake +0 -22
  392. data/tasks/rake/dailybuild.rake +0 -9
  393. data/tasks/rake/gem.rake +0 -63
  394. data/tasks/rake/git_workflow.rake +0 -134
  395. data/tasks/rake/metrics.rake +0 -14
  396. data/tasks/rake/sign.rake +0 -14
  397. data/tasks/rake/testbranch.rake +0 -16
  398. data/tasks/rake/yard.rake +0 -11
@@ -6,7 +6,7 @@
6
6
  # Raketasks and such to set the version based on the output of `git describe`
7
7
  #
8
8
  module Puppet
9
- PUPPETVERSION = '3.0.0-rc5'
9
+ PUPPETVERSION = '3.0.0-rc7'
10
10
 
11
11
  def self.version
12
12
  @puppet_version || PUPPETVERSION
@@ -0,0 +1,9 @@
1
+ ---
2
+ :hierarchy:
3
+ - %{test_suite}
4
+ - spec_hiera
5
+ :backends:
6
+ - yaml
7
+ - puppet
8
+ :yaml:
9
+ :datadir: './spec/fixtures'
File without changes
@@ -107,22 +107,29 @@ describe "Puppet defaults" do
107
107
  Puppet.settings.setting(:hostcert).owner.should == Puppet.settings[:user]
108
108
  end
109
109
 
110
- it "should use a bind address of ''" do
111
- Puppet.settings.clear
112
- Puppet.settings[:bindaddress].should == ""
113
- end
114
-
115
110
  [:modulepath, :factpath].each do |setting|
116
111
  it "should configure '#{setting}' not to be a file setting, so multi-directory settings are acceptable" do
117
112
  Puppet.settings.setting(setting).should be_instance_of(Puppet::Settings::PathSetting)
118
113
  end
119
114
  end
120
115
 
121
- it "should add /usr/sbin and /sbin to the path if they're not there" do
122
- Puppet::Util.withenv("PATH" => "/usr/bin:/usr/local/bin") do
123
- Puppet.settings[:path] = "none" # this causes it to ignore the setting
124
- ENV["PATH"].split(File::PATH_SEPARATOR).should be_include("/usr/sbin")
125
- ENV["PATH"].split(File::PATH_SEPARATOR).should be_include("/sbin")
116
+ describe "on a Unix-like platform it", :as_platform => :posix do
117
+ it "should add /usr/sbin and /sbin to the path if they're not there" do
118
+ Puppet::Util.withenv("PATH" => "/usr/bin#{File::PATH_SEPARATOR}/usr/local/bin") do
119
+ Puppet.settings[:path] = "none" # this causes it to ignore the setting
120
+ ENV["PATH"].split(File::PATH_SEPARATOR).should be_include("/usr/sbin")
121
+ ENV["PATH"].split(File::PATH_SEPARATOR).should be_include("/sbin")
122
+ end
123
+ end
124
+ end
125
+
126
+ describe "on a Windows-like platform it", :as_platform => :windows do
127
+ it "should not add anything" do
128
+ path = "c:\\windows\\system32#{File::PATH_SEPARATOR}c:\\windows"
129
+ Puppet::Util.withenv("PATH" => path) do
130
+ Puppet.settings[:path] = "none" # this causes it to ignore the setting
131
+ ENV["PATH"].should == path
132
+ end
126
133
  end
127
134
  end
128
135
 
@@ -300,7 +307,14 @@ describe "Puppet defaults" do
300
307
  end
301
308
 
302
309
  it "should be set to hiera by default" do
303
- Puppet.settings[:data_binding_terminus].should == 'hiera'
310
+ Puppet.settings[:data_binding_terminus].should == :hiera
311
+ end
312
+ end
313
+
314
+ describe "agent_catalog_run_lockfile" do
315
+ it "(#2888) is not a file setting so it is absent from the Settings catalog" do
316
+ Puppet.settings.setting(:agent_catalog_run_lockfile).should_not be_a_kind_of Puppet::Settings::FileSetting
317
+ Puppet.settings.setting(:agent_catalog_run_lockfile).should be_a Puppet::Settings::StringSetting
304
318
  end
305
319
  end
306
320
  end
@@ -82,6 +82,8 @@ describe Puppet::Face[:ca, '0.1.0'], :unless => Puppet.features.microsoft_window
82
82
  end
83
83
 
84
84
  context "#fingerprint" do
85
+ let(:fingerprint_re) { /^\([0-9A-Z]+\) [0-9A-F:]+$/ }
86
+
85
87
  it "should be nil if there is no certificate" do
86
88
  subject.fingerprint('random-host').should be_nil
87
89
  end
@@ -89,27 +91,20 @@ describe Puppet::Face[:ca, '0.1.0'], :unless => Puppet.features.microsoft_window
89
91
  it "should fingerprint a CSR" do
90
92
  given_certificate_requests_for('random-host')
91
93
 
92
- subject.fingerprint('random-host').should =~ /^[0-9A-F:]+$/
94
+ subject.fingerprint('random-host').should =~ fingerprint_re
93
95
  end
94
96
 
95
97
  it "should fingerprint a certificate" do
96
98
  given_certificates_for('random-host')
97
99
 
98
- subject.fingerprint('random-host').should =~ /^[0-9A-F:]+$/
100
+ subject.fingerprint('random-host').should =~ fingerprint_re
99
101
  end
100
102
 
101
- %w{md5 MD5 sha1 ShA1 SHA1 RIPEMD160 sha256 sha512}.each do |digest|
103
+ %w{md5 MD5 sha1 SHA1 RIPEMD160 sha256 sha512}.each do |digest|
102
104
  it "should fingerprint with #{digest.inspect}" do
103
105
  given_certificates_for('random-host')
104
106
 
105
- subject.fingerprint('random-host', :digest => digest).should =~ /^[0-9A-F:]+$/
106
- end
107
-
108
- it "should fingerprint with #{digest.to_sym} as a symbol" do
109
- given_certificates_for('random-host')
110
-
111
- subject.fingerprint('random-host', :digest => digest.to_sym).
112
- should =~ /^[0-9A-F:]+$/
107
+ subject.fingerprint('random-host', :digest => digest).should =~ fingerprint_re
113
108
  end
114
109
  end
115
110
  end
@@ -228,8 +223,8 @@ describe Puppet::Face[:ca, '0.1.0'], :unless => Puppet.features.microsoft_window
228
223
  subject.revoke('random-host')
229
224
 
230
225
  found = subject.list(:all => true, :subject => 'random-host')
231
- subject.get_action(:list).when_rendering(:console).call(found).
232
- should =~ /^- random-host \([:0-9A-F]+\) \(certificate revoked\)/
226
+ subject.get_action(:list).when_rendering(:console).call(found, {}).
227
+ should =~ /^- random-host \(\w+\) [:0-9A-F]+ \(certificate revoked\)/
233
228
  end
234
229
  end
235
230
 
@@ -260,7 +255,7 @@ describe Puppet::Face[:ca, '0.1.0'], :unless => Puppet.features.microsoft_window
260
255
  subject.list(:signed => true, :subject => 'random-host').should_not == []
261
256
 
262
257
  subject.destroy('random-host').
263
- should == "Deleted for random-host: Puppet::SSL::Certificate, Puppet::SSL::Key"
258
+ should == "Deleted for random-host: Puppet::SSL::Certificate"
264
259
  end
265
260
  end
266
261
 
@@ -282,7 +277,7 @@ describe Puppet::Face[:ca, '0.1.0'], :unless => Puppet.features.microsoft_window
282
277
 
283
278
  context "when_rendering :console" do
284
279
  it "should return nothing for #{type.inspect}" do
285
- subject.get_action(:list).when_rendering(:console).call(subject.list(type)).should == ""
280
+ subject.get_action(:list).when_rendering(:console).call(subject.list(type), {}).should == ""
286
281
  end
287
282
  end
288
283
  end
@@ -330,7 +325,7 @@ describe Puppet::Face[:ca, '0.1.0'], :unless => Puppet.features.microsoft_window
330
325
  given_certificate_requests_for(*input[0])
331
326
  given_certificates_for(*input[1])
332
327
 
333
- text = subject.get_action(:list).when_rendering(:console).call(subject.list(:all => true))
328
+ text = subject.get_action(:list).when_rendering(:console).call(subject.list(:all => true), {})
334
329
 
335
330
  pattern.each do |item|
336
331
  text.should =~ item
@@ -5,19 +5,17 @@ require 'puppet/ssl/certificate_authority'
5
5
  require 'socket'
6
6
 
7
7
  describe Puppet::Network::Server, :unless => Puppet.features.microsoft_windows? do
8
+ describe "when using webrick" do
8
9
  include PuppetSpec::Files
9
10
 
10
- # This reduces the odds of conflicting port numbers between concurrent runs
11
- # of the suite on the same machine dramatically.
12
- def port
13
- 20000 + ($$ % 40000)
14
- end
11
+ # This reduces the odds of conflicting port numbers between concurrent runs
12
+ # of the suite on the same machine dramatically.
13
+ let(:port) { 20000 + ($$ % 40000) }
14
+ let(:handlers) { [:node] }
15
+ let(:address) { '127.0.0.1' }
15
16
 
16
- describe "when using webrick" do
17
17
  before :each do
18
- Puppet[:servertype] = 'webrick'
19
18
  Puppet[:server] = '127.0.0.1'
20
- @params = { :port => port, :handlers => [ :node ] }
21
19
 
22
20
  # Get a safe temporary file
23
21
  dir = tmpdir("webrick_integration_testing")
@@ -31,46 +29,36 @@ describe Puppet::Network::Server, :unless => Puppet.features.microsoft_windows?
31
29
 
32
30
  ca = Puppet::SSL::CertificateAuthority.new
33
31
  ca.generate(Puppet[:certname]) unless Puppet::SSL::Certificate.indirection.find(Puppet[:certname])
32
+
33
+ @server = Puppet::Network::Server.new(address, port, handlers)
34
34
  end
35
35
 
36
36
  after do
37
- Puppet.settings.clear
38
-
39
37
  Puppet::SSL::Host.ca_location = :none
40
38
  end
41
39
 
42
40
  describe "before listening" do
43
41
  it "should not be reachable at the specified address and port" do
44
- lambda { TCPSocket.new('127.0.0.1', port) }.should raise_error
42
+ expect { TCPSocket.new('127.0.0.1', port) }.to raise_error
45
43
  end
46
44
  end
47
45
 
48
46
  describe "when listening" do
49
47
  it "should be reachable on the specified address and port" do
50
- @server = Puppet::Network::Server.new(@params.merge(:port => port))
51
48
  @server.listen
52
- lambda { TCPSocket.new('127.0.0.1', port) }.should_not raise_error
53
- end
54
-
55
- it "should default to '0.0.0.0' as its bind address" do
56
- Puppet.settings.clear
57
- Puppet[:servertype] = 'webrick'
58
- Puppet[:bindaddress].should == '0.0.0.0'
49
+ expect { TCPSocket.new('127.0.0.1', port) }.to_not raise_error
59
50
  end
60
51
 
61
52
  it "should use any specified bind address" do
62
- Puppet[:bindaddress] = "127.0.0.1"
63
- @server = Puppet::Network::Server.new(@params.merge(:port => port))
64
53
  @server.stubs(:unlisten) # we're breaking listening internally, so we have to keep it from unlistening
65
- @server.send(:http_server).expects(:listen).with { |args| args[:address] == "127.0.0.1" }
54
+ Puppet::Network::HTTP::WEBrick.any_instance.expects(:listen).with(address, port)
66
55
  @server.listen
67
56
  end
68
57
 
69
58
  it "should not allow multiple servers to listen on the same address and port" do
70
- @server = Puppet::Network::Server.new(@params.merge(:port => port))
71
59
  @server.listen
72
- @server2 = Puppet::Network::Server.new(@params.merge(:port => port))
73
- lambda { @server2.listen }.should raise_error
60
+ server2 = Puppet::Network::Server.new(address, port, handlers)
61
+ expect { server2.listen }.to raise_error
74
62
  end
75
63
 
76
64
  after :each do
@@ -80,10 +68,9 @@ describe Puppet::Network::Server, :unless => Puppet.features.microsoft_windows?
80
68
 
81
69
  describe "after unlistening" do
82
70
  it "should not be reachable on the port and address assigned" do
83
- @server = Puppet::Network::Server.new(@params.merge(:port => port))
84
71
  @server.listen
85
72
  @server.unlisten
86
- lambda { TCPSocket.new('127.0.0.1', port) }.should raise_error(Errno::ECONNREFUSED)
73
+ expect { TCPSocket.new('127.0.0.1', port) }.to raise_error(Errno::ECONNREFUSED)
87
74
  end
88
75
  end
89
76
  end
@@ -43,12 +43,15 @@ describe Puppet::Node do
43
43
  describe "and using the memory terminus" do
44
44
  before do
45
45
  @name = "me"
46
- @old_terminus = Puppet::Node.indirection.terminus_class
47
46
  @terminus = Puppet::Node.indirection.terminus(:memory)
48
47
  Puppet::Node.indirection.stubs(:terminus).returns @terminus
49
48
  @node = Puppet::Node.new(@name)
50
49
  end
51
50
 
51
+ after do
52
+ @terminus.instance_variable_set(:@instances, {})
53
+ end
54
+
52
55
  it "should find no nodes by default" do
53
56
  Puppet::Node.indirection.find(@name).should be_nil
54
57
  end
@@ -17,7 +17,7 @@ describe "The require function" do
17
17
  it "should add a dependency between the 'required' class and our class" do
18
18
  @compiler.known_resource_types.add Puppet::Resource::Type.new(:hostclass, "requiredclass")
19
19
 
20
- @scope.function_require("requiredclass")
20
+ @scope.function_require(["requiredclass"])
21
21
  @scope.resource["require"].should_not be_nil
22
22
  ref = @scope.resource["require"].shift
23
23
  ref.type.should == "Class"
@@ -28,8 +28,8 @@ describe "The require function" do
28
28
  @compiler.known_resource_types.add Puppet::Resource::Type.new(:hostclass, "requiredclass1")
29
29
  @compiler.known_resource_types.add Puppet::Resource::Type.new(:hostclass, "requiredclass2")
30
30
 
31
- @scope.function_require("requiredclass1")
32
- @scope.function_require("requiredclass2")
31
+ @scope.function_require(["requiredclass1"])
32
+ @scope.function_require(["requiredclass2"])
33
33
 
34
34
  @scope.resource["require"].should_not be_nil
35
35
 
@@ -0,0 +1,88 @@
1
+ require 'spec_helper'
2
+ require 'puppet_spec/compiler'
3
+
4
+ describe "Undefined parameters should be handled so that" do
5
+ include PuppetSpec::Compiler
6
+
7
+ def expect_the_message_to_be(message, node = Puppet::Node.new('the node'))
8
+ catalog = compile_to_catalog(yield, node)
9
+ catalog.resource('Notify', 'something')[:message].should == message
10
+ end
11
+
12
+ def expect_puppet_error(message, node = Puppet::Node.new('the node'))
13
+ expect { compile_to_catalog(yield, node) }.to raise_error(Puppet::Error, message)
14
+ end
15
+ before :each do
16
+ Puppet.expects(:deprecation_warning).never
17
+ end
18
+
19
+ describe "when a value is given as parameter value" do
20
+ it "it should override the default" do
21
+ expect_the_message_to_be('2') do <<-MANIFEST
22
+ node default {
23
+ include foo
24
+ }
25
+ class foo {
26
+ define a($x=1) { notify { 'something': message => $x }}
27
+ a {'a': x => 2}
28
+ }
29
+ MANIFEST
30
+ end
31
+ end
32
+ end
33
+
34
+ describe "when 'undef' is given as parameter value" do
35
+ it "the value should be set to 'undef'" do
36
+ expect_the_message_to_be(true) do <<-MANIFEST
37
+ node default {
38
+ include foo
39
+ }
40
+ class foo {
41
+ define a($x=1) { notify { 'something': message => $x == undef }}
42
+ a {'a': x => undef}
43
+ }
44
+ MANIFEST
45
+ end
46
+ end
47
+ end
48
+
49
+ describe "when no value is given for a parameter" do
50
+ it "the value should be set to the default" do
51
+ expect_the_message_to_be('1') do <<-MANIFEST
52
+ node default {
53
+ include foo
54
+ }
55
+ class foo {
56
+ define a($x=1) { notify { 'something': message => $x }}
57
+ a {'a': }
58
+ }
59
+ MANIFEST
60
+ end
61
+ end
62
+ it "and the default is set to undef, the value should be set to the default" do
63
+ expect_the_message_to_be(true) do <<-MANIFEST
64
+ node default {
65
+ include foo
66
+ }
67
+ class foo {
68
+ define a($x=undef) { notify { 'something': message => $x == undef}}
69
+ a {'a': }
70
+ }
71
+ MANIFEST
72
+ end
73
+ end
74
+
75
+ it "and no default is set should fail with error" do
76
+ expect_puppet_error(/^Must pass x to Foo::A\[a\].*/) do <<-MANIFEST
77
+ node default {
78
+ include foo
79
+ }
80
+ class foo {
81
+ define a($x) { notify { 'something': message => $x }}
82
+ a {'a': }
83
+ }
84
+ MANIFEST
85
+ end
86
+ end
87
+ end
88
+ end
@@ -5,6 +5,8 @@ require 'puppet/file_bucket/dipper'
5
5
  describe "mount provider (integration)", :unless => Puppet.features.microsoft_windows? do
6
6
  include PuppetSpec::Files
7
7
 
8
+ family = Facter.value(:osfamily)
9
+
8
10
  def create_fake_fstab(initially_contains_entry)
9
11
  File.open(@fake_fstab, 'w') do |f|
10
12
  if initially_contains_entry
@@ -19,6 +21,7 @@ describe "mount provider (integration)", :unless => Puppet.features.microsoft_wi
19
21
  @current_device = "/dev/disk1s1"
20
22
  Puppet::Type.type(:mount).defaultprovider.stubs(:default_target).returns(@fake_fstab)
21
23
  Facter.stubs(:value).with(:operatingsystem).returns('Darwin')
24
+ Facter.stubs(:value).with(:osfamily).returns('Darwin')
22
25
  Puppet::Util::ExecutionStub.set do |command, options|
23
26
  case command[0]
24
27
  when %r{/s?bin/mount}
@@ -107,7 +110,7 @@ describe "mount provider (integration)", :unless => Puppet.features.microsoft_wi
107
110
  ["local", "journaled"].each do |options_setting|
108
111
  describe "When setting options => #{options_setting}" do
109
112
  it "should leave the system in the #{expected_final_state ? 'mounted' : 'unmounted'} state, #{expected_fstab_data ? 'with' : 'without'} data in /etc/fstab" do
110
- pending("Solaris: The mock :operatingsystem value does not get changed in lib/puppet/provider/mount/parsed.rb", Facter[:osfamily] == "Solaris")
113
+ pending("Solaris: The mock :operatingsystem value does not get changed in lib/puppet/provider/mount/parsed.rb", :if => family == "Solaris")
111
114
  @desired_options = options_setting
112
115
  run_in_catalog(:ensure=>ensure_setting, :options => options_setting)
113
116
  @mounted.should == expected_final_state
@@ -122,5 +122,23 @@ describe Puppet::SSL::CertificateAuthority, :unless => Puppet.features.microsoft
122
122
  $CHILD_STATUS.should == 0
123
123
  end
124
124
  end
125
+
126
+ it "should verify proof of possession when signing certificates" do
127
+ csr = @host.certificate_request
128
+ wrong_key = Puppet::SSL::Key.new(@host.name)
129
+ wrong_key.generate
130
+
131
+ csr.content.public_key = wrong_key.content.public_key
132
+ # The correct key has to be removed so we can save the incorrect one
133
+ Puppet::SSL::CertificateRequest.indirection.destroy(@host.name)
134
+ Puppet::SSL::CertificateRequest.indirection.save(csr)
135
+
136
+ expect {
137
+ @ca.sign(@host.name)
138
+ }.to raise_error(
139
+ Puppet::SSL::CertificateAuthority::CertificateSigningError,
140
+ "CSR contains a public key that does not correspond to the signing key"
141
+ )
142
+ end
125
143
  end
126
144
  end
@@ -36,10 +36,10 @@ module PuppetSpec::Files
36
36
  path
37
37
  end
38
38
 
39
- def tmpfile(name) PuppetSpec::Files.tmpfile(name) end
40
- def self.tmpfile(name)
39
+ def tmpfile(name, dir = nil) PuppetSpec::Files.tmpfile(name, dir) end
40
+ def self.tmpfile(name, dir = nil)
41
41
  # Generate a temporary file, just for the name...
42
- source = Tempfile.new(name)
42
+ source = dir ? Tempfile.new(name, dir) : Tempfile.new(name)
43
43
  path = source.path
44
44
  source.close!
45
45
 
@@ -6,7 +6,6 @@ module PuppetSpec::Settings
6
6
  # to this already very large changeset.
7
7
  # Would be nice to clean this up later. --cprice 2012-03-20
8
8
  TEST_APP_DEFAULT_DEFINITIONS = {
9
- :run_mode => { :default => :test, :desc => "run mode" },
10
9
  :name => { :default => "test", :desc => "name" },
11
10
  :logdir => { :type => :directory, :default => "test", :desc => "logdir" },
12
11
  :confdir => { :type => :directory, :default => "test", :desc => "confdir" },
@@ -12,13 +12,17 @@ shared_context "windows", :as_platform => :windows do
12
12
 
13
13
  around do |example|
14
14
  file_alt_separator = File::ALT_SEPARATOR
15
+ file_path_separator = File::PATH_SEPARATOR
16
+
15
17
  # prevent Ruby from warning about changing a constant
16
18
  with_verbose_disabled do
17
19
  File::ALT_SEPARATOR = '\\'
20
+ File::PATH_SEPARATOR = ';'
18
21
  end
19
22
  example.run
20
23
  with_verbose_disabled do
21
24
  File::ALT_SEPARATOR = file_alt_separator
25
+ File::PATH_SEPARATOR = file_path_separator
22
26
  end
23
27
  end
24
28
  end
@@ -31,13 +35,17 @@ shared_context "posix", :as_platform => :posix do
31
35
 
32
36
  around do |example|
33
37
  file_alt_separator = File::ALT_SEPARATOR
38
+ file_path_separator = File::PATH_SEPARATOR
39
+
34
40
  # prevent Ruby from warning about changing a constant
35
41
  with_verbose_disabled do
36
42
  File::ALT_SEPARATOR = nil
43
+ File::PATH_SEPARATOR = ':'
37
44
  end
38
45
  example.run
39
46
  with_verbose_disabled do
40
47
  File::ALT_SEPARATOR = file_alt_separator
48
+ File::PATH_SEPARATOR = file_path_separator
41
49
  end
42
50
  end
43
51
  end