chef 12.12.15-universal-mingw32 → 12.13.30-universal-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (412) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -0
  3. data/LICENSE +201 -201
  4. data/VERSION +1 -1
  5. data/acceptance/.gitignore +2 -0
  6. data/acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml +1 -12
  7. data/acceptance/.shared/kitchen_acceptance/libraries/kitchen.rb +29 -12
  8. data/acceptance/Gemfile +6 -3
  9. data/acceptance/Gemfile.lock +109 -67
  10. data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/top_cookbooks.rb +2 -2
  11. data/acceptance/trivial/.kitchen.yml +1 -1
  12. data/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/destroy.rb +1 -1
  13. data/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/provision.rb +1 -1
  14. data/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/verify.rb +1 -1
  15. data/acceptance/windows-service/test/integration/chef-windows-service/inspec/chef_windows_service_spec.rb +4 -4
  16. data/bin/chef-apply +0 -0
  17. data/bin/chef-client +0 -0
  18. data/bin/chef-service-manager +0 -0
  19. data/bin/chef-shell +0 -0
  20. data/bin/chef-solo +0 -0
  21. data/bin/chef-windows-service +0 -0
  22. data/bin/knife +0 -0
  23. data/chef.gemspec +4 -3
  24. data/distro/common/html/_sources/ctl_chef_client.txt +35 -35
  25. data/distro/common/html/_sources/ctl_chef_server.txt +341 -341
  26. data/distro/common/html/_sources/ctl_chef_shell.txt +15 -15
  27. data/distro/common/html/_sources/ctl_chef_solo.txt +25 -25
  28. data/distro/common/html/_sources/index.txt +135 -135
  29. data/distro/common/html/_sources/knife.txt +74 -74
  30. data/distro/common/html/_sources/knife_bootstrap.txt +56 -56
  31. data/distro/common/html/_sources/knife_client.txt +150 -150
  32. data/distro/common/html/_sources/knife_common_options.txt +6 -6
  33. data/distro/common/html/_sources/knife_configure.txt +29 -29
  34. data/distro/common/html/_sources/knife_cookbook.txt +236 -236
  35. data/distro/common/html/_sources/knife_cookbook_site.txt +157 -157
  36. data/distro/common/html/_sources/knife_data_bag.txt +159 -159
  37. data/distro/common/html/_sources/knife_delete.txt +26 -26
  38. data/distro/common/html/_sources/knife_deps.txt +61 -61
  39. data/distro/common/html/_sources/knife_diff.txt +34 -34
  40. data/distro/common/html/_sources/knife_download.txt +44 -44
  41. data/distro/common/html/_sources/knife_edit.txt +26 -26
  42. data/distro/common/html/_sources/knife_environment.txt +158 -158
  43. data/distro/common/html/_sources/knife_exec.txt +47 -47
  44. data/distro/common/html/_sources/knife_index_rebuild.txt +20 -20
  45. data/distro/common/html/_sources/knife_list.txt +33 -33
  46. data/distro/common/html/_sources/knife_node.txt +250 -250
  47. data/distro/common/html/_sources/knife_raw.txt +35 -35
  48. data/distro/common/html/_sources/knife_recipe_list.txt +23 -23
  49. data/distro/common/html/_sources/knife_role.txt +157 -157
  50. data/distro/common/html/_sources/knife_search.txt +53 -53
  51. data/distro/common/html/_sources/knife_serve.txt +18 -18
  52. data/distro/common/html/_sources/knife_show.txt +26 -26
  53. data/distro/common/html/_sources/knife_ssh.txt +43 -43
  54. data/distro/common/html/_sources/knife_ssl_check.txt +41 -41
  55. data/distro/common/html/_sources/knife_ssl_fetch.txt +41 -41
  56. data/distro/common/html/_sources/knife_status.txt +37 -37
  57. data/distro/common/html/_sources/knife_tag.txt +69 -69
  58. data/distro/common/html/_sources/knife_upload.txt +49 -49
  59. data/distro/common/html/_sources/knife_user.txt +127 -127
  60. data/distro/common/html/_sources/knife_using.txt +43 -43
  61. data/distro/common/html/_sources/knife_xargs.txt +30 -30
  62. data/distro/common/html/_static/guide.css +504 -504
  63. data/distro/common/html/_static/pygments.css +61 -61
  64. data/distro/common/html/_static/underscore.js +31 -31
  65. data/distro/common/html/ctl_chef_client.html +269 -269
  66. data/distro/common/html/ctl_chef_server.html +727 -727
  67. data/distro/common/html/ctl_chef_shell.html +162 -162
  68. data/distro/common/html/ctl_chef_solo.html +193 -193
  69. data/distro/common/html/index.html +201 -201
  70. data/distro/common/html/knife.html +169 -169
  71. data/distro/common/html/knife_bootstrap.html +284 -284
  72. data/distro/common/html/knife_client.html +284 -284
  73. data/distro/common/html/knife_common_options.html +95 -95
  74. data/distro/common/html/knife_configure.html +104 -104
  75. data/distro/common/html/knife_cookbook.html +486 -486
  76. data/distro/common/html/knife_data_bag.html +373 -373
  77. data/distro/common/html/knife_delete.html +92 -92
  78. data/distro/common/html/knife_deps.html +142 -142
  79. data/distro/common/html/knife_diff.html +122 -122
  80. data/distro/common/html/knife_download.html +144 -144
  81. data/distro/common/html/knife_edit.html +88 -88
  82. data/distro/common/html/knife_environment.html +325 -325
  83. data/distro/common/html/knife_exec.html +219 -219
  84. data/distro/common/html/knife_index_rebuild.html +82 -82
  85. data/distro/common/html/knife_list.html +113 -113
  86. data/distro/common/html/knife_node.html +457 -457
  87. data/distro/common/html/knife_raw.html +109 -109
  88. data/distro/common/html/knife_recipe_list.html +90 -90
  89. data/distro/common/html/knife_role.html +294 -294
  90. data/distro/common/html/knife_search.html +202 -202
  91. data/distro/common/html/knife_serve.html +78 -78
  92. data/distro/common/html/knife_show.html +103 -103
  93. data/distro/common/html/knife_ssh.html +176 -176
  94. data/distro/common/html/knife_ssl_check.html +150 -150
  95. data/distro/common/html/knife_ssl_fetch.html +150 -150
  96. data/distro/common/html/knife_status.html +143 -143
  97. data/distro/common/html/knife_tag.html +137 -137
  98. data/distro/common/html/knife_upload.html +152 -152
  99. data/distro/common/html/knife_user.html +241 -241
  100. data/distro/common/html/knife_using.html +209 -209
  101. data/distro/common/html/knife_xargs.html +121 -121
  102. data/distro/common/html/search.html +81 -81
  103. data/distro/common/man/man1/README.md +58 -58
  104. data/distro/common/man/man1/chef-shell.1 +194 -194
  105. data/distro/common/man/man1/knife-bootstrap.1 +215 -215
  106. data/distro/common/man/man1/knife-client.1 +443 -443
  107. data/distro/common/man/man1/knife-configure.1 +161 -161
  108. data/distro/common/man/man1/knife-cookbook.1 +770 -770
  109. data/distro/common/man/man1/knife-data-bag.1 +617 -617
  110. data/distro/common/man/man1/knife-delete.1 +127 -127
  111. data/distro/common/man/man1/knife-deps.1 +246 -246
  112. data/distro/common/man/man1/knife-diff.1 +226 -226
  113. data/distro/common/man/man1/knife-download.1 +258 -258
  114. data/distro/common/man/man1/knife-edit.1 +121 -121
  115. data/distro/common/man/man1/knife-environment.1 +508 -508
  116. data/distro/common/man/man1/knife-exec.1 +362 -362
  117. data/distro/common/man/man1/knife-index-rebuild.1 +63 -63
  118. data/distro/common/man/man1/knife-list.1 +174 -174
  119. data/distro/common/man/man1/knife-node.1 +716 -716
  120. data/distro/common/man/man1/knife-raw.1 +172 -172
  121. data/distro/common/man/man1/knife-recipe-list.1 +85 -85
  122. data/distro/common/man/man1/knife-role.1 +426 -426
  123. data/distro/common/man/man1/knife-search.1 +359 -359
  124. data/distro/common/man/man1/knife-serve.1 +109 -109
  125. data/distro/common/man/man1/knife-show.1 +160 -160
  126. data/distro/common/man/man1/knife-ssh.1 +284 -284
  127. data/distro/common/man/man1/knife-ssl-check.1 +207 -207
  128. data/distro/common/man/man1/knife-ssl-fetch.1 +207 -207
  129. data/distro/common/man/man1/knife-status.1 +234 -234
  130. data/distro/common/man/man1/knife-tag.1 +189 -189
  131. data/distro/common/man/man1/knife-upload.1 +280 -280
  132. data/distro/common/man/man1/knife-user.1 +356 -356
  133. data/distro/common/man/man1/knife-xargs.1 +189 -189
  134. data/distro/common/man/man1/knife.1 +332 -332
  135. data/distro/common/man/man8/chef-apply.8 +86 -86
  136. data/distro/common/man/man8/chef-client.8 +398 -398
  137. data/distro/common/man/man8/chef-solo.8 +260 -260
  138. data/distro/common/markdown/README +3 -3
  139. data/lib/chef/application.rb +23 -0
  140. data/lib/chef/application/client.rb +10 -2
  141. data/lib/chef/application/knife.rb +8 -0
  142. data/lib/chef/application/solo.rb +10 -2
  143. data/lib/chef/audit/audit_reporter.rb +5 -1
  144. data/lib/chef/audit/runner.rb +1 -1
  145. data/lib/chef/chef_fs/chef_fs_data_store.rb +1 -0
  146. data/lib/chef/chef_fs/file_system/repository/acls_dir.rb +4 -2
  147. data/lib/chef/chef_fs/file_system/repository/base_file.rb +3 -0
  148. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb +1 -0
  149. data/lib/chef/chef_fs/file_system/repository/directory.rb +12 -1
  150. data/lib/chef/chef_fs/file_system_cache.rb +80 -0
  151. data/lib/chef/data_collector.rb +18 -1
  152. data/lib/chef/data_collector/resource_report.rb +1 -0
  153. data/lib/chef/decorator/unchain.rb +16 -0
  154. data/lib/chef/dsl/cheffish.rb +1 -0
  155. data/lib/chef/dsl/declare_resource.rb +9 -1
  156. data/lib/chef/file_access_control/windows.rb +3 -3
  157. data/lib/chef/knife/bootstrap.rb +9 -0
  158. data/lib/chef/knife/cookbook_site_install.rb +2 -11
  159. data/lib/chef/knife/cookbook_site_share.rb +7 -13
  160. data/lib/chef/knife/core/bootstrap_context.rb +10 -0
  161. data/lib/chef/knife/help_topics.rb +4 -4
  162. data/lib/chef/nil_argument.rb +3 -3
  163. data/lib/chef/node/attribute.rb +2 -2
  164. data/lib/chef/provider/apt_repository.rb +1 -1
  165. data/lib/chef/provider/apt_update.rb +12 -3
  166. data/lib/chef/provider/cron.rb +1 -1
  167. data/lib/chef/provider/package/aix.rb +5 -1
  168. data/lib/chef/provider/package/zypper.rb +7 -7
  169. data/lib/chef/provider/resource_update.rb +52 -52
  170. data/lib/chef/reserved_names.rb +9 -9
  171. data/lib/chef/resource.rb +13 -1
  172. data/lib/chef/resource/freebsd_package.rb +1 -1
  173. data/lib/chef/run_context.rb +15 -42
  174. data/lib/chef/sandbox.rb +20 -20
  175. data/lib/chef/version.rb +1 -1
  176. data/lib/chef/version_class.rb +7 -2
  177. data/lib/chef/win32/file.rb +4 -4
  178. data/lib/chef/win32/system.rb +0 -0
  179. data/spec/data/apt/chef-integration-test-1.0/debian/changelog +5 -5
  180. data/spec/data/apt/chef-integration-test-1.0/debian/compat +1 -1
  181. data/spec/data/apt/chef-integration-test-1.0/debian/control +13 -13
  182. data/spec/data/apt/chef-integration-test-1.0/debian/files +1 -1
  183. data/spec/data/apt/chef-integration-test-1.0/debian/rules +13 -13
  184. data/spec/data/apt/chef-integration-test-1.0/debian/source/format +1 -1
  185. data/spec/data/apt/chef-integration-test-1.1/debian/changelog +11 -11
  186. data/spec/data/apt/chef-integration-test-1.1/debian/compat +1 -1
  187. data/spec/data/apt/chef-integration-test-1.1/debian/control +13 -13
  188. data/spec/data/apt/chef-integration-test-1.1/debian/files +1 -1
  189. data/spec/data/apt/chef-integration-test-1.1/debian/rules +13 -13
  190. data/spec/data/apt/chef-integration-test-1.1/debian/source/format +1 -1
  191. data/spec/data/apt/chef-integration-test2-1.0/debian/rules +0 -0
  192. data/spec/data/apt/chef-integration-test_1.0-1_amd64.changes +22 -22
  193. data/spec/data/apt/chef-integration-test_1.1-1_amd64.changes +22 -22
  194. data/spec/data/apt/var/www/apt/conf/distributions +7 -7
  195. data/spec/data/apt/var/www/apt/conf/incoming +4 -4
  196. data/spec/data/apt/var/www/apt/conf/pulls +3 -3
  197. data/spec/data/apt/var/www/apt/db/version +4 -4
  198. data/spec/data/apt/var/www/apt/dists/sid/Release +19 -19
  199. data/spec/data/apt/var/www/apt/dists/sid/main/binary-amd64/Packages +16 -16
  200. data/spec/data/apt/var/www/apt/dists/sid/main/binary-amd64/Release +5 -5
  201. data/spec/data/bootstrap/encrypted_data_bag_secret +1 -1
  202. data/spec/data/bootstrap/no_proxy.erb +2 -2
  203. data/spec/data/bootstrap/secret.erb +9 -9
  204. data/spec/data/bootstrap/test-hints.erb +12 -12
  205. data/spec/data/bootstrap/test.erb +1 -1
  206. data/spec/data/cb_version_cookbooks/tatft/README.rdoc +2 -2
  207. data/spec/data/cb_version_cookbooks/tatft/attributes/default.rb +1 -1
  208. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-600hhz-0 +1 -1
  209. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ahd2gq-0 +1 -1
  210. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-api8ux-0 +1 -1
  211. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-b0r1m1-0 +1 -1
  212. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-bfygsi-0 +1 -1
  213. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-el14l6-0 +1 -1
  214. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ivrl3y-0 +1 -1
  215. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-kkbs85-0 +1 -1
  216. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ory1ux-0 +1 -1
  217. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-pgsq76-0 +1 -1
  218. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ra8uim-0 +1 -1
  219. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-t7k1g-0 +1 -1
  220. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-t8g0sv-0 +1 -1
  221. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ufy6g3-0 +1 -1
  222. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-x2d6j9-0 +1 -1
  223. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-xi0l6h-0 +1 -1
  224. data/spec/data/config.rb +6 -6
  225. data/spec/data/cookbooks/angrybash/metadata.rb +2 -2
  226. data/spec/data/cookbooks/angrybash/recipes/default.rb +8 -8
  227. data/spec/data/cookbooks/apache2/files/default/apache2_module_conf_generate.pl +2 -2
  228. data/spec/data/cookbooks/apache2/metadata.rb +2 -2
  229. data/spec/data/cookbooks/apache2/recipes/default.rb +2 -2
  230. data/spec/data/cookbooks/borken/metadata.rb +2 -2
  231. data/spec/data/cookbooks/borken/recipes/default.rb +1 -1
  232. data/spec/data/cookbooks/borken/templates/default/borken.erb +1 -1
  233. data/spec/data/cookbooks/chefignore +8 -8
  234. data/spec/data/cookbooks/ignorken/files/default/not_me.rb +2 -2
  235. data/spec/data/cookbooks/ignorken/metadata.rb +2 -2
  236. data/spec/data/cookbooks/ignorken/recipes/ignoreme.rb +1 -1
  237. data/spec/data/cookbooks/ignorken/templates/ubuntu-12.10/not_me.rb +2 -2
  238. data/spec/data/cookbooks/java/files/default/java.response +1 -1
  239. data/spec/data/cookbooks/java/metadata.rb +2 -2
  240. data/spec/data/cookbooks/name-mismatch-versionnumber/README.md +4 -4
  241. data/spec/data/cookbooks/name-mismatch-versionnumber/metadata.rb +8 -8
  242. data/spec/data/cookbooks/openldap/attributes/default.rb +16 -16
  243. data/spec/data/cookbooks/openldap/attributes/smokey.rb +1 -1
  244. data/spec/data/cookbooks/openldap/definitions/client.rb +5 -5
  245. data/spec/data/cookbooks/openldap/definitions/server.rb +5 -5
  246. data/spec/data/cookbooks/openldap/files/default/.dotfile +1 -1
  247. data/spec/data/cookbooks/openldap/files/default/remotedir/.a_dotdir/.a_dotfile_in_a_dotdir +1 -1
  248. data/spec/data/cookbooks/openldap/files/default/remotedir/not_a_template.erb +2 -2
  249. data/spec/data/cookbooks/openldap/files/default/remotedir/remote_dir_file1.txt +2 -2
  250. data/spec/data/cookbooks/openldap/files/default/remotedir/remote_dir_file2.txt +2 -2
  251. data/spec/data/cookbooks/openldap/files/default/remotedir/remotesubdir/.a_dotfile +1 -1
  252. data/spec/data/cookbooks/openldap/files/default/remotedir/remotesubdir/remote_subdir_file1.txt +2 -2
  253. data/spec/data/cookbooks/openldap/files/default/remotedir/remotesubdir/remote_subdir_file2.txt +2 -2
  254. data/spec/data/cookbooks/openldap/files/default/remotedir/subdir_with_no_file_just_a_subsubdir/the_subsubdir/some_file.txt +3 -3
  255. data/spec/data/cookbooks/openldap/libraries/openldap.rb +4 -4
  256. data/spec/data/cookbooks/openldap/libraries/openldap/version.rb +3 -3
  257. data/spec/data/cookbooks/openldap/metadata.rb +8 -8
  258. data/spec/data/cookbooks/openldap/recipes/default.rb +4 -4
  259. data/spec/data/cookbooks/openldap/recipes/gigantor.rb +3 -3
  260. data/spec/data/cookbooks/openldap/recipes/one.rb +15 -15
  261. data/spec/data/cookbooks/openldap/recipes/return.rb +2 -2
  262. data/spec/data/cookbooks/openldap/templates/default/helper_test.erb +1 -1
  263. data/spec/data/cookbooks/openldap/templates/default/helpers_via_partial_test.erb +1 -1
  264. data/spec/data/cookbooks/openldap/templates/default/no_windows_line_endings.erb +4 -4
  265. data/spec/data/cookbooks/openldap/templates/default/openldap_variable_stuff.conf.erb +1 -1
  266. data/spec/data/cookbooks/openldap/templates/default/test.erb +1 -1
  267. data/spec/data/cookbooks/preseed/files/default/preseed-file.seed +1 -1
  268. data/spec/data/cookbooks/preseed/files/default/preseed-template.seed +4 -4
  269. data/spec/data/cookbooks/preseed/metadata.rb +2 -2
  270. data/spec/data/cookbooks/preseed/templates/default/preseed-template-variables.seed +1 -1
  271. data/spec/data/cookbooks/preseed/templates/default/preseed-template.seed +1 -1
  272. data/spec/data/definitions/test.rb +4 -4
  273. data/spec/data/environment-config.rb +4 -4
  274. data/spec/data/file-providers-method-snapshot-chef-11-4.json +127 -127
  275. data/spec/data/fileedit/hosts +4 -4
  276. data/spec/data/incomplete-metadata-chef-repo/incomplete-metadata/README.md +4 -4
  277. data/spec/data/incomplete-metadata-chef-repo/incomplete-metadata/metadata.rb +13 -13
  278. data/spec/data/invalid-metadata-chef-repo/invalid-metadata/README.md +4 -4
  279. data/spec/data/kitchen/chefignore +6 -6
  280. data/spec/data/kitchen/openldap/attributes/default.rb +3 -3
  281. data/spec/data/kitchen/openldap/attributes/robinson.rb +2 -2
  282. data/spec/data/kitchen/openldap/definitions/client.rb +3 -3
  283. data/spec/data/kitchen/openldap/definitions/drewbarrymore.rb +2 -2
  284. data/spec/data/kitchen/openldap/recipes/gigantor.rb +2 -2
  285. data/spec/data/kitchen/openldap/recipes/ignoreme.rb +2 -2
  286. data/spec/data/kitchen/openldap/recipes/woot.rb +3 -3
  287. data/spec/data/knife_subcommand/test_explicit_category.rb +6 -6
  288. data/spec/data/knife_subcommand/test_name_mapping.rb +4 -4
  289. data/spec/data/knife_subcommand/test_yourself.rb +21 -21
  290. data/spec/data/lwrp/providers/inline_compiler.rb +26 -26
  291. data/spec/data/lwrp/providers/monkey_name_printer.rb +5 -5
  292. data/spec/data/lwrp/providers/paint_drying_watcher.rb +7 -7
  293. data/spec/data/lwrp/providers/thumb_twiddler.rb +7 -7
  294. data/spec/data/lwrp/resources/foo.rb +4 -4
  295. data/spec/data/lwrp/resources_with_default_attributes/nodeattr.rb +1 -1
  296. data/spec/data/lwrp_override/providers/buck_passer.rb +5 -5
  297. data/spec/data/mac_users/10.7-8.plist.xml +559 -559
  298. data/spec/data/mac_users/10.7-8.shadow.xml +11 -11
  299. data/spec/data/mac_users/10.7.plist.xml +559 -559
  300. data/spec/data/mac_users/10.7.shadow.xml +11 -11
  301. data/spec/data/mac_users/10.8.plist.xml +559 -559
  302. data/spec/data/mac_users/10.8.shadow.xml +21 -21
  303. data/spec/data/mac_users/10.9.plist.xml +560 -560
  304. data/spec/data/mac_users/10.9.shadow.xml +21 -21
  305. data/spec/data/metadata/quick_start/metadata.rb +19 -19
  306. data/spec/data/nodes/default.rb +15 -15
  307. data/spec/data/nodes/test.example.com.rb +17 -17
  308. data/spec/data/nodes/test.rb +15 -15
  309. data/spec/data/null_config.rb +1 -1
  310. data/spec/data/object_loader/environments/test.json +7 -7
  311. data/spec/data/object_loader/environments/test.rb +2 -2
  312. data/spec/data/object_loader/environments/test_json_class.json +8 -8
  313. data/spec/data/object_loader/nodes/test.json +7 -7
  314. data/spec/data/object_loader/nodes/test.rb +2 -2
  315. data/spec/data/object_loader/nodes/test_json_class.json +8 -8
  316. data/spec/data/object_loader/roles/test.json +7 -7
  317. data/spec/data/object_loader/roles/test.rb +2 -2
  318. data/spec/data/object_loader/roles/test_json_class.json +8 -8
  319. data/spec/data/partial_one.erb +1 -1
  320. data/spec/data/recipes/test.rb +7 -7
  321. data/spec/data/run_context/cookbooks/circular-dep1/definitions/circular_dep1_res.rb +1 -1
  322. data/spec/data/run_context/cookbooks/circular-dep1/libraries/lib.rb +2 -2
  323. data/spec/data/run_context/cookbooks/circular-dep1/metadata.rb +2 -2
  324. data/spec/data/run_context/cookbooks/circular-dep1/providers/provider.rb +1 -1
  325. data/spec/data/run_context/cookbooks/circular-dep1/resources/resource.rb +1 -1
  326. data/spec/data/run_context/cookbooks/circular-dep2/definitions/circular_dep2_res.rb +1 -1
  327. data/spec/data/run_context/cookbooks/circular-dep2/libraries/lib.rb +2 -2
  328. data/spec/data/run_context/cookbooks/circular-dep2/metadata.rb +2 -2
  329. data/spec/data/run_context/cookbooks/circular-dep2/providers/provider.rb +1 -1
  330. data/spec/data/run_context/cookbooks/circular-dep2/resources/resource.rb +1 -1
  331. data/spec/data/run_context/cookbooks/dependency1/definitions/dependency1_res.rb +1 -1
  332. data/spec/data/run_context/cookbooks/dependency1/libraries/lib.rb +2 -2
  333. data/spec/data/run_context/cookbooks/dependency1/providers/provider.rb +1 -1
  334. data/spec/data/run_context/cookbooks/dependency1/resources/resource.rb +1 -1
  335. data/spec/data/run_context/cookbooks/dependency2/definitions/dependency2_res.rb +1 -1
  336. data/spec/data/run_context/cookbooks/dependency2/libraries/lib.rb +2 -2
  337. data/spec/data/run_context/cookbooks/dependency2/providers/provider.rb +1 -1
  338. data/spec/data/run_context/cookbooks/dependency2/resources/resource.rb +1 -1
  339. data/spec/data/run_context/cookbooks/no-default-attr/definitions/no_default-attr_res.rb +1 -1
  340. data/spec/data/run_context/cookbooks/no-default-attr/providers/provider.rb +1 -1
  341. data/spec/data/run_context/cookbooks/no-default-attr/resources/resource.rb +1 -1
  342. data/spec/data/run_context/cookbooks/test-with-circular-deps/definitions/test_with-circular-deps_res.rb +1 -1
  343. data/spec/data/run_context/cookbooks/test-with-circular-deps/libraries/lib.rb +2 -2
  344. data/spec/data/run_context/cookbooks/test-with-circular-deps/metadata.rb +2 -2
  345. data/spec/data/run_context/cookbooks/test-with-circular-deps/providers/provider.rb +1 -1
  346. data/spec/data/run_context/cookbooks/test-with-circular-deps/resources/resource.rb +1 -1
  347. data/spec/data/run_context/cookbooks/test-with-deps/definitions/test_with-deps_res.rb +1 -1
  348. data/spec/data/run_context/cookbooks/test-with-deps/libraries/lib.rb +1 -1
  349. data/spec/data/run_context/cookbooks/test-with-deps/metadata.rb +3 -3
  350. data/spec/data/run_context/cookbooks/test-with-deps/providers/provider.rb +1 -1
  351. data/spec/data/run_context/cookbooks/test-with-deps/resources/resource.rb +1 -1
  352. data/spec/data/run_context/cookbooks/test/attributes/george.rb +1 -1
  353. data/spec/data/run_context/cookbooks/test/definitions/new_animals.rb +9 -9
  354. data/spec/data/run_context/cookbooks/test/definitions/new_cat.rb +5 -5
  355. data/spec/data/run_context/cookbooks/test/definitions/test_res.rb +1 -1
  356. data/spec/data/run_context/cookbooks/test/providers/provider.rb +1 -1
  357. data/spec/data/run_context/cookbooks/test/recipes/default.rb +5 -5
  358. data/spec/data/run_context/cookbooks/test/recipes/one.rb +7 -7
  359. data/spec/data/run_context/cookbooks/test/recipes/two.rb +7 -7
  360. data/spec/data/run_context/cookbooks/test/resources/resource.rb +1 -1
  361. data/spec/data/run_context/nodes/run_context.rb +5 -5
  362. data/spec/data/search_queries_to_transform.txt +98 -98
  363. data/spec/data/shef-config.rb +10 -10
  364. data/spec/data/ssl/5e707473.0 +18 -18
  365. data/spec/data/ssl/chef-rspec.cert +27 -27
  366. data/spec/data/ssl/chef-rspec.key +27 -27
  367. data/spec/data/ssl/key.pem +15 -15
  368. data/spec/data/ssl/private_key.pem +27 -27
  369. data/spec/data/ssl/private_key_with_whitespace.pem +32 -32
  370. data/spec/data/standalone_cookbook/chefignore +9 -9
  371. data/spec/data/standalone_cookbook/recipes/default.rb +2 -2
  372. data/spec/data/trusted_certs/example.crt +22 -22
  373. data/spec/data/trusted_certs/intermediate.pem +27 -27
  374. data/spec/data/trusted_certs/root.pem +22 -22
  375. data/spec/functional/assets/chefinittest +34 -34
  376. data/spec/functional/assets/testchefsubsys +10 -10
  377. data/spec/functional/mixin/powershell_out_spec.rb +2 -2
  378. data/spec/functional/provider/remote_file/cache_control_data_spec.rb +0 -0
  379. data/spec/functional/resource/aix_service_spec.rb +0 -0
  380. data/spec/functional/resource/aixinit_service_spec.rb +0 -0
  381. data/spec/functional/resource/cron_spec.rb +8 -1
  382. data/spec/functional/resource/env_spec.rb +0 -0
  383. data/spec/functional/resource/link_spec.rb +1 -6
  384. data/spec/functional/run_lock_spec.rb +17 -10
  385. data/spec/integration/knife/diff_spec.rb +2 -2
  386. data/spec/integration/knife/download_spec.rb +4 -4
  387. data/spec/integration/knife/raw_spec.rb +2 -0
  388. data/spec/integration/knife/upload_spec.rb +3 -3
  389. data/spec/rcov.opts +2 -2
  390. data/spec/spec_helper.rb +11 -1
  391. data/spec/support/shared/integration/knife_support.rb +4 -0
  392. data/spec/unit/application/client_spec.rb +35 -0
  393. data/spec/unit/application/solo_spec.rb +6 -6
  394. data/spec/unit/chef_fs/file_system/repository/directory_spec.rb +1 -0
  395. data/spec/unit/data_collector_spec.rb +41 -1
  396. data/spec/unit/dsl/declare_resource_spec.rb +30 -0
  397. data/spec/unit/knife/cookbook_site_install_spec.rb +2 -0
  398. data/spec/unit/knife/cookbook_site_share_spec.rb +4 -4
  399. data/spec/unit/node_spec.rb +6 -0
  400. data/spec/unit/provider/cron_spec.rb +16 -16
  401. data/spec/unit/provider/package/aix_spec.rb +13 -0
  402. data/spec/unit/provider/package/zypper_spec.rb +18 -2
  403. data/spec/unit/resource/apt_repository_spec.rb +14 -2
  404. data/spec/unit/resource/apt_update_spec.rb +14 -2
  405. data/spec/unit/resource_builder_spec.rb +1 -1
  406. data/tasks/bin/bundle-platform +0 -0
  407. data/tasks/bin/bundle-platform.bat +0 -0
  408. data/tasks/bin/create-override-gemfile +0 -0
  409. data/tasks/bin/run_external_test +0 -0
  410. data/tasks/bundle.rb +2 -2
  411. metadata +29 -15
  412. data/acceptance/data-collector/Berksfile.lock +0 -6
File without changes
@@ -580,12 +580,7 @@ describe Chef::Resource::Link do
580
580
  it "links to the target file" do
581
581
  skip("OS X/FreeBSD/AIX fails to create hardlinks to broken symlinks") if os_x? || freebsd? || aix?
582
582
  resource.run_action(:create)
583
- # Windows and Unix have different definitions of exists? here, and that's OK.
584
- if windows?
585
- expect(File.exists?(target_file)).to be_truthy
586
- else
587
- expect(File.exists?(target_file)).to be_falsey
588
- end
583
+ expect(File.exists?(target_file) || File.symlink?(target_file)).to be_truthy
589
584
  expect(symlink?(target_file)).to be_truthy
590
585
  expect(readlink(target_file)).to eq(canonicalize(@other_target))
591
586
  end
@@ -258,11 +258,12 @@ describe Chef::RunLock do
258
258
 
259
259
  it "test returns true and acquires the lock" do
260
260
  run_lock = Chef::RunLock.new(lockfile)
261
+ from_tests, to_fork = IO.pipe
261
262
  p1 = fork do
262
263
  expect(run_lock.test).to eq(true)
263
- run_lock.save_pid
264
- sleep 2
265
- exit! 1
264
+ # Wait for the test to tell us we can exit before exiting
265
+ from_tests.readline
266
+ exit! 0
266
267
  end
267
268
 
268
269
  wait_on_lock
@@ -272,23 +273,29 @@ describe Chef::RunLock do
272
273
  exit! 0
273
274
  end
274
275
 
275
- Process.waitpid2(p2)
276
- Process.waitpid2(p1)
276
+ pid, exit_status = Process.waitpid2(p2)
277
+ expect(exit_status).to eq(0)
278
+ to_fork.puts "you can exit now"
279
+ pid, exit_status = Process.waitpid2(p1)
280
+ expect(exit_status).to eq(0)
277
281
  end
278
282
 
279
283
  it "test returns without waiting when the lock is acquired" do
280
284
  run_lock = Chef::RunLock.new(lockfile)
285
+ from_tests, to_fork = IO.pipe
281
286
  p1 = fork do
282
287
  run_lock.acquire
283
- run_lock.save_pid
284
- sleep 2
285
- exit! 1
288
+ # Wait for the test to tell us we can exit before exiting
289
+ from_tests.readline
290
+ exit! 0
286
291
  end
287
292
 
288
293
  wait_on_lock
289
-
290
294
  expect(run_lock.test).to eq(false)
291
- Process.waitpid2(p1)
295
+
296
+ to_fork.puts "you can exit now"
297
+ pid, exit_status = Process.waitpid2(p1)
298
+ expect(exit_status).to eq(0)
292
299
  end
293
300
 
294
301
  end
@@ -72,7 +72,7 @@ EOM
72
72
  file "data_bags/x/y.json", {}
73
73
  file "environments/_default.json", { "description" => "The default Chef environment" }
74
74
  file "environments/x.json", {}
75
- file "nodes/x.json", {}
75
+ file "nodes/x.json", { "normal" => { "tags" => [] } }
76
76
  file "roles/x.json", {}
77
77
  file "users/admin.json", { "admin" => true, "public_key" => ChefZero::PUBLIC_KEY }
78
78
  file "users/x.json", { "public_key" => ChefZero::PUBLIC_KEY }
@@ -366,7 +366,7 @@ EOM
366
366
  file "data_bags/x/y.json", {}
367
367
  file "environments/_default.json", { "description" => "The default Chef environment" }
368
368
  file "environments/x.json", {}
369
- file "nodes/x.json", {}
369
+ file "nodes/x.json", { "normal" => { "tags" => [] } }
370
370
  file "roles/x.json", {}
371
371
  file "users/admin.json", { "admin" => true, "public_key" => ChefZero::PUBLIC_KEY }
372
372
  file "users/x.json", { "public_key" => ChefZero::PUBLIC_KEY }
@@ -76,7 +76,7 @@ EOM
76
76
  file "data_bags/x/y.json", {}
77
77
  file "environments/_default.json", { "description" => "The default Chef environment" }
78
78
  file "environments/x.json", {}
79
- file "nodes/x.json", {}
79
+ file "nodes/x.json", { "normal" => { "tags" => [] } }
80
80
  file "roles/x.json", {}
81
81
  file "users/admin.json", { "admin" => true, "public_key" => ChefZero::PUBLIC_KEY }
82
82
  file "users/x.json", { "public_key" => ChefZero::PUBLIC_KEY }
@@ -645,7 +645,7 @@ EOM
645
645
  file "data_bags/x/y.json", {}
646
646
  file "environments/_default.json", { "description" => "The default Chef environment" }
647
647
  file "environments/x.json", {}
648
- file "nodes/x.json", {}
648
+ file "nodes/x.json", { "normal" => { "tags" => [] } }
649
649
  file "roles/x.json", {}
650
650
  file "users/admin.json", { "admin" => true, "public_key" => ChefZero::PUBLIC_KEY }
651
651
  file "users/x.json", { "public_key" => ChefZero::PUBLIC_KEY }
@@ -1271,7 +1271,7 @@ EOM
1271
1271
  file "groups/x.json", {}
1272
1272
  file "invitations.json", [ "foo" ]
1273
1273
  file "members.json", [ "bar" ]
1274
- file "nodes/x.json", {}
1274
+ file "nodes/x.json", { "normal" => { "tags" => [] } }
1275
1275
  file "org.json", { "full_name" => "Something" }
1276
1276
  file "policies/x-1.0.0.json", {}
1277
1277
  file "policies/blah-1.0.0.json", {}
@@ -1295,7 +1295,7 @@ EOM
1295
1295
  file "environments/x.json", { "description" => "foo" }
1296
1296
  file "groups/x.json", { "description" => "foo" }
1297
1297
  file "groups/x.json", { "groups" => [ "admin" ] }
1298
- file "nodes/x.json", { "run_list" => [ "blah" ] }
1298
+ file "nodes/x.json", { "normal" => { "tags" => [] }, "run_list" => [ "blah" ] }
1299
1299
  file "org.json", { "full_name" => "Something Else " }
1300
1300
  file "policies/x-1.0.0.json", { "run_list" => [ "blah" ] }
1301
1301
  file "policy_groups/x.json", {
@@ -49,7 +49,9 @@ describe "knife raw", :workstation do
49
49
 
50
50
  },
51
51
  "normal": {
52
+ "tags": [
52
53
 
54
+ ]
53
55
  },
54
56
  "default": {
55
57
 
@@ -96,7 +96,7 @@ EOM
96
96
  file "data_bags/x/y.json", {}
97
97
  file "environments/_default.json", { "description" => "The default Chef environment" }
98
98
  file "environments/x.json", {}
99
- file "nodes/x.json", {}
99
+ file "nodes/x.json", { "normal" => { "tags" => [] } }
100
100
  file "roles/x.json", {}
101
101
  file "users/admin.json", { "admin" => true, "public_key" => ChefZero::PUBLIC_KEY }
102
102
  file "users/x.json", { "public_key" => ChefZero::PUBLIC_KEY }
@@ -802,7 +802,7 @@ EOM
802
802
  file "data_bags/x/y.json", {}
803
803
  file "environments/_default.json", { "description" => "The default Chef environment" }
804
804
  file "environments/x.json", {}
805
- file "nodes/x.json", {}
805
+ file "nodes/x.json", { "normal" => { "tags" => [] } }
806
806
  file "roles/x.json", {}
807
807
  file "users/admin.json", { "admin" => true, "public_key" => ChefZero::PUBLIC_KEY }
808
808
  file "users/x.json", { "public_key" => ChefZero::PUBLIC_KEY }
@@ -1313,7 +1313,7 @@ EOM
1313
1313
  file "invitations.json", [ "foo" ]
1314
1314
  file "members.json", [ "bar" ]
1315
1315
  file "org.json", { "full_name" => "wootles" }
1316
- file "nodes/x.json", {}
1316
+ file "nodes/x.json", { "normal" => { "tags" => [] } }
1317
1317
  file "policies/x-1.0.0.json", {}
1318
1318
  file "policies/blah-1.0.0.json", {}
1319
1319
  file "policy_groups/x.json", { "policies" => { "x" => { "revision_id" => "1.0.0" }, "blah" => { "revision_id" => "1.0.0" } } }
@@ -1,2 +1,2 @@
1
- --exclude
2
- spec,bin,/Library/Ruby
1
+ --exclude
2
+ spec,bin,/Library/Ruby
@@ -66,6 +66,8 @@ require "chef/util/file_edit"
66
66
 
67
67
  require "chef/config"
68
68
 
69
+ require "chef/chef_fs/file_system_cache"
70
+
69
71
  if ENV["CHEF_FIPS"] == "1"
70
72
  Chef::Config.init_openssl
71
73
  end
@@ -200,6 +202,8 @@ RSpec.configure do |config|
200
202
  config.before(:each) do
201
203
  Chef.reset!
202
204
 
205
+ Chef::ChefFS::FileSystemCache.instance.reset!
206
+
203
207
  Chef::Config.reset
204
208
 
205
209
  # By default, treat deprecation warnings as errors in tests.
@@ -220,6 +224,7 @@ RSpec.configure do |config|
220
224
  end
221
225
 
222
226
  require "webrick/utils"
227
+ require "thread"
223
228
 
224
229
  # Webrick uses a centralized/synchronized timeout manager. It works by
225
230
  # starting a thread to check for timeouts on an interval. The timeout
@@ -238,7 +243,12 @@ module WEBrick
238
243
  module Utils
239
244
  class TimeoutHandler
240
245
  def initialize
241
- @timeout_info = Hash.new
246
+ end
247
+
248
+ def register(*args)
249
+ end
250
+
251
+ def cancel(*args)
242
252
  end
243
253
  end
244
254
  end
@@ -20,6 +20,7 @@ require "chef/knife"
20
20
  require "chef/application/knife"
21
21
  require "logger"
22
22
  require "chef/log"
23
+ require "chef/chef_fs/file_system_cache"
23
24
 
24
25
  module KnifeSupport
25
26
  DEBUG = ENV["DEBUG"]
@@ -70,6 +71,9 @@ module KnifeSupport
70
71
  Chef::Config[:verbosity] = ( DEBUG ? 2 : 0 )
71
72
  instance.config[:config_file] = File.join(CHEF_SPEC_DATA, "null_config.rb")
72
73
 
74
+ # Ensure the ChefFS cache is empty
75
+ Chef::ChefFS::FileSystemCache.instance.reset!
76
+
73
77
  # Configure chef with a (mostly) blank knife.rb
74
78
  # We set a global and then mutate it in our stub knife.rb so we can be
75
79
  # extra sure that we're not loading someone's real knife.rb and then
@@ -74,6 +74,8 @@ describe Chef::Application::Client, "reconfigure" do
74
74
  end
75
75
 
76
76
  before do
77
+ Chef::Config.reset
78
+
77
79
  allow(Kernel).to receive(:trap).and_return(:ok)
78
80
  allow(::File).to receive(:read).and_call_original
79
81
  allow(::File).to receive(:read).with(Chef::Config.platform_specific_path("/etc/chef/client.rb")).and_return("")
@@ -141,6 +143,39 @@ describe Chef::Application::Client, "reconfigure" do
141
143
  :daemonize => true
142
144
  end
143
145
  end
146
+
147
+ describe "--config-option" do
148
+ context "with a single value" do
149
+ it_behaves_like "sets the configuration", "--config-option chef_server_url=http://example",
150
+ :chef_server_url => "http://example"
151
+ end
152
+
153
+ context "with two values" do
154
+ it_behaves_like "sets the configuration", "--config-option chef_server_url=http://example --config-option policy_name=web",
155
+ :chef_server_url => "http://example", :policy_name => "web"
156
+ end
157
+
158
+ context "with a boolean value" do
159
+ it_behaves_like "sets the configuration", "--config-option minimal_ohai=true",
160
+ :minimal_ohai => true
161
+ end
162
+
163
+ context "with an empty value" do
164
+ it "should terminate with message" do
165
+ expect(Chef::Application).to receive(:fatal!).with('Unparsable config option ""').and_raise("so ded")
166
+ ARGV.replace(["--config-option", ""])
167
+ expect { app.reconfigure }.to raise_error "so ded"
168
+ end
169
+ end
170
+
171
+ context "with an invalid value" do
172
+ it "should terminate with message" do
173
+ expect(Chef::Application).to receive(:fatal!).with('Unparsable config option "asdf"').and_raise("so ded")
174
+ ARGV.replace(["--config-option", "asdf"])
175
+ expect { app.reconfigure }.to raise_error "so ded"
176
+ end
177
+ end
178
+ end
144
179
  end
145
180
 
146
181
  describe "when configured to not fork the client process" do
@@ -120,9 +120,10 @@ Enable chef-client interval runs by setting `:client_fork = true` in your config
120
120
  expect(app).to receive(:open).with("http://junglist.gen.nz/recipes.tgz").and_yield(tarfile)
121
121
  expect(File).to receive(:open).with("#{Dir.tmpdir}/chef-solo/recipes.tgz", "wb").and_yield(target_file)
122
122
 
123
- shellout = instance_double("Mixlib::ShellOut", run_command: nil, error!: nil, stdout: "")
123
+ archive = double(Mixlib::Archive)
124
124
 
125
- expect(app).to receive(:shell_out!).with("tar zxvf #{Dir.tmpdir}/chef-solo/recipes.tgz -C #{Dir.tmpdir}/chef-solo").and_return(shellout)
125
+ expect(Mixlib::Archive).to receive(:new).with("#{Dir.tmpdir}/chef-solo/recipes.tgz").and_return(archive)
126
+ expect(archive).to receive(:extract).with("#{Dir.tmpdir}/chef-solo", { perms: false, ignore: /^\.$/ })
126
127
  app.reconfigure
127
128
  expect(target_file.string).to eq("remote_tarball_content")
128
129
  end
@@ -136,11 +137,10 @@ Enable chef-client interval runs by setting `:client_fork = true` in your config
136
137
  Chef::Config[:cookbook_path] = "#{Dir.tmpdir}/chef-solo/cookbooks"
137
138
  expect(FileUtils).to receive(:mkdir_p).with("#{Dir.tmpdir}/chef-solo").and_return(true)
138
139
 
139
- allow(Chef::Mixin::Command).to receive(:run_command).and_return(true)
140
+ archive = double(Mixlib::Archive)
140
141
 
141
- shellout = instance_double("Mixlib::ShellOut", run_command: nil, error!: nil, stdout: "")
142
-
143
- expect(app).to receive(:shell_out!).with("tar zxvf #{Dir.tmpdir}/chef-solo/recipes.tgz -C #{Dir.tmpdir}/chef-solo").and_return(shellout)
142
+ expect(Mixlib::Archive).to receive(:new).with("#{Dir.tmpdir}/chef-solo/recipes.tgz").and_return(archive)
143
+ expect(archive).to receive(:extract).with("#{Dir.tmpdir}/chef-solo", { perms: false, ignore: /^\.$/ })
144
144
  expect(app).to receive(:fetch_recipe_tarball).ordered
145
145
  expect(Chef::ConfigFetcher).to receive(:new).ordered.and_return(config_fetcher)
146
146
  app.reconfigure
@@ -76,6 +76,7 @@ describe Chef::ChefFS::FileSystem::Repository::Directory do
76
76
  context "#create_child" do
77
77
  it "creates a new TestFile" do
78
78
  expect(TestFile).to receive(:new).with("test_child", test_directory).and_return(file_double)
79
+ allow(file_double).to receive(:file_path).and_return("#{test_directory}/test_child")
79
80
  expect(file_double).to receive(:write).with("test")
80
81
  test_directory.create_child("test_child", "test")
81
82
  end
@@ -156,6 +156,10 @@ describe Chef::DataCollector::Reporter do
156
156
  let(:reporter) { described_class.new }
157
157
  let(:run_status) { Chef::RunStatus.new(Chef::Node.new, Chef::EventDispatch::Dispatcher.new) }
158
158
 
159
+ before do
160
+ Chef::Config[:data_collector][:server_url] = "http://my-data-collector-server.mycompany.com"
161
+ end
162
+
159
163
  describe '#run_started' do
160
164
  before do
161
165
  allow(reporter).to receive(:update_run_status)
@@ -490,7 +494,8 @@ describe Chef::DataCollector::Reporter do
490
494
 
491
495
  [ Timeout::Error, Errno::EINVAL, Errno::ECONNRESET,
492
496
  Errno::ECONNREFUSED, EOFError, Net::HTTPBadResponse,
493
- Net::HTTPHeaderSyntaxError, Net::ProtocolError, OpenSSL::SSL::SSLError ].each do |exception_class|
497
+ Net::HTTPHeaderSyntaxError, Net::ProtocolError, OpenSSL::SSL::SSLError,
498
+ Errno::EHOSTDOWN ].each do |exception_class|
494
499
  context "when the block raises a #{exception_class} exception" do
495
500
  it "disables the reporter" do
496
501
  expect(reporter).to receive(:disable_data_collector_reporter)
@@ -515,4 +520,39 @@ describe Chef::DataCollector::Reporter do
515
520
  end
516
521
  end
517
522
  end
523
+
524
+ describe '#validate_data_collector_server_url!' do
525
+ context "when server_url is empty" do
526
+ it "raises an exception" do
527
+ Chef::Config[:data_collector][:server_url] = ""
528
+ expect { reporter.send(:validate_data_collector_server_url!) }.to raise_error(Chef::Exceptions::ConfigurationError)
529
+ end
530
+ end
531
+
532
+ context "when server_url is not empty" do
533
+ context "when server_url is an invalid URI" do
534
+ it "raises an exception" do
535
+ Chef::Config[:data_collector][:server_url] = "this is not a URI"
536
+ expect { reporter.send(:validate_data_collector_server_url!) }.to raise_error(Chef::Exceptions::ConfigurationError)
537
+ end
538
+ end
539
+
540
+ context "when server_url is a valid URI" do
541
+ context "when server_url is a URI with no host" do
542
+ it "raises an exception" do
543
+ Chef::Config[:data_collector][:server_url] = "/file/uri.txt"
544
+ expect { reporter.send(:validate_data_collector_server_url!) }.to raise_error(Chef::Exceptions::ConfigurationError)
545
+ end
546
+
547
+ end
548
+
549
+ context "when server_url is a URI with a valid host" do
550
+ it "does not an exception" do
551
+ Chef::Config[:data_collector][:server_url] = "http://www.google.com/data-collector"
552
+ expect { reporter.send(:validate_data_collector_server_url!) }.not_to raise_error
553
+ end
554
+ end
555
+ end
556
+ end
557
+ end
518
558
  end
@@ -235,6 +235,36 @@ describe Chef::ResourceCollection do
235
235
  ).to eql(resource)
236
236
  expect(run_context.resource_collection.all_resources.size).to eql(0)
237
237
  end
238
+
239
+ it "removes pending delayed notifications" do
240
+ recipe.declare_resource(:zen_master, "one")
241
+ recipe.declare_resource(:zen_master, "two") do
242
+ notifies :win, "zen_master[one]"
243
+ end
244
+ recipe.delete_resource(:zen_master, "two")
245
+ resource = recipe.declare_resource(:zen_master, "two")
246
+ expect(resource.delayed_notifications).to eql([])
247
+ end
248
+
249
+ it "removes pending immediate notifications" do
250
+ recipe.declare_resource(:zen_master, "one")
251
+ recipe.declare_resource(:zen_master, "two") do
252
+ notifies :win, "zen_master[one]", :immediate
253
+ end
254
+ recipe.delete_resource(:zen_master, "two")
255
+ resource = recipe.declare_resource(:zen_master, "two")
256
+ expect(resource.immediate_notifications).to eql([])
257
+ end
258
+
259
+ it "removes pending before notifications" do
260
+ recipe.declare_resource(:zen_master, "one")
261
+ recipe.declare_resource(:zen_master, "two") do
262
+ notifies :win, "zen_master[one]", :before
263
+ end
264
+ recipe.delete_resource(:zen_master, "two")
265
+ resource = recipe.declare_resource(:zen_master, "two")
266
+ expect(resource.before_notifications).to eql([])
267
+ end
238
268
  end
239
269
 
240
270
  describe "run_context helpers" do
@@ -23,6 +23,7 @@ describe Chef::Knife::CookbookSiteInstall do
23
23
  let(:stdout) { StringIO.new }
24
24
  let(:stderr) { StringIO.new }
25
25
  let(:downloader) { Hash.new }
26
+ let(:archive) { double(Mixlib::Archive, extract: true) }
26
27
  let(:repo) { double(:sanity_check => true, :reset_to_default_state => true,
27
28
  :prepare_to_import => true, :finalize_updates_to => true,
28
29
  :merge_updates_from => true) }
@@ -48,6 +49,7 @@ describe Chef::Knife::CookbookSiteInstall do
48
49
  allow(File).to receive(:unlink)
49
50
  allow(File).to receive(:rmtree)
50
51
  allow(knife).to receive(:shell_out!).and_return(true)
52
+ allow(Mixlib::Archive).to receive(:new).and_return(archive)
51
53
 
52
54
  # CookbookSiteDownload Stup
53
55
  allow(knife).to receive(:download_cookbook_to).and_return(downloader)
@@ -83,11 +83,11 @@ describe Chef::Knife::CookbookSiteShare do
83
83
  @knife.run
84
84
  end
85
85
 
86
- it "should print error and exit when given only 1 argument and cannot determine category" do
86
+ it "should use a default category when given only 1 argument and cannot determine category" do
87
87
  @knife.name_args = ["cookbook_name"]
88
- expect(@noauth_rest).to receive(:get).with("https://supermarket.chef.io/api/v1/cookbooks/cookbook_name").and_return(@bad_category_response)
89
- expect(@knife.ui).to receive(:fatal)
90
- expect { @knife.run }.to raise_error(SystemExit)
88
+ expect(@noauth_rest).to receive(:get).with("https://supermarket.chef.io/api/v1/cookbooks/cookbook_name") { raise Net::HTTPServerException.new("404 Not Found", OpenStruct.new(code: "404")) }
89
+ expect(@knife).to receive(:do_upload)
90
+ expect { @knife.run }.to_not raise_error
91
91
  end
92
92
 
93
93
  it "should print error and exit when given only 1 argument and Chef::ServerAPI throws an exception" do
@@ -255,6 +255,12 @@ describe Chef::Node do
255
255
  expect(node[:snoopy][:is_a_puppy]).to eq(true)
256
256
  end
257
257
 
258
+ it "should allow you to set an attribute with set_unless with method_missing but emit a deprecation warning" do
259
+ Chef::Config[:treat_deprecation_warnings_as_errors] = false
260
+ node.normal_unless.snoopy.is_a_puppy = false
261
+ expect(node[:snoopy][:is_a_puppy]).to eq(false)
262
+ end
263
+
258
264
  it "should allow you to set an attribute with set_unless" do
259
265
  node.normal_unless[:snoopy][:is_a_puppy] = false
260
266
  expect(node[:snoopy][:is_a_puppy]).to eq(false)