puppet 2.7.19 → 2.7.20.rc1

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 (324) hide show
  1. data/CONTRIBUTING.md +61 -238
  2. data/Gemfile +32 -0
  3. data/Gemfile.lock +44 -0
  4. data/LICENSE +1 -1
  5. data/README_DEVELOPER.md +300 -5
  6. data/Rakefile +41 -37
  7. data/ext/build_defaults.yaml +20 -0
  8. data/ext/debian/README.Debian +8 -0
  9. data/ext/debian/README.source +2 -0
  10. data/ext/debian/TODO.Debian +1 -0
  11. data/ext/debian/changelog.erb +1104 -0
  12. data/ext/debian/compat +1 -0
  13. data/ext/debian/control +142 -0
  14. data/ext/debian/copyright +361 -0
  15. data/ext/debian/docs +1 -0
  16. data/ext/debian/fileserver.conf +17 -0
  17. data/ext/debian/puppet-common.dirs +8 -0
  18. data/ext/debian/puppet-common.install +3 -0
  19. data/ext/debian/puppet-common.lintian-overrides +7 -0
  20. data/ext/debian/puppet-common.manpages +2 -0
  21. data/ext/debian/puppet-common.postinst +35 -0
  22. data/ext/debian/puppet-common.postrm +32 -0
  23. data/ext/debian/puppet-el.dirs +1 -0
  24. data/ext/debian/puppet-el.emacsen-install +25 -0
  25. data/ext/debian/puppet-el.emacsen-remove +11 -0
  26. data/ext/debian/puppet-el.emacsen-startup +9 -0
  27. data/ext/debian/puppet-el.install +1 -0
  28. data/ext/debian/puppet-testsuite.install +3 -0
  29. data/ext/debian/puppet-testsuite.lintian-overrides +4 -0
  30. data/ext/debian/puppet.NEWS +86 -0
  31. data/ext/debian/puppet.conf +14 -0
  32. data/ext/debian/puppet.default +7 -0
  33. data/ext/debian/puppet.dirs +1 -0
  34. data/ext/debian/puppet.init +118 -0
  35. data/ext/debian/puppet.install +4 -0
  36. data/ext/debian/puppet.lintian-overrides +3 -0
  37. data/ext/debian/puppet.logrotate +11 -0
  38. data/ext/debian/puppet.manpages +36 -0
  39. data/ext/debian/puppet.postinst +20 -0
  40. data/ext/debian/puppet.postrm +20 -0
  41. data/ext/debian/puppet.preinst +20 -0
  42. data/ext/debian/puppetmaster-common.install +5 -0
  43. data/ext/debian/puppetmaster-common.manpages +5 -0
  44. data/ext/debian/puppetmaster-common.puppetqd.default +27 -0
  45. data/ext/debian/puppetmaster-common.puppetqd.init +84 -0
  46. data/ext/debian/puppetmaster-passenger.dirs +4 -0
  47. data/ext/debian/puppetmaster-passenger.postinst +66 -0
  48. data/ext/debian/puppetmaster-passenger.postrm +33 -0
  49. data/ext/debian/puppetmaster.NEWS +13 -0
  50. data/ext/debian/puppetmaster.README.debian +16 -0
  51. data/ext/debian/puppetmaster.default +38 -0
  52. data/ext/debian/puppetmaster.dirs +1 -0
  53. data/ext/debian/puppetmaster.init +158 -0
  54. data/ext/debian/puppetmaster.install +1 -0
  55. data/ext/debian/puppetmaster.lintian-overrides +3 -0
  56. data/ext/debian/puppetmaster.manpages +1 -0
  57. data/ext/debian/puppetmaster.postinst +20 -0
  58. data/ext/debian/puppetmaster.postrm +5 -0
  59. data/ext/debian/puppetmaster.preinst +22 -0
  60. data/ext/debian/rules +127 -0
  61. data/ext/debian/source/format +1 -0
  62. data/ext/debian/source/options +1 -0
  63. data/ext/debian/vim-puppet.README.Debian +13 -0
  64. data/ext/debian/vim-puppet.dirs +3 -0
  65. data/ext/debian/vim-puppet.yaml +5 -0
  66. data/ext/debian/watch +2 -0
  67. data/ext/emacs/puppet-mode.el +1 -0
  68. data/{conf → ext}/osx/PackageInfo.plist +0 -0
  69. data/{conf → ext}/osx/createpackage.sh +0 -0
  70. data/ext/osx/file_mapping.yaml +38 -0
  71. data/ext/osx/preflight.erb +37 -0
  72. data/{tasks/rake/templates → ext/osx}/prototype.plist.erb +0 -0
  73. data/ext/packaging/README-Solaris.md +117 -0
  74. data/ext/packaging/README.md +255 -0
  75. data/ext/packaging/spec/spec_helper.rb +12 -0
  76. data/ext/packaging/spec/tasks/00_utils_spec.rb +66 -0
  77. data/ext/packaging/tasks/00_utils.rake +382 -0
  78. data/ext/packaging/tasks/10_setupvars.rake +71 -0
  79. data/ext/packaging/tasks/20_setupextravars.rake +25 -0
  80. data/ext/packaging/tasks/apple.rake +201 -0
  81. data/ext/packaging/tasks/clean.rake +5 -0
  82. data/ext/packaging/tasks/deb.rake +108 -0
  83. data/ext/packaging/tasks/doc.rake +20 -0
  84. data/ext/packaging/tasks/fetch.rake +18 -0
  85. data/ext/packaging/tasks/gem.rake +68 -0
  86. data/ext/packaging/tasks/ips.rake +80 -0
  87. data/ext/packaging/tasks/mock.rake +126 -0
  88. data/ext/packaging/tasks/pe_deb.rake +9 -0
  89. data/ext/packaging/tasks/pe_remote.rake +45 -0
  90. data/ext/packaging/tasks/pe_rpm.rake +21 -0
  91. data/ext/packaging/tasks/pe_ship.rake +30 -0
  92. data/ext/packaging/tasks/pe_sign.rake +27 -0
  93. data/ext/packaging/tasks/pe_sles.rake +96 -0
  94. data/ext/packaging/tasks/release.rake +73 -0
  95. data/ext/packaging/tasks/remote_build.rake +78 -0
  96. data/ext/packaging/tasks/rpm.rake +52 -0
  97. data/ext/packaging/tasks/ship.rake +78 -0
  98. data/ext/packaging/tasks/sign.rake +82 -0
  99. data/ext/packaging/tasks/tag.rake +8 -0
  100. data/ext/packaging/tasks/tar.rake +68 -0
  101. data/ext/packaging/tasks/template.rake +13 -0
  102. data/ext/packaging/tasks/update.rake +16 -0
  103. data/ext/packaging/tasks/version.rake +21 -0
  104. data/ext/project_data.yaml +24 -0
  105. data/{conf/redhat/puppet.spec → ext/redhat/puppet.spec.erb} +18 -10
  106. data/install.rb +8 -8
  107. data/lib/puppet.rb +2 -6
  108. data/lib/puppet/agent/locker.rb +2 -0
  109. data/lib/puppet/application.rb +1 -1
  110. data/lib/puppet/application/agent.rb +1 -1
  111. data/lib/puppet/application/apply.rb +1 -1
  112. data/lib/puppet/application/cert.rb +5 -6
  113. data/lib/puppet/application/describe.rb +1 -1
  114. data/lib/puppet/application/device.rb +1 -1
  115. data/lib/puppet/application/doc.rb +1 -1
  116. data/lib/puppet/application/filebucket.rb +1 -1
  117. data/lib/puppet/application/inspect.rb +1 -1
  118. data/lib/puppet/application/kick.rb +1 -1
  119. data/lib/puppet/application/master.rb +1 -1
  120. data/lib/puppet/application/resource.rb +1 -1
  121. data/lib/puppet/defaults.rb +21 -3
  122. data/lib/puppet/external/dot.rb +1 -1
  123. data/lib/puppet/face/help/global.erb +1 -1
  124. data/lib/puppet/face/module/install.rb +1 -1
  125. data/lib/puppet/face/module/list.rb +1 -1
  126. data/lib/puppet/face/module/uninstall.rb +1 -1
  127. data/lib/puppet/face/node/clean.rb +23 -18
  128. data/lib/puppet/face/parser.rb +11 -2
  129. data/lib/puppet/file_collection.rb +16 -27
  130. data/lib/puppet/file_collection/lookup.rb +6 -16
  131. data/lib/puppet/file_serving/base.rb +4 -4
  132. data/lib/puppet/indirector/catalog/static_compiler.rb +3 -4
  133. data/lib/puppet/indirector/certificate/disabled_ca.rb +22 -0
  134. data/lib/puppet/indirector/certificate_request/disabled_ca.rb +22 -0
  135. data/lib/puppet/indirector/certificate_revocation_list/disabled_ca.rb +22 -0
  136. data/lib/puppet/indirector/face.rb +2 -2
  137. data/lib/puppet/indirector/key/disabled_ca.rb +22 -0
  138. data/lib/puppet/indirector/node/exec.rb +13 -1
  139. data/lib/puppet/indirector/request.rb +4 -0
  140. data/lib/puppet/metatype/manager.rb +17 -10
  141. data/lib/puppet/network/authstore.rb +1 -1
  142. data/lib/puppet/network/rights.rb +1 -2
  143. data/lib/puppet/node/environment.rb +1 -0
  144. data/lib/puppet/parameter/value.rb +9 -3
  145. data/lib/puppet/parser/ast.rb +1 -4
  146. data/lib/puppet/parser/files.rb +1 -1
  147. data/lib/puppet/parser/functions.rb +68 -22
  148. data/lib/puppet/parser/functions/create_resources.rb +2 -3
  149. data/lib/puppet/parser/functions/shellquote.rb +21 -25
  150. data/lib/puppet/parser/lexer.rb +40 -6
  151. data/lib/puppet/parser/relationship.rb +3 -1
  152. data/lib/puppet/parser/resource.rb +2 -3
  153. data/lib/puppet/parser/resource/param.rb +3 -5
  154. data/lib/puppet/parser/scope.rb +7 -4
  155. data/lib/puppet/property.rb +5 -3
  156. data/lib/puppet/provider.rb +5 -5
  157. data/lib/puppet/provider/aixobject.rb +1 -1
  158. data/lib/puppet/provider/augeas/augeas.rb +1 -1
  159. data/lib/puppet/provider/exec/windows.rb +1 -1
  160. data/lib/puppet/provider/file/windows.rb +10 -29
  161. data/lib/puppet/provider/group/groupadd.rb +2 -3
  162. data/lib/puppet/provider/group/ldap.rb +1 -1
  163. data/lib/puppet/provider/group/windows_adsi.rb +1 -1
  164. data/lib/puppet/provider/ldap.rb +5 -1
  165. data/lib/puppet/provider/nameservice.rb +3 -3
  166. data/lib/puppet/provider/nameservice/directoryservice.rb +2 -2
  167. data/lib/puppet/provider/package/gem.rb +6 -2
  168. data/lib/puppet/provider/package/portage.rb +4 -2
  169. data/lib/puppet/provider/parsedfile.rb +1 -1
  170. data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +2 -2
  171. data/lib/puppet/provider/service/base.rb +2 -41
  172. data/lib/puppet/provider/service/daemontools.rb +1 -1
  173. data/lib/puppet/provider/service/launchd.rb +1 -1
  174. data/lib/puppet/provider/service/redhat.rb +6 -5
  175. data/lib/puppet/provider/service/runit.rb +1 -1
  176. data/lib/puppet/provider/service/service.rb +43 -0
  177. data/lib/puppet/provider/service/windows.rb +1 -8
  178. data/lib/puppet/provider/user/user_role_add.rb +2 -1
  179. data/lib/puppet/provider/user/useradd.rb +8 -3
  180. data/lib/puppet/provider/user/windows_adsi.rb +12 -1
  181. data/lib/puppet/provider/zone/solaris.rb +1 -1
  182. data/lib/puppet/rails/inventory_node.rb +26 -13
  183. data/lib/puppet/reports.rb +1 -1
  184. data/lib/puppet/resource.rb +20 -5
  185. data/lib/puppet/resource/status.rb +1 -1
  186. data/lib/puppet/ssl/certificate_authority.rb +2 -0
  187. data/lib/puppet/ssl/host.rb +31 -6
  188. data/lib/puppet/test/test_helper.rb +3 -1
  189. data/lib/puppet/transaction/event.rb +1 -1
  190. data/lib/puppet/transaction/report.rb +2 -2
  191. data/lib/puppet/type.rb +30 -25
  192. data/lib/puppet/type/augeas.rb +1 -1
  193. data/lib/puppet/type/cron.rb +2 -2
  194. data/lib/puppet/type/exec.rb +6 -6
  195. data/lib/puppet/type/file.rb +5 -15
  196. data/lib/puppet/type/file/content.rb +1 -1
  197. data/lib/puppet/type/file/ensure.rb +1 -1
  198. data/lib/puppet/type/file/mode.rb +1 -1
  199. data/lib/puppet/type/file/selcontext.rb +6 -2
  200. data/lib/puppet/type/file/source.rb +1 -1
  201. data/lib/puppet/type/mount.rb +1 -1
  202. data/lib/puppet/type/package.rb +1 -1
  203. data/lib/puppet/type/schedule.rb +1 -1
  204. data/lib/puppet/type/scheduled_task.rb +1 -1
  205. data/lib/puppet/type/tidy.rb +1 -1
  206. data/lib/puppet/type/whit.rb +16 -9
  207. data/lib/puppet/util.rb +27 -11
  208. data/lib/puppet/util/adsi.rb +25 -23
  209. data/lib/puppet/util/autoload.rb +1 -1
  210. data/lib/puppet/util/classgen.rb +1 -1
  211. data/lib/puppet/util/feature.rb +3 -1
  212. data/lib/puppet/util/fileparsing.rb +9 -9
  213. data/lib/puppet/util/filetype.rb +55 -40
  214. data/lib/puppet/util/instance_loader.rb +5 -5
  215. data/lib/puppet/util/instrumentation.rb +3 -5
  216. data/lib/puppet/util/log_paths.rb +1 -3
  217. data/lib/puppet/util/monkey_patches.rb +34 -8
  218. data/lib/puppet/util/platform.rb +7 -0
  219. data/lib/puppet/util/posix.rb +3 -3
  220. data/lib/puppet/util/provider_features.rb +2 -3
  221. data/lib/puppet/util/rdoc.rb +4 -3
  222. data/lib/puppet/util/reference.rb +1 -1
  223. data/lib/puppet/util/selinux.rb +31 -36
  224. data/lib/puppet/util/tagging.rb +28 -6
  225. data/lib/puppet/util/windows.rb +1 -0
  226. data/lib/puppet/util/windows/error.rb +1 -1
  227. data/lib/puppet/util/windows/process.rb +3 -3
  228. data/lib/puppet/util/windows/security.rb +9 -46
  229. data/lib/puppet/util/windows/sid.rb +96 -0
  230. data/lib/puppet/util/windows/user.rb +65 -2
  231. data/lib/puppet/util/zaml.rb +109 -59
  232. data/lib/puppet/version.rb +18 -0
  233. data/spec/fixtures/unit/util/filetype/aixtab_output +44 -0
  234. data/spec/fixtures/unit/util/filetype/suntab_output +9 -0
  235. data/spec/integration/defaults_spec.rb +26 -7
  236. data/spec/integration/parser/functions_spec.rb +0 -4
  237. data/spec/integration/util/file_locking_spec.rb +1 -1
  238. data/spec/integration/util/windows/security_spec.rb +3 -23
  239. data/spec/lib/puppet_spec/files.rb +3 -3
  240. data/spec/shared_contexts/platform.rb +8 -0
  241. data/spec/spec_helper.rb +6 -1
  242. data/spec/unit/application/queue_spec.rb +2 -1
  243. data/spec/unit/configurer_spec.rb +1 -1
  244. data/spec/unit/face/{instrumentation_data.rb → instrumentation_data_spec.rb} +0 -0
  245. data/spec/unit/face/{instrumentation_listener.rb → instrumentation_listener_spec.rb} +0 -0
  246. data/spec/unit/face/{instrumentation_probe.rb → instrumentation_probe_spec.rb} +0 -0
  247. data/spec/unit/indirector/catalog/static_compiler_spec.rb +194 -0
  248. data/spec/unit/indirector/certificate/disabled_ca_spec.rb +33 -0
  249. data/spec/unit/indirector/certificate_request/disabled_ca_spec.rb +33 -0
  250. data/spec/unit/indirector/certificate_revocation_list/disabled_ca_spec.rb +33 -0
  251. data/spec/unit/indirector/key/disabled_ca_spec.rb +33 -0
  252. data/spec/unit/indirector/request_spec.rb +22 -0
  253. data/spec/unit/network/http/webrick_spec.rb +0 -7
  254. data/spec/unit/node/environment_spec.rb +8 -8
  255. data/spec/unit/parser/ast_spec.rb +0 -5
  256. data/spec/unit/parser/collector_spec.rb +1 -0
  257. data/spec/unit/parser/files_spec.rb +2 -2
  258. data/spec/unit/parser/functions/create_resources_spec.rb +3 -4
  259. data/spec/unit/parser/functions/require_spec.rb +0 -6
  260. data/spec/unit/parser/functions/shellquote_spec.rb +0 -5
  261. data/spec/unit/parser/functions/template_spec.rb +6 -1
  262. data/spec/unit/parser/functions_spec.rb +73 -23
  263. data/spec/unit/parser/lexer_spec.rb +133 -8
  264. data/spec/unit/parser/relationship_spec.rb +24 -0
  265. data/spec/unit/parser/resource_spec.rb +0 -4
  266. data/spec/unit/parser/scope_spec.rb +2 -2
  267. data/spec/unit/property_spec.rb +21 -1
  268. data/spec/unit/provider/exec/posix_spec.rb +7 -6
  269. data/spec/unit/provider/file/windows_spec.rb +29 -29
  270. data/spec/unit/provider/group/groupadd_spec.rb +36 -30
  271. data/spec/unit/provider/group/windows_adsi_spec.rb +2 -2
  272. data/spec/unit/provider/package/gem_spec.rb +12 -0
  273. data/spec/unit/provider/scheduled_task/win32_taskscheduler_spec.rb +14 -11
  274. data/spec/unit/provider/service/redhat_spec.rb +11 -1
  275. data/spec/unit/provider/service/windows_spec.rb +19 -0
  276. data/spec/unit/provider/user/ldap_spec.rb +22 -8
  277. data/spec/unit/provider/user/user_role_add_spec.rb +12 -0
  278. data/spec/unit/provider/user/useradd_spec.rb +146 -118
  279. data/spec/unit/provider/user/windows_adsi_spec.rb +24 -2
  280. data/spec/unit/puppet_spec.rb +10 -0
  281. data/spec/unit/resource/status_spec.rb +1 -1
  282. data/spec/unit/resource_spec.rb +73 -0
  283. data/spec/unit/ssl/certificate_authority_spec.rb +25 -1
  284. data/spec/unit/ssl/host_spec.rb +73 -27
  285. data/spec/unit/ssl/key_spec.rb +0 -4
  286. data/spec/unit/transaction/event_spec.rb +1 -1
  287. data/spec/unit/type/exec_spec.rb +1 -1
  288. data/spec/unit/type/file/content_spec.rb +6 -4
  289. data/spec/unit/type/file/{ctime.rb → ctime_spec.rb} +0 -0
  290. data/spec/unit/type/file/{mtime.rb → mtime_spec.rb} +0 -0
  291. data/spec/unit/type/file/{type.rb → type_spec.rb} +0 -0
  292. data/spec/unit/type/file_spec.rb +2 -12
  293. data/spec/unit/type/host_spec.rb +14 -5
  294. data/spec/unit/type/mount_spec.rb +8 -0
  295. data/spec/unit/type/scheduled_task_spec.rb +2 -2
  296. data/spec/unit/util/adsi_spec.rb +23 -8
  297. data/spec/unit/util/command_line_spec.rb +11 -2
  298. data/spec/unit/util/feature_spec.rb +12 -1
  299. data/spec/unit/util/filetype_spec.rb +161 -55
  300. data/spec/unit/util/log_spec.rb +1 -1
  301. data/spec/unit/util/monkey_patches_spec.rb +7 -0
  302. data/spec/unit/util/rdoc_spec.rb +8 -2
  303. data/spec/unit/util/selinux_spec.rb +24 -32
  304. data/spec/unit/util/windows/sid_spec.rb +100 -0
  305. data/spec/unit/util/zaml_spec.rb +165 -25
  306. data/spec/unit/util_spec.rb +3 -9
  307. data/spec/watchr.rb +2 -6
  308. data/tasks/rake/gem.rake +4 -2
  309. data/tasks/rake/sign.rake +1 -1
  310. data/test/language/parser.rb +1 -0
  311. data/test/language/scope.rb +0 -5
  312. data/test/language/snippets.rb +1 -2
  313. data/test/lib/puppettest.rb +16 -27
  314. data/test/lib/puppettest/parsertesting.rb +0 -1
  315. data/test/network/authstore.rb +2 -4
  316. data/test/puppet/defaults.rb +0 -4
  317. data/test/util/fileparsing.rb +2 -6
  318. metadata +1706 -1617
  319. data/conf/osx/preflight +0 -24
  320. data/spec/spec.opts +0 -4
  321. data/spec/unit/file_collection/lookup_spec.rb +0 -45
  322. data/spec/unit/file_collection_spec.rb +0 -52
  323. data/tasks/rake/apple.rake +0 -176
  324. data/test/puppet/errortest.rb +0 -19
@@ -0,0 +1,18 @@
1
+ # The version method and constant are isolated in puppet/version.rb so that a
2
+ # simple `require 'puppet/version'` allows a rubygems gemspec or bundler
3
+ # Gemfile to get the Puppet version of the gem install.
4
+ #
5
+ # The version is programatically settable because we want to allow the
6
+ # Raketasks and such to set the version based on the output of `git describe`
7
+ #
8
+ module Puppet
9
+ PUPPETVERSION = '2.7.20-rc1'
10
+
11
+ def self.version
12
+ @puppet_version || PUPPETVERSION
13
+ end
14
+
15
+ def self.version=(version)
16
+ @puppet_version = version
17
+ end
18
+ end
@@ -0,0 +1,44 @@
1
+ # @(#)08 1.15.1.3 src/bos/usr/sbin/cron/root, cmdcntl, bos530 2/11/94 17:19:47
2
+ # IBM_PROLOG_BEGIN_TAG
3
+ # This is an automatically generated prolog.
4
+ #
5
+ # bos530 src/bos/usr/sbin/cron/root 1.15.1.3
6
+ #
7
+ # Licensed Materials - Property of IBM
8
+ #
9
+ # (C) COPYRIGHT International Business Machines Corp. 1989,1994
10
+ # All Rights Reserved
11
+ #
12
+ # US Government Users Restricted Rights - Use, duplication or
13
+ # disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
14
+ #
15
+ # IBM_PROLOG_END_TAG
16
+ #
17
+ # COMPONENT_NAME: (CMDCNTL) commands needed for basic system needs
18
+ #
19
+ # FUNCTIONS:
20
+ #
21
+ # ORIGINS: 27
22
+ #
23
+ # (C) COPYRIGHT International Business Machines Corp. 1989,1994
24
+ # All Rights Reserved
25
+ # Licensed Materials - Property of IBM
26
+ #
27
+ # US Government Users Restricted Rights - Use, duplication or
28
+ # disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
29
+ #
30
+ #0 3 * * * /usr/sbin/skulker
31
+ #45 2 * * 0 /usr/lib/spell/compress
32
+ #45 23 * * * ulimit 5000; /usr/lib/smdemon.cleanu > /dev/null
33
+ 0 11 * * * /usr/bin/errclear -d S,O 30
34
+ 0 12 * * * /usr/bin/errclear -d H 90
35
+ 0 15 * * * /usr/lib/ras/dumpcheck >/dev/null 2>&1
36
+ # SSA warning : Deleting the next two lines may cause errors in redundant
37
+ # SSA warning : hardware to go undetected.
38
+ 01 5 * * * /usr/lpp/diagnostics/bin/run_ssa_ela 1>/dev/null 2>/dev/null
39
+ 0 * * * * /usr/lpp/diagnostics/bin/run_ssa_healthcheck 1>/dev/null 2>/dev/null
40
+ # SSA warning : Deleting the next line may allow enclosure hardware errors to go undetected
41
+ 30 * * * * /usr/lpp/diagnostics/bin/run_ssa_encl_healthcheck 1>/dev/null 2>/dev/null
42
+ # SSA warning : Deleting the next line may allow link speed exceptions to go undetected
43
+ 30 4 * * * /usr/lpp/diagnostics/bin/run_ssa_link_speed 1>/dev/null 2>/dev/null
44
+ 55 23 * * * /var/perf/pm/bin/pmcfg >/dev/null 2>&1 #Enable PM Data Collection
@@ -0,0 +1,9 @@
1
+ #ident "@(#)root 1.19 98/07/06 SMI" /* SVr4.0 1.1.3.1 */
2
+ #
3
+ # The root crontab should be used to perform accounting data collection.
4
+ #
5
+ #
6
+ 10 3 * * * /usr/sbin/logadm
7
+ 15 3 * * 0 /usr/lib/fs/nfs/nfsfind
8
+ 30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean
9
+ #10 3 * * * /usr/lib/krb5/kprop_script ___slave_kdcs___
@@ -5,7 +5,7 @@ require 'puppet/defaults'
5
5
  require 'puppet/rails'
6
6
 
7
7
  describe "Puppet defaults" do
8
- include Puppet::Util::Execution
8
+ include Puppet::Util::Execution
9
9
  after { Puppet.settings.clear }
10
10
 
11
11
  describe "when setting the :factpath" do
@@ -134,11 +134,23 @@ describe "Puppet defaults" do
134
134
  end
135
135
  end
136
136
 
137
- it "should add /usr/sbin and /sbin to the path if they're not there" do
138
- withenv("PATH" => "/usr/bin:/usr/local/bin") do
139
- Puppet.settings[:path] = "none" # this causes it to ignore the setting
140
- ENV["PATH"].split(File::PATH_SEPARATOR).should be_include("/usr/sbin")
141
- ENV["PATH"].split(File::PATH_SEPARATOR).should be_include("/sbin")
137
+ describe "on a Unix-like platform it", :as_platform => :posix do
138
+ it "should add /usr/sbin and /sbin to the path if they're not there" do
139
+ withenv("PATH" => "/usr/bin#{File::PATH_SEPARATOR}/usr/local/bin") do
140
+ Puppet.settings[:path] = "none" # this causes it to ignore the setting
141
+ ENV["PATH"].split(File::PATH_SEPARATOR).should be_include("/usr/sbin")
142
+ ENV["PATH"].split(File::PATH_SEPARATOR).should be_include("/sbin")
143
+ end
144
+ end
145
+ end
146
+
147
+ describe "on a Windows-like platform it", :as_platform => :windows do
148
+ it "should not add anything" do
149
+ path = "c:\\windows\\system32#{File::PATH_SEPARATOR}c:\\windows"
150
+ withenv("PATH" => path) do
151
+ Puppet.settings[:path] = "none" # this causes it to ignore the setting
152
+ ENV["PATH"].should == path
153
+ end
142
154
  end
143
155
  end
144
156
 
@@ -162,7 +174,7 @@ describe "Puppet defaults" do
162
174
 
163
175
  it "should not set the Catalog cache class to :store_configs if asynchronous storeconfigs is enabled" do
164
176
  Puppet::Resource::Catalog.indirection.expects(:cache_class=).with(:store_configs).never
165
- Puppet.settings.expects(:value).with(:async_storeconfigs).returns true
177
+ Puppet.settings[:async_storeconfigs] = true
166
178
  Puppet.settings[:storeconfigs] = true
167
179
  end
168
180
 
@@ -314,4 +326,11 @@ describe "Puppet defaults" do
314
326
  Puppet.settings[:diff].should == ''
315
327
  end
316
328
  end
329
+
330
+ describe "puppetdlock" do
331
+ it "(#2888) is not a file setting so it is absent from the Settings catalog" do
332
+ Puppet.settings.setting(:puppetdlockfile).should_not be_a_kind_of Puppet::Util::Settings::FileSetting
333
+ Puppet.settings.setting(:puppetdlockfile).should be_a Puppet::Util::Settings::Setting
334
+ end
335
+ end
317
336
  end
@@ -2,10 +2,6 @@
2
2
  require 'spec_helper'
3
3
 
4
4
  describe Puppet::Parser::Functions do
5
- before :each do
6
- Puppet::Parser::Functions.rmfunction("template") if Puppet::Parser::Functions.functions.include?("template")
7
- end
8
-
9
5
  it "should support multiple threads autoloading the same function" do
10
6
  threads = []
11
7
  lambda {
@@ -36,7 +36,7 @@ describe Puppet::Util::FileLocking, :'fails_on_ruby_1.9.2' => true do
36
36
  threads.each { |th| th.join }
37
37
  end
38
38
 
39
- it "should be able to keep file corruption from happening when there are multiple writers processes" do
39
+ it "should be able to keep file corruption from happening when there are multiple writers processes", :unless => Puppet.features.microsoft_windows? do
40
40
  unless Process.fork
41
41
  50.times { |b|
42
42
  Puppet::Util::FileLocking.writelock(@file) { |f|
@@ -15,9 +15,9 @@ describe "Puppet::Util::Windows::Security", :if => Puppet.features.microsoft_win
15
15
 
16
16
  before :all do
17
17
  @sids = {
18
- :current_user => Puppet::Util::ADSI.sid_for_account(Sys::Admin.get_login),
19
- :admin => Puppet::Util::ADSI.sid_for_account("Administrator"),
20
- :guest => Puppet::Util::ADSI.sid_for_account("Guest"),
18
+ :current_user => Puppet::Util::Windows::Security.name_to_sid(Sys::Admin.get_login),
19
+ :admin => Puppet::Util::Windows::Security.name_to_sid("Administrator"),
20
+ :guest => Puppet::Util::Windows::Security.name_to_sid("Guest"),
21
21
  :users => Win32::Security::SID::BuiltinUsers,
22
22
  :power_users => Win32::Security::SID::PowerUsers,
23
23
  }
@@ -371,26 +371,6 @@ describe "Puppet::Util::Windows::Security", :if => Puppet.features.microsoft_win
371
371
  # end
372
372
  end
373
373
 
374
- describe "#string_to_sid_ptr" do
375
- it "should raise an error if an invalid SID is specified" do
376
- expect do
377
- winsec.string_to_sid_ptr('foobar')
378
- end.to raise_error(Puppet::Util::Windows::Error) { |error| error.code.should == 1337 }
379
- end
380
-
381
- it "should yield if a block is given" do
382
- yielded = nil
383
- winsec.string_to_sid_ptr('S-1-1-0') do |sid|
384
- yielded = sid
385
- end
386
- yielded.should_not be_nil
387
- end
388
-
389
- it "should allow no block to be specified" do
390
- winsec.string_to_sid_ptr('S-1-1-0').should be_true
391
- end
392
- end
393
-
394
374
  describe "when the parent directory" do
395
375
  before :each do
396
376
  winsec.set_owner(sids[:current_user], parent)
@@ -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
 
@@ -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
@@ -9,7 +9,6 @@ $LOAD_PATH.unshift File.join(dir, 'lib')
9
9
  ARGV.clear
10
10
 
11
11
  require 'puppet'
12
- require 'mocha'
13
12
  gem 'rspec', '>=2.0.0'
14
13
  require 'rspec/expectations'
15
14
 
@@ -43,6 +42,12 @@ RSpec.configure do |config|
43
42
 
44
43
  config.mock_with :mocha
45
44
 
45
+ if Puppet::Util::Platform.windows?
46
+ config.output_stream = $stdout
47
+ config.error_stream = $stderr
48
+ config.formatters.each { |f| f.instance_variable_set(:@output, $stdout) }
49
+ end
50
+
46
51
  config.before :all do
47
52
  Puppet::Test::TestHelper.before_all_tests()
48
53
  end
@@ -8,7 +8,7 @@ describe Puppet::Application::Queue, :unless => Puppet.features.microsoft_window
8
8
  before :each do
9
9
  @queue = Puppet::Application[:queue]
10
10
  @queue.stubs(:puts)
11
- @daemon = stub_everything 'daemon', :daemonize => nil
11
+ @daemon = stub_everything 'daemon'
12
12
  Puppet::Util::Log.stubs(:newdestination)
13
13
 
14
14
  Puppet::Resource::Catalog.indirection.stubs(:terminus_class=)
@@ -70,6 +70,7 @@ describe Puppet::Application::Queue, :unless => Puppet.features.microsoft_window
70
70
 
71
71
  describe "during setup" do
72
72
  before :each do
73
+ @queue.preinit
73
74
  @queue.options.stubs(:[])
74
75
  @queue.daemon.stubs(:daemonize)
75
76
  Puppet.stubs(:info)
@@ -441,7 +441,7 @@ describe Puppet::Configurer do
441
441
  Puppet::Util.expects(:replace_file).yields(fh)
442
442
 
443
443
  Puppet.expects(:err)
444
- expect { @configurer.save_last_run_summary(@report) }.should_not raise_error
444
+ expect { @configurer.save_last_run_summary(@report) }.to_not raise_error
445
445
  end
446
446
  end
447
447
 
@@ -0,0 +1,194 @@
1
+ #! /usr/bin/env ruby -S rspec
2
+ require 'spec_helper'
3
+ require 'puppet/indirector/catalog/static_compiler'
4
+ require 'puppet/file_serving/metadata'
5
+ require 'puppet/file_serving/content'
6
+ require 'yaml'
7
+
8
+ describe Puppet::Resource::Catalog::StaticCompiler do
9
+ before :all do
10
+ @num_file_resources = 10
11
+ end
12
+
13
+ let(:request) do
14
+ Puppet::Indirector::Request.new(:the_indirection_named_foo,
15
+ :find,
16
+ "the-node-named-foo",
17
+ :environment => "production")
18
+ end
19
+
20
+ describe "#find" do
21
+ it "returns a catalog" do
22
+ subject.find(request).should be_a_kind_of(Puppet::Resource::Catalog)
23
+ end
24
+
25
+ it "returns nil if there is no compiled catalog" do
26
+ compiler = mock('compiler indirection')
27
+ compiler.expects(:find).with(request).returns(nil)
28
+
29
+ subject.expects(:compiler).returns(compiler)
30
+ subject.find(request).should be_nil
31
+ end
32
+
33
+ describe "a catalog with file resources containing source parameters with puppet:// URIs" do
34
+ it "filters file resource source URI's to checksums" do
35
+ stub_the_compiler
36
+ resource_catalog = subject.find(request)
37
+ resource_catalog.resources.each do |resource|
38
+ next unless resource.type == "File"
39
+ resource[:content].should == "{md5}361fadf1c712e812d198c4cab5712a79"
40
+ resource[:source].should be_nil
41
+ end
42
+ end
43
+
44
+ it "does not modify file resources with non-puppet:// URI's" do
45
+ uri = "/this/is/not/a/puppet/uri.txt"
46
+ stub_the_compiler(:source => uri)
47
+ resource_catalog = subject.find(request)
48
+ resource_catalog.resources.each do |resource|
49
+ next unless resource.type == "File"
50
+ resource[:content].should be_nil
51
+ resource[:source].should == uri
52
+ end
53
+ end
54
+
55
+ it "copies the owner, group and mode from the fileserer" do
56
+ stub_the_compiler
57
+ resource_catalog = subject.find(request)
58
+ resource_catalog.resources.each do |resource|
59
+ next unless resource.type == "File"
60
+ resource[:owner].should == 0
61
+ resource[:group].should == 0
62
+ resource[:mode].should == 420
63
+ end
64
+ end
65
+ end
66
+ end
67
+
68
+ describe "(#15193) when storing content to the filebucket" do
69
+ it "explicitly uses the indirection method" do
70
+ # Do not stub the store_content method which is stubbed by default in the
71
+ # value of the stub_methods option.
72
+ stub_the_compiler(:stub_methods => false)
73
+
74
+ # We expect the content to be retrieved from the FileServer ...
75
+ fake_content = mock('FileServer Content')
76
+ fake_content.expects(:content).returns("HELLO WORLD")
77
+
78
+ # Mock the FileBucket to behave as if the file content does not exist.
79
+ # NOTE, we're simulating the first call returning false, indicating the
80
+ # file is not present, then all subsequent calls returning true. This
81
+ # mocked behavior is intended to replicate the real behavior of the same
82
+ # file being stored to the filebucket multiple times.
83
+ Puppet::FileBucket::File.indirection.
84
+ expects(:find).times(@num_file_resources).
85
+ returns(false).then.returns(true)
86
+
87
+ Puppet::FileServing::Content.indirection.
88
+ expects(:find).once.
89
+ returns(fake_content)
90
+
91
+ # Once retrived from the FileServer, we expect the file to be stored into
92
+ # the FileBucket only once. All of the file resources in the fake
93
+ # catalog have the same content.
94
+ Puppet::FileBucket::File.indirection.expects(:save).once.with do |file|
95
+ file.contents == "HELLO WORLD"
96
+ end
97
+
98
+ # Obtain the Static Catalog
99
+ resource_catalog = subject.find(request)
100
+
101
+ # Ensure all of the file resources were filtered
102
+ resource_catalog.resources.each do |resource|
103
+ next unless resource.type == "File"
104
+ resource[:content].should == "{md5}361fadf1c712e812d198c4cab5712a79"
105
+ resource[:source].should be_nil
106
+ end
107
+ end
108
+ end
109
+
110
+ # Spec helper methods
111
+
112
+ def stub_the_compiler(options = {:stub_methods => [:store_content]})
113
+ # Build a resource catalog suitable for specifying the behavior of the
114
+ # static compiler.
115
+ compiler = mock('indirection terminus compiler')
116
+ compiler.stubs(:find).returns(build_catalog(options))
117
+ subject.stubs(:compiler).returns(compiler)
118
+ # Mock the store content method to prevent copying the contents to the
119
+ # file bucket.
120
+ (options[:stub_methods] || []).each do |mthd|
121
+ subject.stubs(mthd)
122
+ end
123
+ end
124
+
125
+ def build_catalog(options = {})
126
+ options = options.dup
127
+ options[:source] ||= 'puppet:///modules/mymodule/config_file.txt'
128
+ options[:request] ||= request
129
+
130
+ # Build a catalog suitable for the static compiler to operate on
131
+ catalog = Puppet::Resource::Catalog.new("#{options[:request].key}")
132
+
133
+ # Mock out the fileserver, otherwise converting the catalog to a
134
+ fake_fileserver_metadata = fileserver_metadata(options)
135
+
136
+ # Stub the call to the FileServer metadata API so we don't have to have
137
+ # a real fileserver initialized for testing.
138
+ Puppet::FileServing::Metadata.
139
+ indirection.stubs(:find).
140
+ with(options[:source].sub('puppet:///','')).
141
+ returns(fake_fileserver_metadata)
142
+
143
+ # I want a resource that all the file resources require and another
144
+ # that requires them.
145
+ resources = Array.new
146
+ resources << Puppet::Resource.new("notify", "alpha")
147
+ resources << Puppet::Resource.new("notify", "omega")
148
+
149
+ # Create some File resources with source parameters.
150
+ 1.upto(@num_file_resources) do |idx|
151
+ parameters = {
152
+ :ensure => 'file',
153
+ :source => options[:source],
154
+ :require => "Notify[alpha]",
155
+ :before => "Notify[omega]"
156
+ }
157
+ # The static compiler does not operate on a RAL catalog, so we're
158
+ # using Puppet::Resource to produce a resource catalog.
159
+ agnostic_path = File.expand_path("/tmp/file_#{idx}.txt") # Windows Friendly
160
+ rsrc = Puppet::Resource.new("file", agnostic_path, :parameters => parameters)
161
+ rsrc.file = 'site.pp'
162
+ rsrc.line = idx
163
+ resources << rsrc
164
+ end
165
+
166
+ resources.each do |rsrc|
167
+ catalog.add_resource(rsrc)
168
+ end
169
+
170
+ # Return the resource catalog
171
+ catalog
172
+ end
173
+
174
+ def fileserver_metadata(options = {})
175
+ yaml = <<EOFILESERVERMETADATA
176
+ --- !ruby/object:Puppet::FileServing::Metadata
177
+ checksum: "{md5}361fadf1c712e812d198c4cab5712a79"
178
+ checksum_type: md5
179
+ destination:
180
+ expiration: #{Time.now + 1800}
181
+ ftype: file
182
+ group: 0
183
+ links: !ruby/sym manage
184
+ mode: 420
185
+ owner: 0
186
+ path: #{File.expand_path('/etc/puppet/modules/mymodule/files/config_file.txt')}
187
+ source: #{options[:source]}
188
+ stat_method: !ruby/sym lstat
189
+ EOFILESERVERMETADATA
190
+ # Return a deserialized metadata object suitable for returning from a stub.
191
+ YAML.load(yaml)
192
+ end
193
+ end
194
+