puppet 0.24.7 → 0.24.8

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 (489) hide show
  1. data/CHANGELOG +72 -0
  2. data/README.rst +38 -0
  3. data/Rakefile +3 -1
  4. data/bin/filebucket +0 -0
  5. data/bin/puppet +0 -0
  6. data/bin/puppetca +0 -0
  7. data/bin/puppetd +0 -0
  8. data/bin/puppetdoc +0 -0
  9. data/bin/puppetmasterd +0 -0
  10. data/bin/puppetrun +0 -0
  11. data/bin/ralsh +4 -0
  12. data/conf/gentoo/init.d/puppetmaster +0 -0
  13. data/conf/osx/createpackage.sh +0 -0
  14. data/conf/osx/preflight +0 -0
  15. data/conf/redhat/puppet.spec +20 -3
  16. data/conf/solaris/smf/svc-puppetd +0 -0
  17. data/conf/solaris/smf/svc-puppetmasterd +0 -0
  18. data/examples/etc/init.d/sleeper +0 -0
  19. data/examples/mac_dscl.pp +0 -0
  20. data/examples/mac_dscl_revert.pp +0 -0
  21. data/examples/mac_netinfo.pp +0 -0
  22. data/examples/mac_pkgdmg.pp +0 -0
  23. data/ext/bin/sleeper +0 -0
  24. data/ext/dbfix.sql +132 -0
  25. data/ext/logcheck/puppet +2 -1
  26. data/ext/module_puppet +0 -0
  27. data/ext/nagios/check_puppet.rb +0 -0
  28. data/ext/puppet-test +0 -0
  29. data/ext/puppetlast +0 -0
  30. data/ext/vim/syntax/puppet.vim +2 -1
  31. data/install.rb +2 -2
  32. data/lib/puppet.rb +1 -1
  33. data/lib/puppet/daemon.rb +0 -0
  34. data/lib/puppet/defaults.rb +9 -0
  35. data/lib/puppet/executables/client/certhandler.rb +6 -1
  36. data/lib/puppet/external/base64.rb +0 -0
  37. data/lib/puppet/external/nagios.rb +0 -0
  38. data/lib/puppet/external/nagios/base.rb +0 -0
  39. data/lib/puppet/external/nagios/parser.rb +39 -57
  40. data/lib/puppet/file_collection.rb +30 -0
  41. data/lib/puppet/file_collection/lookup.rb +20 -0
  42. data/lib/puppet/indirector/facts/facter.rb +6 -2
  43. data/lib/puppet/indirector/node/ldap.rb +75 -39
  44. data/lib/puppet/network/authstore.rb +0 -0
  45. data/lib/puppet/network/handler/filebucket.rb +0 -0
  46. data/lib/puppet/network/handler/fileserver.rb +0 -0
  47. data/lib/puppet/network/handler/report.rb +0 -0
  48. data/lib/puppet/network/handler/resource.rb +0 -0
  49. data/lib/puppet/network/handler/runner.rb +0 -0
  50. data/lib/puppet/network/rights.rb +0 -0
  51. data/lib/puppet/network/xmlrpc/client.rb +113 -53
  52. data/lib/puppet/node/facts.rb +0 -0
  53. data/lib/puppet/parser/ast.rb +4 -3
  54. data/lib/puppet/parser/ast/astarray.rb +2 -1
  55. data/lib/puppet/parser/ast/leaf.rb +1 -1
  56. data/lib/puppet/parser/ast/resource.rb +20 -20
  57. data/lib/puppet/parser/ast/resource_override.rb +2 -2
  58. data/lib/puppet/parser/collector.rb +1 -2
  59. data/lib/puppet/parser/functions/realize.rb +1 -1
  60. data/lib/puppet/parser/functions/regsubst.rb +93 -0
  61. data/lib/puppet/parser/functions/sprintf.rb +17 -0
  62. data/lib/puppet/parser/functions/versioncmp.rb +10 -0
  63. data/lib/puppet/parser/resource.rb +10 -6
  64. data/lib/puppet/parser/resource/param.rb +17 -14
  65. data/lib/puppet/parser/resource/reference.rb +2 -0
  66. data/lib/puppet/parser/scope.rb +3 -3
  67. data/lib/puppet/property/list.rb +5 -1
  68. data/lib/puppet/provider/augeas/augeas.rb +146 -44
  69. data/lib/puppet/provider/cron/crontab.rb +0 -0
  70. data/lib/puppet/provider/mailalias/aliases.rb +0 -0
  71. data/lib/puppet/provider/maillist/mailman.rb +0 -0
  72. data/lib/puppet/provider/mount/parsed.rb +0 -0
  73. data/lib/puppet/provider/naginator.rb +7 -2
  74. data/lib/puppet/provider/nameservice/directoryservice.rb +128 -44
  75. data/lib/puppet/provider/package/apple.rb +0 -0
  76. data/lib/puppet/provider/package/apt.rb +0 -0
  77. data/lib/puppet/provider/package/aptitude.rb +0 -0
  78. data/lib/puppet/provider/package/blastwave.rb +0 -0
  79. data/lib/puppet/provider/package/darwinport.rb +0 -0
  80. data/lib/puppet/provider/package/dpkg.rb +0 -0
  81. data/lib/puppet/provider/package/fink.rb +0 -0
  82. data/lib/puppet/provider/package/freebsd.rb +0 -0
  83. data/lib/puppet/provider/package/gem.rb +0 -0
  84. data/lib/puppet/provider/package/openbsd.rb +0 -0
  85. data/lib/puppet/provider/package/ports.rb +0 -0
  86. data/lib/puppet/provider/package/rpm.rb +0 -0
  87. data/lib/puppet/provider/package/sun.rb +0 -0
  88. data/lib/puppet/provider/package/sunfreeware.rb +0 -0
  89. data/lib/puppet/provider/package/up2date.rb +4 -2
  90. data/lib/puppet/provider/package/yum.rb +0 -0
  91. data/lib/puppet/provider/parsedfile.rb +47 -22
  92. data/lib/puppet/provider/port/parsed.rb +0 -0
  93. data/lib/puppet/provider/service/base.rb +0 -0
  94. data/lib/puppet/provider/service/debian.rb +0 -0
  95. data/lib/puppet/provider/service/gentoo.rb +1 -1
  96. data/lib/puppet/provider/service/init.rb +0 -0
  97. data/lib/puppet/provider/service/launchd.rb +13 -4
  98. data/lib/puppet/provider/service/redhat.rb +5 -5
  99. data/lib/puppet/provider/service/smf.rb +0 -0
  100. data/lib/puppet/provider/ssh_authorized_key/parsed.rb +43 -16
  101. data/lib/puppet/provider/sshkey/parsed.rb +0 -0
  102. data/lib/puppet/provider/user/useradd.rb +1 -1
  103. data/lib/puppet/rails/database/003_add_environment_to_host.rb +6 -2
  104. data/lib/puppet/rails/host.rb +70 -19
  105. data/lib/puppet/rails/param_value.rb +31 -12
  106. data/lib/puppet/rails/resource.rb +36 -9
  107. data/lib/puppet/rails/resource_tag.rb +18 -0
  108. data/lib/puppet/reference/report.rb +1 -0
  109. data/lib/puppet/reports.rb +0 -0
  110. data/lib/puppet/sslcertificates.rb +0 -0
  111. data/lib/puppet/transaction.rb +1 -1
  112. data/lib/puppet/type.rb +2 -6
  113. data/lib/puppet/type/augeas.rb +23 -15
  114. data/lib/puppet/type/cron.rb +0 -0
  115. data/lib/puppet/type/exec.rb +0 -0
  116. data/lib/puppet/type/file/checksum.rb +7 -35
  117. data/lib/puppet/type/file/content.rb +11 -8
  118. data/lib/puppet/type/file/ensure.rb +0 -0
  119. data/lib/puppet/type/file/group.rb +0 -0
  120. data/lib/puppet/type/file/mode.rb +0 -0
  121. data/lib/puppet/type/file/owner.rb +0 -0
  122. data/lib/puppet/type/file/selcontext.rb +8 -0
  123. data/lib/puppet/type/file/source.rb +0 -0
  124. data/lib/puppet/type/file/type.rb +0 -0
  125. data/lib/puppet/type/filebucket.rb +0 -0
  126. data/lib/puppet/type/group.rb +0 -0
  127. data/lib/puppet/type/host.rb +0 -0
  128. data/lib/puppet/type/mailalias.rb +0 -0
  129. data/lib/puppet/type/maillist.rb +0 -0
  130. data/lib/puppet/type/mount.rb +0 -0
  131. data/lib/puppet/type/port.rb +0 -0
  132. data/lib/puppet/type/schedule.rb +0 -0
  133. data/lib/puppet/type/ssh_authorized_key.rb +14 -0
  134. data/lib/puppet/type/sshkey.rb +0 -0
  135. data/lib/puppet/type/tidy.rb +0 -0
  136. data/lib/puppet/type/user.rb +6 -0
  137. data/lib/puppet/type/yumrepo.rb +4 -1
  138. data/lib/puppet/type/zfs.rb +0 -0
  139. data/lib/puppet/type/zpool.rb +0 -0
  140. data/lib/puppet/util/autoload.rb +2 -2
  141. data/lib/puppet/util/filetype.rb +7 -96
  142. data/lib/puppet/util/inifile.rb +1 -0
  143. data/lib/puppet/util/instance_loader.rb +0 -0
  144. data/lib/puppet/util/loadedfile.rb +0 -0
  145. data/lib/puppet/util/nagios_maker.rb +4 -0
  146. data/lib/puppet/util/package.rb +2 -0
  147. data/lib/puppet/util/posix.rb +0 -0
  148. data/lib/puppet/util/rails/reference_serializer.rb +18 -0
  149. data/lib/puppet/util/selinux.rb +3 -1
  150. data/spec/integration/checksum.rb +1 -0
  151. data/spec/integration/defaults.rb +9 -0
  152. data/spec/integration/file_serving/configuration.rb +0 -0
  153. data/spec/integration/file_serving/content.rb +0 -0
  154. data/spec/integration/file_serving/metadata.rb +0 -0
  155. data/spec/integration/indirector/direct_file_server.rb +0 -0
  156. data/spec/integration/indirector/file_content/file_server.rb +0 -0
  157. data/spec/integration/indirector/file_metadata/file_server.rb +0 -0
  158. data/spec/integration/indirector/module_files.rb +0 -0
  159. data/spec/integration/indirector/node/ldap.rb +0 -0
  160. data/spec/integration/indirector/rest.rb +0 -0
  161. data/spec/integration/network/server/mongrel.rb +0 -0
  162. data/spec/integration/network/server/webrick.rb +0 -0
  163. data/spec/integration/node.rb +0 -0
  164. data/spec/integration/node/catalog.rb +0 -0
  165. data/spec/integration/node/facts.rb +0 -0
  166. data/spec/integration/provider/package.rb +0 -0
  167. data/spec/integration/provider/service/init.rb +0 -0
  168. data/spec/integration/reference/providers.rb +0 -0
  169. data/spec/integration/reports.rb +4 -0
  170. data/spec/integration/transaction/report.rb +7 -1
  171. data/spec/integration/type/package.rb +5 -2
  172. data/spec/integration/util/file_locking.rb +0 -0
  173. data/spec/unit/executables/client/certhandler.rb +13 -0
  174. data/spec/unit/file_collection.rb +53 -0
  175. data/spec/unit/file_collection/lookup.rb +46 -0
  176. data/spec/unit/file_serving/configuration.rb +0 -0
  177. data/spec/unit/file_serving/configuration/parser.rb +0 -0
  178. data/spec/unit/file_serving/content.rb +0 -0
  179. data/spec/unit/file_serving/file_base.rb +0 -0
  180. data/spec/unit/file_serving/fileset.rb +0 -0
  181. data/spec/unit/file_serving/indirection_hooks.rb +0 -0
  182. data/spec/unit/file_serving/metadata.rb +0 -0
  183. data/spec/unit/file_serving/mount.rb +0 -0
  184. data/spec/unit/file_serving/terminus_helper.rb +0 -0
  185. data/spec/unit/indirector.rb +0 -0
  186. data/spec/unit/indirector/catalog/compiler.rb +0 -0
  187. data/spec/unit/indirector/catalog/yaml.rb +0 -0
  188. data/spec/unit/indirector/checksum/file.rb +0 -0
  189. data/spec/unit/indirector/code.rb +0 -0
  190. data/spec/unit/indirector/direct_file_server.rb +0 -0
  191. data/spec/unit/indirector/envelope.rb +0 -0
  192. data/spec/unit/indirector/exec.rb +0 -0
  193. data/spec/unit/indirector/facts/facter.rb +27 -2
  194. data/spec/unit/indirector/facts/yaml.rb +0 -0
  195. data/spec/unit/indirector/file.rb +0 -0
  196. data/spec/unit/indirector/file_content/file.rb +0 -0
  197. data/spec/unit/indirector/file_content/file_server.rb +0 -0
  198. data/spec/unit/indirector/file_content/modules.rb +0 -0
  199. data/spec/unit/indirector/file_content/rest.rb +0 -0
  200. data/spec/unit/indirector/file_metadata/file.rb +0 -0
  201. data/spec/unit/indirector/file_metadata/file_server.rb +0 -0
  202. data/spec/unit/indirector/file_metadata/modules.rb +0 -0
  203. data/spec/unit/indirector/file_metadata/rest.rb +0 -0
  204. data/spec/unit/indirector/file_server.rb +0 -0
  205. data/spec/unit/indirector/indirection.rb +0 -0
  206. data/spec/unit/indirector/ldap.rb +0 -0
  207. data/spec/unit/indirector/memory.rb +0 -0
  208. data/spec/unit/indirector/module_files.rb +0 -0
  209. data/spec/unit/indirector/node/exec.rb +0 -0
  210. data/spec/unit/indirector/node/ldap.rb +20 -0
  211. data/spec/unit/indirector/node/memory.rb +0 -0
  212. data/spec/unit/indirector/node/plain.rb +0 -0
  213. data/spec/unit/indirector/node/rest.rb +0 -0
  214. data/spec/unit/indirector/node/yaml.rb +0 -0
  215. data/spec/unit/indirector/plain.rb +0 -0
  216. data/spec/unit/indirector/report/processor.rb +0 -0
  217. data/spec/unit/indirector/request.rb +0 -0
  218. data/spec/unit/indirector/rest.rb +0 -0
  219. data/spec/unit/indirector/ssl_rsa/file.rb +5 -0
  220. data/spec/unit/indirector/terminus.rb +0 -0
  221. data/spec/unit/indirector/yaml.rb +0 -0
  222. data/spec/unit/module.rb +0 -0
  223. data/spec/unit/network/client.rb +0 -0
  224. data/spec/unit/network/client/master.rb +0 -0
  225. data/spec/unit/network/http.rb +0 -0
  226. data/spec/unit/network/http/mongrel.rb +0 -0
  227. data/spec/unit/network/http/mongrel/rest.rb +0 -0
  228. data/spec/unit/network/http/mongrel/xmlrpc.rb +0 -0
  229. data/spec/unit/network/http/webrick.rb +0 -0
  230. data/spec/unit/network/http/webrick/rest.rb +0 -0
  231. data/spec/unit/network/http/webrick/xmlrpc.rb +0 -0
  232. data/spec/unit/network/http_pool.rb +0 -0
  233. data/spec/unit/network/server.rb +0 -0
  234. data/spec/unit/network/xmlrpc/client.rb +165 -7
  235. data/spec/unit/node.rb +0 -0
  236. data/spec/unit/node/catalog.rb +1 -0
  237. data/spec/unit/node/environment.rb +0 -0
  238. data/spec/unit/node/facts.rb +0 -0
  239. data/spec/unit/other/checksum.rb +0 -0
  240. data/spec/unit/other/pgraph.rb +0 -0
  241. data/spec/unit/other/transbucket.rb +4 -4
  242. data/spec/unit/other/transobject.rb +0 -0
  243. data/spec/unit/parameter.rb +0 -0
  244. data/spec/unit/parser/ast.rb +5 -1
  245. data/spec/unit/parser/ast/arithmetic_operator.rb +0 -0
  246. data/spec/unit/parser/ast/astarray.rb +2 -2
  247. data/spec/unit/parser/ast/boolean_operator.rb +0 -0
  248. data/spec/unit/parser/ast/collexpr.rb +0 -0
  249. data/spec/unit/parser/ast/comparison_operator.rb +0 -0
  250. data/spec/unit/parser/ast/definition.rb +0 -0
  251. data/spec/unit/parser/ast/hostclass.rb +0 -0
  252. data/spec/unit/parser/ast/minus.rb +0 -0
  253. data/spec/unit/parser/ast/node.rb +0 -0
  254. data/spec/unit/parser/ast/nop.rb +0 -0
  255. data/spec/unit/parser/ast/not.rb +0 -0
  256. data/spec/unit/parser/ast/resource.rb +103 -0
  257. data/spec/unit/parser/ast/resource_override.rb +0 -0
  258. data/spec/unit/parser/ast/resource_reference.rb +0 -0
  259. data/spec/unit/parser/ast/vardef.rb +0 -0
  260. data/spec/unit/parser/collector.rb +4 -4
  261. data/spec/unit/parser/compiler.rb +0 -0
  262. data/spec/unit/parser/functions/realize.rb +51 -0
  263. data/spec/unit/parser/functions/regsubst.rb +88 -0
  264. data/spec/unit/parser/functions/sprintf.rb +42 -0
  265. data/spec/unit/parser/functions/versioncmp.rb +29 -0
  266. data/spec/unit/parser/interpreter.rb +0 -0
  267. data/spec/unit/parser/lexer.rb +0 -0
  268. data/spec/unit/parser/parser.rb +0 -0
  269. data/spec/unit/parser/resource.rb +4 -0
  270. data/spec/unit/parser/resource/reference.rb +4 -0
  271. data/spec/unit/parser/scope.rb +14 -0
  272. data/spec/unit/parser/templatewrapper.rb +0 -0
  273. data/spec/unit/property.rb +0 -0
  274. data/spec/unit/property/list.rb +4 -0
  275. data/spec/unit/provider/augeas/augeas.rb +219 -92
  276. data/spec/unit/provider/confine.rb +0 -0
  277. data/spec/unit/provider/confine/exists.rb +0 -0
  278. data/spec/unit/provider/confine/false.rb +0 -0
  279. data/spec/unit/provider/confine/feature.rb +0 -0
  280. data/spec/unit/provider/confine/true.rb +0 -0
  281. data/spec/unit/provider/confine/variable.rb +0 -0
  282. data/spec/unit/provider/confine_collection.rb +0 -0
  283. data/spec/unit/provider/confiner.rb +0 -0
  284. data/spec/unit/provider/group/groupadd.rb +0 -0
  285. data/spec/unit/provider/group/ldap.rb +0 -0
  286. data/spec/unit/provider/ldap.rb +0 -0
  287. data/spec/unit/provider/macauthorization.rb +0 -0
  288. data/spec/unit/provider/mcx/mcxcontent.rb +0 -0
  289. data/spec/unit/provider/mount.rb +0 -0
  290. data/spec/unit/provider/mount/parsed.rb +1 -0
  291. data/spec/unit/provider/naginator.rb +58 -0
  292. data/spec/unit/provider/package/apt.rb +0 -0
  293. data/spec/unit/provider/package/dpkg.rb +0 -0
  294. data/spec/unit/provider/parsedfile.rb +95 -0
  295. data/spec/unit/provider/selboolean.rb +0 -0
  296. data/spec/unit/provider/selmodule.rb +0 -0
  297. data/spec/unit/provider/service/launchd.rb +9 -1
  298. data/spec/unit/provider/ssh_authorized_key/parsed.rb +63 -19
  299. data/spec/unit/provider/user/hpux.rb +0 -0
  300. data/spec/unit/provider/user/ldap.rb +0 -0
  301. data/spec/unit/provider/user/useradd.rb +0 -0
  302. data/spec/unit/provider/zfs/solaris.rb +0 -0
  303. data/spec/unit/provider/zone/solaris.rb +0 -0
  304. data/spec/unit/provider/zpool/solaris.rb +0 -0
  305. data/spec/unit/rails.rb +1 -0
  306. data/spec/unit/relationship.rb +0 -0
  307. data/spec/unit/reports.rb +0 -0
  308. data/spec/unit/resource_reference.rb +0 -0
  309. data/spec/unit/simple_graph.rb +0 -0
  310. data/spec/unit/{other/transaction.rb → transaction.rb} +16 -1
  311. data/spec/unit/transaction/change.rb +0 -0
  312. data/spec/unit/transaction/event.rb +0 -0
  313. data/spec/unit/transaction/report.rb +0 -0
  314. data/spec/unit/type.rb +0 -0
  315. data/spec/unit/type/computer.rb +0 -0
  316. data/spec/unit/type/exec.rb +0 -0
  317. data/spec/unit/type/file.rb +2 -0
  318. data/spec/unit/type/file/content.rb +30 -0
  319. data/spec/unit/type/file/ensure.rb +0 -0
  320. data/spec/unit/type/file/group.rb +0 -0
  321. data/spec/unit/type/file/owner.rb +0 -0
  322. data/spec/unit/type/file/selinux.rb +6 -0
  323. data/spec/unit/type/group.rb +3 -0
  324. data/spec/unit/type/macauthorization.rb +0 -0
  325. data/spec/unit/type/mcx.rb +0 -0
  326. data/spec/unit/type/mount.rb +0 -0
  327. data/spec/unit/type/nagios.rb +0 -0
  328. data/spec/unit/type/noop_metaparam.rb +1 -0
  329. data/spec/unit/type/package.rb +0 -0
  330. data/spec/unit/type/schedule.rb +0 -0
  331. data/spec/unit/type/selboolean.rb +0 -0
  332. data/spec/unit/type/selmodule.rb +0 -0
  333. data/spec/unit/type/service.rb +0 -0
  334. data/spec/unit/type/ssh_authorized_key.rb +31 -8
  335. data/spec/unit/type/tidy.rb +4 -0
  336. data/spec/unit/type/user.rb +17 -0
  337. data/spec/unit/type/zfs.rb +0 -0
  338. data/spec/unit/type/zone.rb +0 -0
  339. data/spec/unit/type/zpool.rb +0 -0
  340. data/spec/unit/util/autoload.rb +39 -0
  341. data/spec/unit/util/checksums.rb +0 -0
  342. data/spec/unit/util/constant_inflector.rb +0 -0
  343. data/spec/unit/util/file_locking.rb +0 -0
  344. data/spec/unit/util/filetype.rb +110 -0
  345. data/spec/unit/util/ldap/connection.rb +0 -0
  346. data/spec/unit/util/ldap/generator.rb +0 -0
  347. data/spec/unit/util/ldap/manager.rb +0 -0
  348. data/spec/unit/util/loadedfile.rb +0 -0
  349. data/spec/unit/util/log.rb +0 -0
  350. data/spec/unit/util/metric.rb +0 -0
  351. data/spec/unit/util/nagios_maker.rb +32 -34
  352. data/spec/unit/util/package.rb +21 -0
  353. data/spec/unit/util/posix.rb +0 -0
  354. data/spec/unit/util/resource_template.rb +0 -0
  355. data/spec/unit/util/settings.rb +0 -0
  356. data/spec/unit/util/storage.rb +0 -0
  357. data/spec/unit/util/tagging.rb +0 -0
  358. data/spec/unit/util/uri_helper.rb +0 -0
  359. data/spec/unit/util/warnings.rb +0 -0
  360. data/test/certmgr/ca.rb +0 -0
  361. data/test/certmgr/certmgr.rb +0 -0
  362. data/test/certmgr/inventory.rb +0 -0
  363. data/test/certmgr/support.rb +0 -0
  364. data/test/data/snippets/subclass_name_duplication.pp +0 -0
  365. data/test/executables/filebucket.rb +6 -3
  366. data/test/executables/puppetbin.rb +1 -1
  367. data/test/executables/puppetca.rb +0 -0
  368. data/test/executables/puppetd.rb +0 -0
  369. data/test/executables/puppetmasterd.rb +0 -0
  370. data/test/executables/puppetmodule.rb +0 -0
  371. data/test/language/ast.rb +0 -0
  372. data/test/language/ast/casestatement.rb +0 -0
  373. data/test/language/ast/resource.rb +0 -0
  374. data/test/language/ast/resource_reference.rb +0 -0
  375. data/test/language/ast/selector.rb +0 -0
  376. data/test/language/ast/variable.rb +0 -0
  377. data/test/language/functions.rb +0 -0
  378. data/test/language/parser.rb +0 -0
  379. data/test/language/resource.rb +0 -40
  380. data/test/language/scope.rb +0 -0
  381. data/test/language/snippets.rb +0 -0
  382. data/test/language/transportable.rb +0 -0
  383. data/test/lib/puppettest.rb +3 -0
  384. data/test/lib/puppettest/support/resources.rb +0 -0
  385. data/test/network/authconfig.rb +0 -0
  386. data/test/network/authorization.rb +0 -0
  387. data/test/network/authstore.rb +0 -0
  388. data/test/network/client/ca.rb +0 -0
  389. data/test/network/client/client.rb +0 -0
  390. data/test/network/client/dipper.rb +0 -0
  391. data/test/network/client/master.rb +0 -0
  392. data/test/network/client/resource.rb +0 -0
  393. data/test/network/client_request.rb +0 -0
  394. data/test/network/daemon.rb +0 -0
  395. data/test/network/handler/bucket.rb +0 -0
  396. data/test/network/handler/ca.rb +0 -0
  397. data/test/network/handler/fileserver.rb +0 -0
  398. data/test/network/handler/handler.rb +0 -0
  399. data/test/network/handler/master.rb +0 -0
  400. data/test/network/handler/report.rb +0 -0
  401. data/test/network/handler/resource.rb +0 -0
  402. data/test/network/handler/runner.rb +0 -0
  403. data/test/network/rights.rb +0 -0
  404. data/test/network/server/mongrel_test.rb +0 -0
  405. data/test/network/server/webrick.rb +0 -0
  406. data/test/network/xmlrpc/client.rb +0 -0
  407. data/test/network/xmlrpc/processor.rb +0 -0
  408. data/test/network/xmlrpc/server.rb +0 -0
  409. data/test/network/xmlrpc/webrick_servlet.rb +0 -0
  410. data/test/other/dsl.rb +0 -0
  411. data/test/other/events.rb +0 -0
  412. data/test/other/overrides.rb +0 -0
  413. data/test/other/provider.rb +0 -0
  414. data/test/other/puppet.rb +0 -0
  415. data/test/other/relationships.rb +0 -0
  416. data/test/other/report.rb +0 -0
  417. data/test/other/transactions.rb +0 -0
  418. data/test/puppet/conffiles.rb +0 -0
  419. data/test/puppet/defaults.rb +0 -0
  420. data/test/puppet/errortest.rb +0 -0
  421. data/test/puppet/tc_suidmanager.rb +0 -0
  422. data/test/rails/ast.rb +0 -0
  423. data/test/rails/configuration.rb +0 -0
  424. data/test/rails/host.rb +0 -0
  425. data/test/rails/rails.rb +0 -0
  426. data/test/rails/railsparameter.rb +0 -0
  427. data/test/rails/railsresource.rb +0 -0
  428. data/test/ral/manager/attributes.rb +0 -0
  429. data/test/ral/manager/instances.rb +0 -0
  430. data/test/ral/manager/manager.rb +0 -0
  431. data/test/ral/manager/provider.rb +0 -0
  432. data/test/ral/manager/type.rb +0 -3
  433. data/test/ral/providers/cron/crontab.rb +0 -0
  434. data/test/ral/providers/group.rb +0 -0
  435. data/test/ral/providers/host/netinfo.rb +0 -0
  436. data/test/ral/providers/host/parsed.rb +0 -0
  437. data/test/ral/providers/mailalias/aliases.rb +0 -0
  438. data/test/ral/providers/mount/netinfo.rb +0 -0
  439. data/test/ral/providers/nameservice.rb +0 -0
  440. data/test/ral/providers/package.rb +0 -0
  441. data/test/ral/providers/package/aptitude.rb +0 -0
  442. data/test/ral/providers/package/aptrpm.rb +0 -0
  443. data/test/ral/providers/parsedfile.rb +0 -0
  444. data/test/ral/providers/port/parsed.rb +0 -0
  445. data/test/ral/providers/provider.rb +0 -0
  446. data/test/ral/providers/service/base.rb +0 -0
  447. data/test/ral/providers/service/debian.rb +0 -0
  448. data/test/ral/providers/sshkey/parsed.rb +0 -0
  449. data/test/ral/providers/user.rb +0 -0
  450. data/test/ral/providers/user/useradd.rb +0 -0
  451. data/test/ral/type/basic.rb +0 -0
  452. data/test/ral/type/cron.rb +0 -0
  453. data/test/ral/type/exec.rb +0 -0
  454. data/test/ral/type/file.rb +0 -0
  455. data/test/ral/type/file/target.rb +0 -0
  456. data/test/ral/type/filebucket.rb +0 -0
  457. data/test/ral/type/fileignoresource.rb +0 -0
  458. data/test/ral/type/filesources.rb +0 -0
  459. data/test/ral/type/group.rb +0 -0
  460. data/test/ral/type/host.rb +0 -0
  461. data/test/ral/type/mailalias.rb +0 -0
  462. data/test/ral/type/parameter.rb +0 -0
  463. data/test/ral/type/port.rb +0 -0
  464. data/test/ral/type/property.rb +0 -0
  465. data/test/ral/type/resources.rb +0 -0
  466. data/test/ral/type/service.rb +0 -0
  467. data/test/ral/type/sshkey.rb +0 -0
  468. data/test/ral/type/tidy.rb +0 -0
  469. data/test/ral/type/user.rb +0 -0
  470. data/test/ral/type/yumrepo.rb +0 -0
  471. data/test/ral/type/zone.rb +0 -0
  472. data/test/test +0 -0
  473. data/test/util/autoload.rb +0 -0
  474. data/test/util/classgen.rb +0 -0
  475. data/test/util/execution.rb +0 -0
  476. data/test/util/features.rb +0 -0
  477. data/test/util/fileparsing.rb +0 -0
  478. data/test/util/inifile.rb +0 -0
  479. data/test/util/instance_loader.rb +0 -0
  480. data/test/util/log.rb +0 -0
  481. data/test/util/metrics.rb +0 -0
  482. data/test/util/package.rb +0 -0
  483. data/test/util/pidlock.rb +0 -0
  484. data/test/util/settings.rb +0 -0
  485. data/test/util/storage.rb +0 -0
  486. data/test/util/subclass_loader.rb +0 -0
  487. data/test/util/utiltest.rb +0 -0
  488. metadata +981 -968
  489. data/test/util/filetype.rb +0 -137
@@ -4,6 +4,9 @@ require File.dirname(__FILE__) + '/../../spec_helper'
4
4
 
5
5
  describe Puppet::Type.type(:group) do
6
6
  before do
7
+ unless ENV["PATH"].split(File::PATH_SEPARATOR).include?("/usr/sbin")
8
+ ENV["PATH"] += File::PATH_SEPARATOR + "/usr/sbin"
9
+ end
7
10
  @class = Puppet::Type.type(:group)
8
11
  end
9
12
 
File without changes
File without changes
File without changes
File without changes
@@ -6,6 +6,7 @@ require 'puppet/type'
6
6
 
7
7
  describe Puppet::Type.type(:file).attrclass(:noop) do
8
8
  before do
9
+ Puppet.settings.stubs(:use)
9
10
  @file = Puppet::Type.newfile :path => "/what/ever"
10
11
  end
11
12
 
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -89,14 +89,37 @@ describe ssh_authorized_key do
89
89
  @class.attrtype(:target).should == :property
90
90
  end
91
91
 
92
- it "should raise an error when neither user nor target is given" do
93
- proc do
94
- @class.create(
95
- :name => "Test",
96
- :key => "AAA",
97
- :type => "ssh-rsa",
98
- :ensure => :present)
99
- end.should raise_error(Puppet::Error)
92
+ describe "when neither user nor target is specified" do
93
+ it "should raise an error" do
94
+ proc do
95
+ @class.create(
96
+ :name => "Test",
97
+ :key => "AAA",
98
+ :type => "ssh-rsa",
99
+ :ensure => :present)
100
+ end.should raise_error(Puppet::Error)
101
+ end
102
+ end
103
+
104
+ describe "when both target and user are specified" do
105
+ it "should use target" do
106
+ resource = @class.create(
107
+ :name => "Test",
108
+ :user => "root",
109
+ :target => "/tmp/blah")
110
+ resource.should(:target).should == "/tmp/blah"
111
+ end
112
+ end
113
+
114
+
115
+ describe "when user is specified" do
116
+ it "should determine target" do
117
+ resource = @class.create(
118
+ :name => "Test",
119
+ :user => "root")
120
+ target = File.expand_path("~root/.ssh/authorized_keys")
121
+ resource.should(:target).should == target
122
+ end
100
123
  end
101
124
 
102
125
  after do
@@ -5,6 +5,10 @@ require File.dirname(__FILE__) + '/../../spec_helper'
5
5
  tidy = Puppet::Type.type(:tidy)
6
6
 
7
7
  describe tidy do
8
+ before do
9
+ Puppet.settings.stubs(:use)
10
+ end
11
+
8
12
  after { tidy.clear }
9
13
 
10
14
  it "should be in sync if the targeted file does not exist" do
@@ -6,6 +6,9 @@ user = Puppet::Type.type(:user)
6
6
 
7
7
  describe user do
8
8
  before do
9
+ unless ENV["PATH"].split(File::PATH_SEPARATOR).include?("/usr/sbin")
10
+ ENV["PATH"] += File::PATH_SEPARATOR + "/usr/sbin"
11
+ end
9
12
  @provider = stub 'provider'
10
13
  @resource = stub 'resource', :resource => nil, :provider => @provider, :line => nil, :file => nil
11
14
  end
@@ -182,6 +185,12 @@ describe user do
182
185
  @gid = user.attrclass(:gid).new(:resource => @resource, :should => %w{foo bar})
183
186
  end
184
187
 
188
+ it "should return true if no 'should' values are set" do
189
+ @gid = user.attrclass(:gid).new(:resource => @resource)
190
+
191
+ @gid.must be_insync(500)
192
+ end
193
+
185
194
  it "should return true if any of the specified groups are equal to the current integer" do
186
195
  Puppet::Util.expects(:gid).with("foo").returns 300
187
196
  Puppet::Util.expects(:gid).with("bar").returns 500
@@ -225,6 +234,14 @@ describe user do
225
234
  it "should not include the password in the change log when changing the password" do
226
235
  @password.change_to_s("other", "mypass").should_not be_include("mypass")
227
236
  end
237
+
238
+ it "should fail if a ':' is included in the password" do
239
+ lambda { @password.should = "some:thing" }.should raise_error(ArgumentError)
240
+ end
241
+
242
+ it "should allow the value to be set to :absent" do
243
+ lambda { @password.should = :absent }.should_not raise_error
244
+ end
228
245
  end
229
246
 
230
247
  describe "when manages_solaris_rbac is enabled" do
File without changes
File without changes
File without changes
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
4
+
5
+ require 'puppet/util/autoload'
6
+
7
+ describe Puppet::Util::Autoload do
8
+ before do
9
+ @autoload = Puppet::Util::Autoload.new("foo", "tmp")
10
+
11
+ @autoload.stubs(:eachdir).yields "/my/dir"
12
+ end
13
+
14
+ describe "when loading a file" do
15
+ [RuntimeError, LoadError, SyntaxError].each do |error|
16
+ it "should not die an if a #{error.to_s} exception is thrown" do
17
+ FileTest.stubs(:exists?).returns true
18
+
19
+ Kernel.expects(:load).raises error
20
+
21
+ lambda { @autoload.load("foo") }.should_not raise_error
22
+ end
23
+ end
24
+ end
25
+
26
+ describe "when loading all files" do
27
+ before do
28
+ Dir.stubs(:glob).returns "file.rb"
29
+ end
30
+
31
+ [RuntimeError, LoadError, SyntaxError].each do |error|
32
+ it "should not die an if a #{error.to_s} exception is thrown" do
33
+ Kernel.expects(:require).raises error
34
+
35
+ lambda { @autoload.loadall }.should_not raise_error
36
+ end
37
+ end
38
+ end
39
+ end
File without changes
File without changes
File without changes
@@ -0,0 +1,110 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
4
+
5
+ require 'puppet/util/filetype'
6
+
7
+ # XXX Import all of the tests into this file.
8
+ describe Puppet::Util::FileType do
9
+ describe "when backing up a file" do
10
+ before do
11
+ @file = Puppet::Util::FileType.filetype(:flat).new("/my/file")
12
+ end
13
+
14
+ it "should do nothing if the file does not exist" do
15
+ File.expects(:exists?).with("/my/file").returns false
16
+ @file.expects(:bucket).never
17
+ @file.backup
18
+ end
19
+
20
+ it "should use its filebucket to backup the file if it exists" do
21
+ File.expects(:exists?).with("/my/file").returns true
22
+
23
+ bucket = mock 'bucket'
24
+ bucket.expects(:backup).with("/my/file")
25
+
26
+ @file.expects(:bucket).returns bucket
27
+ @file.backup
28
+ end
29
+
30
+ it "should use the filebucket named 'puppet' if it finds one" do
31
+ bucket = mock 'bucket'
32
+ bucket.expects(:bucket).returns "mybucket"
33
+
34
+ Puppet::Type.type(:filebucket).expects(:[]).with("puppet").returns bucket
35
+
36
+ @file.bucket.should == "mybucket"
37
+ end
38
+
39
+ it "should use the default filebucket if none named 'puppet' is found" do
40
+ bucket = mock 'bucket'
41
+ bucket.expects(:bucket).returns "mybucket"
42
+
43
+ Puppet::Type.type(:filebucket).expects(:[]).with("puppet").returns nil
44
+ Puppet::Type.type(:filebucket).expects(:mkdefaultbucket).returns bucket
45
+
46
+ @file.bucket.should == "mybucket"
47
+ end
48
+ end
49
+
50
+ describe "the flat filetype" do
51
+ before do
52
+ @type = Puppet::Util::FileType.filetype(:flat)
53
+ end
54
+ it "should exist" do
55
+ @type.should_not be_nil
56
+ end
57
+
58
+ describe "when the file already exists" do
59
+ it "should return the file's contents when asked to read it" do
60
+ file = @type.new("/my/file")
61
+ File.expects(:exist?).with("/my/file").returns true
62
+ File.expects(:read).with("/my/file").returns "my text"
63
+
64
+ file.read.should == "my text"
65
+ end
66
+
67
+ it "should unlink the file when asked to remove it" do
68
+ file = @type.new("/my/file")
69
+ File.expects(:exist?).with("/my/file").returns true
70
+ File.expects(:unlink).with("/my/file")
71
+
72
+ file.remove
73
+ end
74
+ end
75
+
76
+ describe "when the file does not exist" do
77
+ it "should return an empty string when asked to read the file" do
78
+ file = @type.new("/my/file")
79
+ File.expects(:exist?).with("/my/file").returns false
80
+
81
+ file.read.should == ""
82
+ end
83
+ end
84
+
85
+ describe "when writing the file" do
86
+ before do
87
+ @file = @type.new("/my/file")
88
+ FileUtils.stubs(:cp)
89
+
90
+ @tempfile = stub 'tempfile', :print => nil, :close => nil, :flush => nil, :path => "/other/file"
91
+ Tempfile.stubs(:new).returns @tempfile
92
+ end
93
+
94
+ it "should first create a temp file and copy its contents over to the file location" do
95
+ Tempfile.expects(:new).with("puppet").returns @tempfile
96
+ @tempfile.expects(:print).with("my text")
97
+ @tempfile.expects(:flush)
98
+ @tempfile.expects(:close)
99
+ FileUtils.expects(:cp).with(@tempfile.path, "/my/file")
100
+
101
+ @file.write "my text"
102
+ end
103
+
104
+ it "should set the selinux default context on the file" do
105
+ @file.expects(:set_selinux_default_context).with("/my/file")
106
+ @file.write "eh"
107
+ end
108
+ end
109
+ end
110
+ end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -13,6 +13,9 @@ describe Puppet::Util::NagiosMaker do
13
13
 
14
14
  @nagtype = stub 'nagios type', :parameters => [], :namevar => :name
15
15
  Nagios::Base.stubs(:type).with(:test).returns(@nagtype)
16
+
17
+ @provider = stub 'provider', :nagios_type => nil
18
+ @type = stub 'type', :newparam => nil, :newproperty => nil, :provide => @provider, :desc => nil, :ensurable => nil
16
19
  end
17
20
 
18
21
  it "should be able to create a new nagios type" do
@@ -26,73 +29,59 @@ describe Puppet::Util::NagiosMaker do
26
29
  end
27
30
 
28
31
  it "should create a new RAL type with the provided name prefixed with 'nagios_'" do
29
- type = stub 'type', :newparam => nil, :newproperty => nil, :ensurable => nil, :provide => nil, :desc => nil
30
-
31
- Puppet::Type.expects(:newtype).with(:nagios_test).returns(type)
32
+ Puppet::Type.expects(:newtype).with(:nagios_test).returns(@type)
32
33
  @module.create_nagios_type(:test)
33
34
  end
34
35
 
35
36
  it "should mark the created type as ensurable" do
36
- type = stub 'type', :newparam => nil, :newproperty => nil, :provide => nil, :desc => nil
37
+ @type.expects(:ensurable)
37
38
 
38
- type.expects(:ensurable)
39
-
40
- Puppet::Type.expects(:newtype).with(:nagios_test).returns(type)
39
+ Puppet::Type.expects(:newtype).with(:nagios_test).returns(@type)
41
40
  @module.create_nagios_type(:test)
42
41
  end
43
42
 
44
43
  it "should create a namevar parameter for the nagios type's name parameter" do
45
- type = stub 'type', :newproperty => nil, :ensurable => nil, :provide => nil, :desc => nil
46
-
47
- type.expects(:newparam).with(:name, :namevar => true)
44
+ @type.expects(:newparam).with(:name, :namevar => true)
48
45
 
49
- Puppet::Type.expects(:newtype).with(:nagios_test).returns(type)
46
+ Puppet::Type.expects(:newtype).with(:nagios_test).returns(@type)
50
47
  @module.create_nagios_type(:test)
51
48
  end
52
49
 
53
50
  it "should create a property for all non-namevar parameters" do
54
- type = stub 'type', :newparam => nil, :ensurable => nil, :provide => nil, :desc => nil
55
-
56
51
  @nagtype.stubs(:parameters).returns([:one, :two])
57
52
 
58
- type.expects(:newproperty).with(:one)
59
- type.expects(:newproperty).with(:two)
60
- type.expects(:newproperty).with(:target)
53
+ @type.expects(:newproperty).with(:one)
54
+ @type.expects(:newproperty).with(:two)
55
+ @type.expects(:newproperty).with(:target)
61
56
 
62
- Puppet::Type.expects(:newtype).with(:nagios_test).returns(type)
57
+ Puppet::Type.expects(:newtype).with(:nagios_test).returns(@type)
63
58
  @module.create_nagios_type(:test)
64
59
  end
65
60
 
66
61
  it "should skip parameters that start with integers" do
67
- type = stub 'type', :newparam => nil, :ensurable => nil, :provide => nil, :desc => nil
68
-
69
62
  @nagtype.stubs(:parameters).returns(["2dcoords".to_sym, :other])
70
63
 
71
- type.expects(:newproperty).with(:other)
72
- type.expects(:newproperty).with(:target)
64
+ @type.expects(:newproperty).with(:other)
65
+ @type.expects(:newproperty).with(:target)
73
66
 
74
- Puppet::Type.expects(:newtype).with(:nagios_test).returns(type)
67
+ Puppet::Type.expects(:newtype).with(:nagios_test).returns(@type)
75
68
  @module.create_nagios_type(:test)
76
69
  end
77
70
 
78
71
  it "should deduplicate the parameter list" do
79
- type = stub 'type', :newparam => nil, :ensurable => nil, :provide => nil, :desc => nil
80
-
81
72
  @nagtype.stubs(:parameters).returns([:one, :one])
82
73
 
83
- type.expects(:newproperty).with(:one)
84
- type.expects(:newproperty).with(:target)
74
+ @type.expects(:newproperty).with(:one)
75
+ @type.expects(:newproperty).with(:target)
85
76
 
86
- Puppet::Type.expects(:newtype).with(:nagios_test).returns(type)
77
+ Puppet::Type.expects(:newtype).with(:nagios_test).returns(@type)
87
78
  @module.create_nagios_type(:test)
88
79
  end
89
80
 
90
81
  it "should create a target property" do
91
- type = stub 'type', :newparam => nil, :ensurable => nil, :provide => nil, :desc => nil
82
+ @type.expects(:newproperty).with(:target)
92
83
 
93
- type.expects(:newproperty).with(:target)
94
-
95
- Puppet::Type.expects(:newtype).with(:nagios_test).returns(type)
84
+ Puppet::Type.expects(:newtype).with(:nagios_test).returns(@type)
96
85
  @module.create_nagios_type(:test)
97
86
  end
98
87
  end
@@ -100,6 +89,7 @@ end
100
89
  describe Puppet::Util::NagiosMaker, " when creating the naginator provider" do
101
90
  before do
102
91
  @module = Puppet::Util::NagiosMaker
92
+ @provider = stub 'provider', :nagios_type => nil
103
93
 
104
94
  @nagtype = stub 'nagios type', :parameters => [], :namevar => :name
105
95
  Nagios::Base.stubs(:type).with(:test).returns(@nagtype)
@@ -109,19 +99,27 @@ describe Puppet::Util::NagiosMaker, " when creating the naginator provider" do
109
99
  end
110
100
 
111
101
  it "should add a naginator provider" do
112
- @type.expects(:provide).with { |name, options| name == :naginator }
102
+ @type.expects(:provide).with { |name, options| name == :naginator }.returns @provider
113
103
 
114
104
  @module.create_nagios_type(:test)
115
105
  end
116
106
 
117
107
  it "should set Puppet::Provider::Naginator as the parent class of the provider" do
118
- @type.expects(:provide).with { |name, options| options[:parent] == Puppet::Provider::Naginator }
108
+ @type.expects(:provide).with { |name, options| options[:parent] == Puppet::Provider::Naginator }.returns @provider
119
109
 
120
110
  @module.create_nagios_type(:test)
121
111
  end
122
112
 
123
113
  it "should use /etc/nagios/$name.cfg as the default target" do
124
- @type.expects(:provide).with { |name, options| options[:default_target] == "/etc/nagios/nagios_test.cfg" }
114
+ @type.expects(:provide).with { |name, options| options[:default_target] == "/etc/nagios/nagios_test.cfg" }.returns @provider
115
+
116
+ @module.create_nagios_type(:test)
117
+ end
118
+
119
+ it "should trigger the lookup of the Nagios class" do
120
+ @type.expects(:provide).returns @provider
121
+
122
+ @provider.expects(:nagios_type)
125
123
 
126
124
  @module.create_nagios_type(:test)
127
125
  end