knife 17.0.246 → 17.1.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (570) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -5
  3. data/Rakefile +1 -6
  4. data/knife.gemspec +1 -1
  5. data/lib/chef/knife/version.rb +1 -1
  6. data/spec/data/apt/chef-integration-test-1.0/debian/changelog +5 -0
  7. data/spec/data/apt/chef-integration-test-1.0/debian/compat +1 -0
  8. data/spec/data/apt/chef-integration-test-1.0/debian/control +13 -0
  9. data/spec/data/apt/chef-integration-test-1.0/debian/copyright +34 -0
  10. data/spec/data/apt/chef-integration-test-1.0/debian/files +1 -0
  11. data/spec/data/apt/chef-integration-test-1.0/debian/rules +13 -0
  12. data/spec/data/apt/chef-integration-test-1.0/debian/source/format +1 -0
  13. data/spec/data/apt/chef-integration-test-1.1/debian/changelog +11 -0
  14. data/spec/data/apt/chef-integration-test-1.1/debian/compat +1 -0
  15. data/spec/data/apt/chef-integration-test-1.1/debian/control +13 -0
  16. data/spec/data/apt/chef-integration-test-1.1/debian/copyright +34 -0
  17. data/spec/data/apt/chef-integration-test-1.1/debian/files +1 -0
  18. data/spec/data/apt/chef-integration-test-1.1/debian/rules +13 -0
  19. data/spec/data/apt/chef-integration-test-1.1/debian/source/format +1 -0
  20. data/spec/data/apt/chef-integration-test2-1.0/debian/changelog +5 -0
  21. data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2.debhelper.log +45 -0
  22. data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2.substvars +1 -0
  23. data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2/DEBIAN/conffiles +1 -0
  24. data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2/DEBIAN/control +10 -0
  25. data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2/DEBIAN/md5sums +1 -0
  26. data/spec/data/apt/chef-integration-test2-1.0/debian/compat +1 -0
  27. data/spec/data/apt/chef-integration-test2-1.0/debian/conffiles +1 -0
  28. data/spec/data/apt/chef-integration-test2-1.0/debian/control +13 -0
  29. data/spec/data/apt/chef-integration-test2-1.0/debian/copyright +34 -0
  30. data/spec/data/apt/chef-integration-test2-1.0/debian/files +1 -0
  31. data/spec/data/apt/chef-integration-test2-1.0/debian/rules +13 -0
  32. data/spec/data/apt/chef-integration-test2-1.0/debian/source/format +1 -0
  33. data/spec/data/apt/chef-integration-test2_1.0-1.debian.tar.gz +0 -0
  34. data/spec/data/apt/chef-integration-test2_1.0-1.dsc +18 -0
  35. data/spec/data/apt/chef-integration-test2_1.0-1_amd64.build +91 -0
  36. data/spec/data/apt/chef-integration-test2_1.0-1_amd64.changes +31 -0
  37. data/spec/data/apt/chef-integration-test2_1.0-1_amd64.deb +0 -0
  38. data/spec/data/apt/chef-integration-test2_1.0.orig.tar.gz +0 -0
  39. data/spec/data/apt/chef-integration-test_1.0-1_amd64.changes +22 -0
  40. data/spec/data/apt/chef-integration-test_1.0-1_amd64.deb +0 -0
  41. data/spec/data/apt/chef-integration-test_1.0.orig.tar.gz +0 -0
  42. data/spec/data/apt/chef-integration-test_1.1-1_amd64.changes +22 -0
  43. data/spec/data/apt/chef-integration-test_1.1-1_amd64.deb +0 -0
  44. data/spec/data/apt/chef-integration-test_1.1.orig.tar.gz +0 -0
  45. data/spec/data/apt/var/www/apt/conf/distributions +7 -0
  46. data/spec/data/apt/var/www/apt/conf/incoming +4 -0
  47. data/spec/data/apt/var/www/apt/conf/pulls +3 -0
  48. data/spec/data/apt/var/www/apt/db/checksums.db +0 -0
  49. data/spec/data/apt/var/www/apt/db/contents.cache.db +0 -0
  50. data/spec/data/apt/var/www/apt/db/packages.db +0 -0
  51. data/spec/data/apt/var/www/apt/db/references.db +0 -0
  52. data/spec/data/apt/var/www/apt/db/release.caches.db +0 -0
  53. data/spec/data/apt/var/www/apt/db/version +4 -0
  54. data/spec/data/apt/var/www/apt/dists/sid/Release +19 -0
  55. data/spec/data/apt/var/www/apt/dists/sid/main/binary-amd64/Packages +16 -0
  56. data/spec/data/apt/var/www/apt/dists/sid/main/binary-amd64/Packages.gz +0 -0
  57. data/spec/data/apt/var/www/apt/dists/sid/main/binary-amd64/Release +5 -0
  58. data/spec/data/apt/var/www/apt/dists/sid/main/binary-i386/Packages +0 -0
  59. data/spec/data/apt/var/www/apt/pool/main/c/chef-integration-test/chef-integration-test_1.0-1_amd64.deb +0 -0
  60. data/spec/data/apt/var/www/apt/pool/main/c/chef-integration-test/chef-integration-test_1.1-1_amd64.deb +0 -0
  61. data/spec/data/bad-config.rb +1 -0
  62. data/spec/data/bootstrap/encrypted_data_bag_secret +1 -0
  63. data/spec/data/bootstrap/no_proxy.erb +2 -0
  64. data/spec/data/bootstrap/secret.erb +9 -0
  65. data/spec/data/bootstrap/test-hints.erb +12 -0
  66. data/spec/data/bootstrap/test.erb +1 -0
  67. data/spec/data/cb_version_cookbooks/cookbook2/files/test.txt +0 -0
  68. data/spec/data/cb_version_cookbooks/cookbook2/templates/test.erb +0 -0
  69. data/spec/data/cb_version_cookbooks/tatft/README.rdoc +3 -0
  70. data/spec/data/cb_version_cookbooks/tatft/attributes/default.rb +1 -0
  71. data/spec/data/cb_version_cookbooks/tatft/definitions/runit_service.rb +1 -0
  72. data/spec/data/cb_version_cookbooks/tatft/files/default/giant_blob.tgz +1 -0
  73. data/spec/data/cb_version_cookbooks/tatft/libraries/ownage.rb +1 -0
  74. data/spec/data/cb_version_cookbooks/tatft/providers/lwp.rb +1 -0
  75. data/spec/data/cb_version_cookbooks/tatft/recipes/default.rb +1 -0
  76. data/spec/data/cb_version_cookbooks/tatft/resources/lwr.rb +1 -0
  77. data/spec/data/cb_version_cookbooks/tatft/templates/default/configuration.erb +0 -0
  78. data/spec/data/checksum/random.txt +1 -0
  79. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-600hhz-0 +1 -0
  80. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-6m8zdk-0 +0 -0
  81. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ahd2gq-0 +1 -0
  82. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-api8ux-0 +1 -0
  83. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-b0r1m1-0 +1 -0
  84. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-bfygsi-0 +1 -0
  85. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-el14l6-0 +1 -0
  86. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ivrl3y-0 +1 -0
  87. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-kkbs85-0 +1 -0
  88. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ory1ux-0 +1 -0
  89. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-pgsq76-0 +1 -0
  90. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ra8uim-0 +1 -0
  91. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-t7k1g-0 +1 -0
  92. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-t8g0sv-0 +1 -0
  93. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ufy6g3-0 +1 -0
  94. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-x2d6j9-0 +1 -0
  95. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-xi0l6h-0 +1 -0
  96. data/spec/data/client.d_00/00-foo.rb +2 -0
  97. data/spec/data/client.d_00/01-bar.rb +1 -0
  98. data/spec/data/client.d_00/02-strings.rb +2 -0
  99. data/spec/data/client.d_00/bar +1 -0
  100. data/spec/data/client.d_01/foo/bar.rb +1 -0
  101. data/spec/data/client.d_02/foo.rb/foo.txt +1 -0
  102. data/spec/data/config.rb +6 -0
  103. data/spec/data/cookbooks/angrybash/metadata.rb +2 -0
  104. data/spec/data/cookbooks/angrybash/recipes/default.rb +8 -0
  105. data/spec/data/cookbooks/apache2/files/default/apache2_module_conf_generate.pl +2 -0
  106. data/spec/data/cookbooks/apache2/metadata.json +33 -0
  107. data/spec/data/cookbooks/apache2/metadata.rb +2 -0
  108. data/spec/data/cookbooks/apache2/recipes/default.rb +3 -0
  109. data/spec/data/cookbooks/borken/metadata.rb +2 -0
  110. data/spec/data/cookbooks/borken/recipes/default.rb +2 -0
  111. data/spec/data/cookbooks/borken/templates/default/borken.erb +2 -0
  112. data/spec/data/cookbooks/chefignore +8 -0
  113. data/spec/data/cookbooks/ignorken/files/default/not_me.rb +2 -0
  114. data/spec/data/cookbooks/ignorken/metadata.rb +2 -0
  115. data/spec/data/cookbooks/ignorken/recipes/default.rb +1 -0
  116. data/spec/data/cookbooks/ignorken/recipes/ignoreme.rb +2 -0
  117. data/spec/data/cookbooks/ignorken/templates/ubuntu-12.10/not_me.rb +2 -0
  118. data/spec/data/cookbooks/irssi/files/default/irssi.response +2 -0
  119. data/spec/data/cookbooks/java/files/default/java.response +2 -0
  120. data/spec/data/cookbooks/java/metadata.json +33 -0
  121. data/spec/data/cookbooks/java/metadata.rb +2 -0
  122. data/spec/data/cookbooks/name-mismatch-versionnumber/README.md +4 -0
  123. data/spec/data/cookbooks/name-mismatch-versionnumber/metadata.rb +8 -0
  124. data/spec/data/cookbooks/name-mismatch-versionnumber/recipes/default.rb +8 -0
  125. data/spec/data/cookbooks/openldap/.root_dotfile +0 -0
  126. data/spec/data/cookbooks/openldap/attributes/default.rb +16 -0
  127. data/spec/data/cookbooks/openldap/attributes/smokey.rb +1 -0
  128. data/spec/data/cookbooks/openldap/definitions/client.rb +5 -0
  129. data/spec/data/cookbooks/openldap/definitions/server.rb +5 -0
  130. data/spec/data/cookbooks/openldap/files/default/.dotfile +1 -0
  131. data/spec/data/cookbooks/openldap/files/default/.ssh/id_rsa +1 -0
  132. data/spec/data/cookbooks/openldap/files/default/remotedir/.a_dotdir/.a_dotfile_in_a_dotdir +1 -0
  133. data/spec/data/cookbooks/openldap/files/default/remotedir/not_a_template.erb +2 -0
  134. data/spec/data/cookbooks/openldap/files/default/remotedir/remote_dir_file1.txt +3 -0
  135. data/spec/data/cookbooks/openldap/files/default/remotedir/remote_dir_file2.txt +3 -0
  136. data/spec/data/cookbooks/openldap/files/default/remotedir/remotesubdir/.a_dotfile +1 -0
  137. data/spec/data/cookbooks/openldap/files/default/remotedir/remotesubdir/remote_subdir_file1.txt +3 -0
  138. data/spec/data/cookbooks/openldap/files/default/remotedir/remotesubdir/remote_subdir_file2.txt +3 -0
  139. data/spec/data/cookbooks/openldap/files/default/remotedir/subdir_with_no_file_just_a_subsubdir/the_subsubdir/some_file.txt +3 -0
  140. data/spec/data/cookbooks/openldap/libraries/openldap.rb +4 -0
  141. data/spec/data/cookbooks/openldap/libraries/openldap/version.rb +3 -0
  142. data/spec/data/cookbooks/openldap/metadata.rb +8 -0
  143. data/spec/data/cookbooks/openldap/recipes/default.rb +4 -0
  144. data/spec/data/cookbooks/openldap/recipes/gigantor.rb +3 -0
  145. data/spec/data/cookbooks/openldap/recipes/one.rb +15 -0
  146. data/spec/data/cookbooks/openldap/recipes/return.rb +2 -0
  147. data/spec/data/cookbooks/openldap/spec/spec_helper.rb +0 -0
  148. data/spec/data/cookbooks/openldap/templates/default/all_windows_line_endings.erb +4 -0
  149. data/spec/data/cookbooks/openldap/templates/default/helper_test.erb +1 -0
  150. data/spec/data/cookbooks/openldap/templates/default/helpers.erb +14 -0
  151. data/spec/data/cookbooks/openldap/templates/default/helpers_via_partial_test.erb +1 -0
  152. data/spec/data/cookbooks/openldap/templates/default/nested_openldap_partials.erb +1 -0
  153. data/spec/data/cookbooks/openldap/templates/default/nested_partial.erb +1 -0
  154. data/spec/data/cookbooks/openldap/templates/default/no_windows_line_endings.erb +4 -0
  155. data/spec/data/cookbooks/openldap/templates/default/openldap_nested_variable_stuff.erb +1 -0
  156. data/spec/data/cookbooks/openldap/templates/default/openldap_stuff.conf.erb +1 -0
  157. data/spec/data/cookbooks/openldap/templates/default/openldap_variable_stuff.conf.erb +1 -0
  158. data/spec/data/cookbooks/openldap/templates/default/some_windows_line_endings.erb +4 -0
  159. data/spec/data/cookbooks/openldap/templates/default/test.erb +1 -0
  160. data/spec/data/cookbooks/preseed/files/default/preseed-file.seed +1 -0
  161. data/spec/data/cookbooks/preseed/files/default/preseed-template.seed +4 -0
  162. data/spec/data/cookbooks/preseed/metadata.rb +2 -0
  163. data/spec/data/cookbooks/preseed/templates/default/preseed-template-variables.seed +1 -0
  164. data/spec/data/cookbooks/preseed/templates/default/preseed-template.seed +1 -0
  165. data/spec/data/cookbooks/starter/chefignore +8 -0
  166. data/spec/data/cookbooks/starter/files/sample.txt +1 -0
  167. data/spec/data/cookbooks/starter/metadata.rb +2 -0
  168. data/spec/data/cookbooks/starter/recipes/default.rb +4 -0
  169. data/spec/data/cookbooks/supports-platform-constraints/metadata.rb +5 -0
  170. data/spec/data/cookbooks/wget/files/default/wget.response +2 -0
  171. data/spec/data/definitions/test.rb +5 -0
  172. data/spec/data/dsc_lcm.pfx +0 -0
  173. data/spec/data/environment-config.rb +5 -0
  174. data/spec/data/file-providers-method-snapshot-chef-11-4.json +127 -0
  175. data/spec/data/fileedit/blank +0 -0
  176. data/spec/data/fileedit/hosts +4 -0
  177. data/spec/data/gems/chef-integration-test-0.1.0.gem +0 -0
  178. data/spec/data/git_bundles/example-repo.gitbundle +0 -0
  179. data/spec/data/git_bundles/sinatra-test-app-with-callback-files.gitbundle +0 -0
  180. data/spec/data/git_bundles/sinatra-test-app-with-symlinks.gitbundle +0 -0
  181. data/spec/data/git_bundles/sinatra-test-app.gitbundle +0 -0
  182. data/spec/data/incomplete-metadata-chef-repo/incomplete-metadata/README.md +4 -0
  183. data/spec/data/incomplete-metadata-chef-repo/incomplete-metadata/metadata.rb +13 -0
  184. data/spec/data/incomplete-metadata-chef-repo/incomplete-metadata/recipes/default.rb +8 -0
  185. data/spec/data/invalid-metadata-chef-repo/invalid-metadata/README.md +4 -0
  186. data/spec/data/invalid-metadata-chef-repo/invalid-metadata/metadata.rb +9 -0
  187. data/spec/data/invalid-metadata-chef-repo/invalid-metadata/recipes/default.rb +8 -0
  188. data/spec/data/kitchen/chefignore +6 -0
  189. data/spec/data/kitchen/openldap/attributes/default.rb +3 -0
  190. data/spec/data/kitchen/openldap/attributes/robinson.rb +3 -0
  191. data/spec/data/kitchen/openldap/definitions/client.rb +3 -0
  192. data/spec/data/kitchen/openldap/definitions/drewbarrymore.rb +3 -0
  193. data/spec/data/kitchen/openldap/recipes/gigantor.rb +3 -0
  194. data/spec/data/kitchen/openldap/recipes/ignoreme.rb +3 -0
  195. data/spec/data/kitchen/openldap/recipes/woot.rb +3 -0
  196. data/spec/data/knife-home/.chef/plugins/knife/example_home_subcommand.rb +0 -0
  197. data/spec/data/knife-site-subcommands/plugins/knife/example_subcommand.rb +0 -0
  198. data/spec/data/knife_subcommand/test_explicit_category.rb +7 -0
  199. data/spec/data/knife_subcommand/test_name_mapping.rb +4 -0
  200. data/spec/data/knife_subcommand/test_yourself.rb +21 -0
  201. data/spec/data/lwrp/providers/buck_passer.rb +28 -0
  202. data/spec/data/lwrp/providers/buck_passer_2.rb +26 -0
  203. data/spec/data/lwrp/providers/embedded_resource_accesses_providers_scope.rb +28 -0
  204. data/spec/data/lwrp/providers/inline_compiler.rb +24 -0
  205. data/spec/data/lwrp/providers/monkey_name_printer.rb +5 -0
  206. data/spec/data/lwrp/providers/paint_drying_watcher.rb +7 -0
  207. data/spec/data/lwrp/providers/thumb_twiddler.rb +7 -0
  208. data/spec/data/lwrp/resources/bar.rb +4 -0
  209. data/spec/data/lwrp/resources/buck_passer.rb +6 -0
  210. data/spec/data/lwrp/resources/buck_passer_2.rb +4 -0
  211. data/spec/data/lwrp/resources/embedded_resource_accesses_providers_scope.rb +4 -0
  212. data/spec/data/lwrp/resources/foo.rb +6 -0
  213. data/spec/data/lwrp/resources/inline_compiler.rb +4 -0
  214. data/spec/data/lwrp/resources/monkey_name_printer.rb +6 -0
  215. data/spec/data/lwrp/resources/paint_drying_watcher.rb +4 -0
  216. data/spec/data/lwrp/resources/thumb_twiddler.rb +4 -0
  217. data/spec/data/lwrp/resources_with_default_attributes/nodeattr.rb +3 -0
  218. data/spec/data/lwrp_const_scoping/resources/conflict.rb +1 -0
  219. data/spec/data/lwrp_override/providers/buck_passer.rb +5 -0
  220. data/spec/data/lwrp_override/resources/foo.rb +11 -0
  221. data/spec/data/mac_users/10.9.plist.xml +560 -0
  222. data/spec/data/mac_users/10.9.shadow.xml +21 -0
  223. data/spec/data/metadata/quick_start/metadata.rb +14 -0
  224. data/spec/data/mixin/invalid_data.rb +3 -0
  225. data/spec/data/mixin/real_data.rb +2 -0
  226. data/spec/data/nested.json +2 -0
  227. data/spec/data/nodes/default.rb +15 -0
  228. data/spec/data/nodes/test.example.com.rb +17 -0
  229. data/spec/data/nodes/test.rb +15 -0
  230. data/spec/data/null_config.rb +1 -0
  231. data/spec/data/object_loader/environments/test.json +7 -0
  232. data/spec/data/object_loader/environments/test.rb +2 -0
  233. data/spec/data/object_loader/environments/test_json_class.json +8 -0
  234. data/spec/data/object_loader/nodes/test.json +7 -0
  235. data/spec/data/object_loader/nodes/test.rb +2 -0
  236. data/spec/data/object_loader/nodes/test_json_class.json +8 -0
  237. data/spec/data/object_loader/roles/test.json +7 -0
  238. data/spec/data/object_loader/roles/test.rb +2 -0
  239. data/spec/data/object_loader/roles/test_json_class.json +8 -0
  240. data/spec/data/old_home_dir/my-dot-emacs +0 -0
  241. data/spec/data/old_home_dir/my-dot-vim +0 -0
  242. data/spec/data/partial_one.erb +1 -0
  243. data/spec/data/prefer_metadata_json/metadata.json +51 -0
  244. data/spec/data/prefer_metadata_json/metadata.rb +6 -0
  245. data/spec/data/prefer_metadata_json/recipes/default.rb +0 -0
  246. data/spec/data/recipes.tgz +0 -0
  247. data/spec/data/recipes/test.rb +7 -0
  248. data/spec/data/remote_directory_data/remote_dir_file.txt +1 -0
  249. data/spec/data/remote_directory_data/remote_subdirectory/remote_subdir_file.txt +1 -0
  250. data/spec/data/remote_file/nyan_cat.png +0 -0
  251. data/spec/data/remote_file/nyan_cat.png.gz +0 -0
  252. data/spec/data/root_alias_cookbooks/dup_attr/attributes.rb +1 -0
  253. data/spec/data/root_alias_cookbooks/dup_attr/attributes/default.rb +1 -0
  254. data/spec/data/root_alias_cookbooks/dup_attr/metadata.rb +2 -0
  255. data/spec/data/root_alias_cookbooks/dup_attr/recipe.rb +3 -0
  256. data/spec/data/root_alias_cookbooks/dup_recipe/attributes.rb +1 -0
  257. data/spec/data/root_alias_cookbooks/dup_recipe/metadata.rb +2 -0
  258. data/spec/data/root_alias_cookbooks/dup_recipe/recipe.rb +3 -0
  259. data/spec/data/root_alias_cookbooks/dup_recipe/recipes/default.rb +3 -0
  260. data/spec/data/root_alias_cookbooks/simple/attributes.rb +1 -0
  261. data/spec/data/root_alias_cookbooks/simple/metadata.rb +2 -0
  262. data/spec/data/root_alias_cookbooks/simple/recipe.rb +3 -0
  263. data/spec/data/rubygems.org/latest_specs.4.8.gz +0 -0
  264. data/spec/data/rubygems.org/nonexistent_gem +0 -0
  265. data/spec/data/rubygems.org/nonexistent_gem-info +1 -0
  266. data/spec/data/rubygems.org/sexp_processor +0 -0
  267. data/spec/data/rubygems.org/sexp_processor-4.15.1.gemspec.rz +0 -0
  268. data/spec/data/rubygems.org/sexp_processor-info +49 -0
  269. data/spec/data/run_context/cookbooks/circular-dep1/attributes/default.rb +2 -0
  270. data/spec/data/run_context/cookbooks/circular-dep1/definitions/circular_dep1_res.rb +1 -0
  271. data/spec/data/run_context/cookbooks/circular-dep1/libraries/lib.rb +2 -0
  272. data/spec/data/run_context/cookbooks/circular-dep1/metadata.rb +2 -0
  273. data/spec/data/run_context/cookbooks/circular-dep1/providers/provider.rb +1 -0
  274. data/spec/data/run_context/cookbooks/circular-dep1/recipes/default.rb +0 -0
  275. data/spec/data/run_context/cookbooks/circular-dep1/resources/resource.rb +2 -0
  276. data/spec/data/run_context/cookbooks/circular-dep2/attributes/default.rb +2 -0
  277. data/spec/data/run_context/cookbooks/circular-dep2/definitions/circular_dep2_res.rb +1 -0
  278. data/spec/data/run_context/cookbooks/circular-dep2/libraries/lib.rb +2 -0
  279. data/spec/data/run_context/cookbooks/circular-dep2/metadata.rb +2 -0
  280. data/spec/data/run_context/cookbooks/circular-dep2/providers/provider.rb +1 -0
  281. data/spec/data/run_context/cookbooks/circular-dep2/recipes/default.rb +0 -0
  282. data/spec/data/run_context/cookbooks/circular-dep2/resources/resource.rb +2 -0
  283. data/spec/data/run_context/cookbooks/dependency1/attributes/aa_first.rb +2 -0
  284. data/spec/data/run_context/cookbooks/dependency1/attributes/default.rb +2 -0
  285. data/spec/data/run_context/cookbooks/dependency1/attributes/unparsed_file +1 -0
  286. data/spec/data/run_context/cookbooks/dependency1/attributes/zz_last.rb +2 -0
  287. data/spec/data/run_context/cookbooks/dependency1/definitions/dependency1_res.rb +1 -0
  288. data/spec/data/run_context/cookbooks/dependency1/definitions/unparsed_file +1 -0
  289. data/spec/data/run_context/cookbooks/dependency1/libraries/lib.rb +2 -0
  290. data/spec/data/run_context/cookbooks/dependency1/libraries/unparsed_file +1 -0
  291. data/spec/data/run_context/cookbooks/dependency1/providers/provider.rb +1 -0
  292. data/spec/data/run_context/cookbooks/dependency1/providers/unparsed_file +1 -0
  293. data/spec/data/run_context/cookbooks/dependency1/recipes/default.rb +0 -0
  294. data/spec/data/run_context/cookbooks/dependency1/recipes/unparsed_file +1 -0
  295. data/spec/data/run_context/cookbooks/dependency1/resources/resource.rb +2 -0
  296. data/spec/data/run_context/cookbooks/dependency1/resources/unparsed_file +1 -0
  297. data/spec/data/run_context/cookbooks/dependency2/attributes/default.rb +2 -0
  298. data/spec/data/run_context/cookbooks/dependency2/definitions/dependency2_res.rb +1 -0
  299. data/spec/data/run_context/cookbooks/dependency2/libraries/lib.rb +2 -0
  300. data/spec/data/run_context/cookbooks/dependency2/providers/provider.rb +1 -0
  301. data/spec/data/run_context/cookbooks/dependency2/recipes/default.rb +0 -0
  302. data/spec/data/run_context/cookbooks/dependency2/resources/resource.rb +2 -0
  303. data/spec/data/run_context/cookbooks/include/recipes/default.rb +24 -0
  304. data/spec/data/run_context/cookbooks/include/recipes/includee.rb +3 -0
  305. data/spec/data/run_context/cookbooks/no-default-attr/attributes/server.rb +2 -0
  306. data/spec/data/run_context/cookbooks/no-default-attr/definitions/no_default-attr_res.rb +1 -0
  307. data/spec/data/run_context/cookbooks/no-default-attr/providers/provider.rb +1 -0
  308. data/spec/data/run_context/cookbooks/no-default-attr/recipes/default.rb +0 -0
  309. data/spec/data/run_context/cookbooks/no-default-attr/resources/resource.rb +2 -0
  310. data/spec/data/run_context/cookbooks/test-with-circular-deps/attributes/default.rb +2 -0
  311. data/spec/data/run_context/cookbooks/test-with-circular-deps/definitions/test_with-circular-deps_res.rb +1 -0
  312. data/spec/data/run_context/cookbooks/test-with-circular-deps/libraries/lib.rb +2 -0
  313. data/spec/data/run_context/cookbooks/test-with-circular-deps/metadata.rb +2 -0
  314. data/spec/data/run_context/cookbooks/test-with-circular-deps/providers/provider.rb +1 -0
  315. data/spec/data/run_context/cookbooks/test-with-circular-deps/recipes/default.rb +0 -0
  316. data/spec/data/run_context/cookbooks/test-with-circular-deps/resources/resource.rb +3 -0
  317. data/spec/data/run_context/cookbooks/test-with-deps/attributes/default.rb +2 -0
  318. data/spec/data/run_context/cookbooks/test-with-deps/definitions/test_with-deps_res.rb +1 -0
  319. data/spec/data/run_context/cookbooks/test-with-deps/libraries/lib.rb +1 -0
  320. data/spec/data/run_context/cookbooks/test-with-deps/metadata.rb +3 -0
  321. data/spec/data/run_context/cookbooks/test-with-deps/providers/provider.rb +1 -0
  322. data/spec/data/run_context/cookbooks/test-with-deps/recipes/default.rb +0 -0
  323. data/spec/data/run_context/cookbooks/test-with-deps/recipes/server.rb +0 -0
  324. data/spec/data/run_context/cookbooks/test-with-deps/resources/resource.rb +2 -0
  325. data/spec/data/run_context/cookbooks/test/attributes/default.rb +0 -0
  326. data/spec/data/run_context/cookbooks/test/attributes/george.rb +1 -0
  327. data/spec/data/run_context/cookbooks/test/definitions/new_animals.rb +9 -0
  328. data/spec/data/run_context/cookbooks/test/definitions/new_cat.rb +5 -0
  329. data/spec/data/run_context/cookbooks/test/definitions/test_res.rb +1 -0
  330. data/spec/data/run_context/cookbooks/test/providers/provider.rb +1 -0
  331. data/spec/data/run_context/cookbooks/test/recipes/default.rb +5 -0
  332. data/spec/data/run_context/cookbooks/test/recipes/one.rb +7 -0
  333. data/spec/data/run_context/cookbooks/test/recipes/two.rb +7 -0
  334. data/spec/data/run_context/cookbooks/test/resources/resource.rb +3 -0
  335. data/spec/data/run_context/nodes/run_context.rb +5 -0
  336. data/spec/data/sample_msu1.xml +10 -0
  337. data/spec/data/sample_msu2.xml +14 -0
  338. data/spec/data/sample_msu3.xml +16 -0
  339. data/spec/data/search_queries_to_transform.txt +98 -0
  340. data/spec/data/shef-config.rb +11 -0
  341. data/spec/data/snap_package/async_result_success.json +6 -0
  342. data/spec/data/snap_package/change_id_result.json +175 -0
  343. data/spec/data/snap_package/find_result_failure.json +10 -0
  344. data/spec/data/snap_package/find_result_success.json +70 -0
  345. data/spec/data/snap_package/get_by_name_result_failure.json +10 -0
  346. data/spec/data/snap_package/get_by_name_result_success.json +38 -0
  347. data/spec/data/snap_package/get_conf_success.json +10 -0
  348. data/spec/data/snap_package/result_failure.json +9 -0
  349. data/spec/data/ssl/5e707473.0 +18 -0
  350. data/spec/data/ssl/binary/chef-rspec-der.cert +0 -0
  351. data/spec/data/ssl/binary/chef-rspec-der.key +0 -0
  352. data/spec/data/ssl/chef-rspec.cert +27 -0
  353. data/spec/data/ssl/chef-rspec.key +27 -0
  354. data/spec/data/ssl/key.pem +15 -0
  355. data/spec/data/ssl/private_key.pem +27 -0
  356. data/spec/data/ssl/private_key_with_whitespace.pem +32 -0
  357. data/spec/data/standalone_cookbook/Gemfile +1 -0
  358. data/spec/data/standalone_cookbook/chefignore +9 -0
  359. data/spec/data/standalone_cookbook/recipes/default.rb +3 -0
  360. data/spec/data/standalone_cookbook/vendor/bundle/ruby/2.0.0/gems/multi_json-1.9.0/lib/multi_json.rb +1 -0
  361. data/spec/data/templates/chef-seattle20160930-4388-1crv7ef.txt +1 -0
  362. data/spec/data/templates/chef-seattle20160930-4388-jjfoae.txt +1 -0
  363. data/spec/data/templates/chef-seattle20160930-4388-umeq2c.txt +1 -0
  364. data/spec/data/templates/failed.erb +5 -0
  365. data/spec/data/templates/seattle.txt +1 -0
  366. data/spec/data/trusted_certs/example.crt +22 -0
  367. data/spec/data/trusted_certs/example_no_cn.crt +36 -0
  368. data/spec/data/trusted_certs/intermediate.pem +27 -0
  369. data/spec/data/trusted_certs/opscode.pem +57 -0
  370. data/spec/data/trusted_certs/root.pem +22 -0
  371. data/spec/data/windows_certificates/base64_test.cer +20 -0
  372. data/spec/data/windows_certificates/othertest.cer +20 -0
  373. data/spec/data/windows_certificates/test.cer +20 -0
  374. data/spec/data/windows_certificates/test.p7b +0 -0
  375. data/spec/data/windows_certificates/test.pem +20 -0
  376. data/spec/data/windows_certificates/test.pfx +0 -0
  377. data/spec/functional/configure_spec.rb +33 -0
  378. data/spec/functional/cookbook_delete_spec.rb +156 -0
  379. data/spec/functional/exec_spec.rb +55 -0
  380. data/spec/functional/rehash_spec.rb +39 -0
  381. data/spec/functional/smoke_test.rb +42 -0
  382. data/spec/functional/ssh_spec.rb +352 -0
  383. data/spec/functional/version_spec.rb +26 -0
  384. data/spec/integration/chef_fs_data_store_spec.rb +557 -0
  385. data/spec/integration/chef_repo_path_spec.rb +962 -0
  386. data/spec/integration/chef_repository_file_system_spec.rb +200 -0
  387. data/spec/integration/chefignore_spec.rb +301 -0
  388. data/spec/integration/client_bulk_delete_spec.rb +131 -0
  389. data/spec/integration/client_create_spec.rb +70 -0
  390. data/spec/integration/client_delete_spec.rb +64 -0
  391. data/spec/integration/client_key_create_spec.rb +66 -0
  392. data/spec/integration/client_key_delete_spec.rb +43 -0
  393. data/spec/integration/client_key_list_spec.rb +61 -0
  394. data/spec/integration/client_key_show_spec.rb +45 -0
  395. data/spec/integration/client_list_spec.rb +49 -0
  396. data/spec/integration/client_show_spec.rb +37 -0
  397. data/spec/integration/common_options_spec.rb +174 -0
  398. data/spec/integration/config_list_spec.rb +220 -0
  399. data/spec/integration/config_show_spec.rb +192 -0
  400. data/spec/integration/config_use_spec.rb +198 -0
  401. data/spec/integration/cookbook_api_ipv6_spec.rb +113 -0
  402. data/spec/integration/cookbook_bulk_delete_spec.rb +65 -0
  403. data/spec/integration/cookbook_download_spec.rb +72 -0
  404. data/spec/integration/cookbook_list_spec.rb +55 -0
  405. data/spec/integration/cookbook_show_spec.rb +149 -0
  406. data/spec/integration/cookbook_upload_spec.rb +128 -0
  407. data/spec/integration/data_bag_create_spec.rb +125 -0
  408. data/spec/integration/data_bag_delete_spec.rb +59 -0
  409. data/spec/integration/data_bag_edit_spec.rb +105 -0
  410. data/spec/integration/data_bag_from_file_spec.rb +116 -0
  411. data/spec/integration/data_bag_list_spec.rb +44 -0
  412. data/spec/integration/data_bag_show_spec.rb +95 -0
  413. data/spec/integration/delete_spec.rb +1018 -0
  414. data/spec/integration/deps_spec.rb +703 -0
  415. data/spec/integration/diff_spec.rb +605 -0
  416. data/spec/integration/download_spec.rb +1336 -0
  417. data/spec/integration/environment_compare_spec.rb +75 -0
  418. data/spec/integration/environment_create_spec.rb +41 -0
  419. data/spec/integration/environment_delete_spec.rb +37 -0
  420. data/spec/integration/environment_from_file_spec.rb +116 -0
  421. data/spec/integration/environment_list_spec.rb +42 -0
  422. data/spec/integration/environment_show_spec.rb +77 -0
  423. data/spec/integration/list_spec.rb +1060 -0
  424. data/spec/integration/node_bulk_delete_spec.rb +52 -0
  425. data/spec/integration/node_create_spec.rb +47 -0
  426. data/spec/integration/node_delete_spec.rb +48 -0
  427. data/spec/integration/node_environment_set_spec.rb +46 -0
  428. data/spec/integration/node_from_file_spec.rb +59 -0
  429. data/spec/integration/node_list_spec.rb +45 -0
  430. data/spec/integration/node_run_list_add_spec.rb +54 -0
  431. data/spec/integration/node_run_list_remove_spec.rb +36 -0
  432. data/spec/integration/node_run_list_set_spec.rb +41 -0
  433. data/spec/integration/node_show_spec.rb +36 -0
  434. data/spec/integration/raw_spec.rb +297 -0
  435. data/spec/integration/redirection_spec.rb +64 -0
  436. data/spec/integration/role_bulk_delete_spec.rb +52 -0
  437. data/spec/integration/role_create_spec.rb +41 -0
  438. data/spec/integration/role_delete_spec.rb +48 -0
  439. data/spec/integration/role_from_file_spec.rb +96 -0
  440. data/spec/integration/role_list_spec.rb +45 -0
  441. data/spec/integration/role_show_spec.rb +51 -0
  442. data/spec/integration/search_node_spec.rb +40 -0
  443. data/spec/integration/serve_spec.rb +92 -0
  444. data/spec/integration/show_spec.rb +197 -0
  445. data/spec/integration/upload_spec.rb +1617 -0
  446. data/spec/knife_spec_helper.rb +241 -0
  447. data/spec/support/chef_helpers.rb +79 -0
  448. data/spec/support/key_helpers.rb +102 -0
  449. data/spec/support/platform_helpers.rb +251 -0
  450. data/spec/support/platforms/prof/gc.rb +51 -0
  451. data/spec/support/platforms/prof/win32.rb +45 -0
  452. data/spec/support/platforms/win32/spec_service.rb +57 -0
  453. data/spec/support/recipe_dsl_helper.rb +83 -0
  454. data/spec/support/shared/context/config.rb +18 -0
  455. data/spec/support/shared/functional/knife.rb +37 -0
  456. data/spec/support/shared/integration/integration_helper.rb +122 -0
  457. data/spec/support/shared/integration/knife_support.rb +192 -0
  458. data/spec/support/shared/matchers/exit_with_code.rb +32 -0
  459. data/spec/support/shared/matchers/match_environment_variable.rb +17 -0
  460. data/spec/support/shared/unit/knife_shared.rb +39 -0
  461. data/spec/support/shared/unit/mock_shellout.rb +49 -0
  462. data/spec/tiny_server.rb +190 -0
  463. data/spec/unit/application/knife_spec.rb +241 -0
  464. data/spec/unit/knife/bootstrap/chef_vault_handler_spec.rb +152 -0
  465. data/spec/unit/knife/bootstrap/client_builder_spec.rb +207 -0
  466. data/spec/unit/knife/bootstrap/train_connector_spec.rb +244 -0
  467. data/spec/unit/knife/bootstrap_spec.rb +2220 -0
  468. data/spec/unit/knife/client_bulk_delete_spec.rb +166 -0
  469. data/spec/unit/knife/client_create_spec.rb +169 -0
  470. data/spec/unit/knife/client_delete_spec.rb +99 -0
  471. data/spec/unit/knife/client_edit_spec.rb +53 -0
  472. data/spec/unit/knife/client_list_spec.rb +34 -0
  473. data/spec/unit/knife/client_reregister_spec.rb +62 -0
  474. data/spec/unit/knife/client_show_spec.rb +52 -0
  475. data/spec/unit/knife/configure_client_spec.rb +81 -0
  476. data/spec/unit/knife/configure_spec.rb +190 -0
  477. data/spec/unit/knife/cookbook_bulk_delete_spec.rb +87 -0
  478. data/spec/unit/knife/cookbook_delete_spec.rb +239 -0
  479. data/spec/unit/knife/cookbook_download_spec.rb +255 -0
  480. data/spec/unit/knife/cookbook_list_spec.rb +88 -0
  481. data/spec/unit/knife/cookbook_metadata_from_file_spec.rb +72 -0
  482. data/spec/unit/knife/cookbook_metadata_spec.rb +182 -0
  483. data/spec/unit/knife/cookbook_show_spec.rb +253 -0
  484. data/spec/unit/knife/cookbook_upload_spec.rb +364 -0
  485. data/spec/unit/knife/core/bootstrap_context_spec.rb +287 -0
  486. data/spec/unit/knife/core/cookbook_scm_repo_spec.rb +187 -0
  487. data/spec/unit/knife/core/cookbook_site_streaming_uploader_spec.rb +198 -0
  488. data/spec/unit/knife/core/gem_glob_loader_spec.rb +242 -0
  489. data/spec/unit/knife/core/hashed_command_loader_spec.rb +112 -0
  490. data/spec/unit/knife/core/node_editor_spec.rb +211 -0
  491. data/spec/unit/knife/core/object_loader_spec.rb +81 -0
  492. data/spec/unit/knife/core/status_presenter_spec.rb +54 -0
  493. data/spec/unit/knife/core/subcommand_loader_spec.rb +64 -0
  494. data/spec/unit/knife/core/ui_spec.rb +656 -0
  495. data/spec/unit/knife/core/windows_bootstrap_context_spec.rb +238 -0
  496. data/spec/unit/knife/data_bag_create_spec.rb +175 -0
  497. data/spec/unit/knife/data_bag_edit_spec.rb +126 -0
  498. data/spec/unit/knife/data_bag_from_file_spec.rb +174 -0
  499. data/spec/unit/knife/data_bag_secret_options_spec.rb +173 -0
  500. data/spec/unit/knife/data_bag_show_spec.rb +139 -0
  501. data/spec/unit/knife/environment_compare_spec.rb +112 -0
  502. data/spec/unit/knife/environment_create_spec.rb +91 -0
  503. data/spec/unit/knife/environment_delete_spec.rb +71 -0
  504. data/spec/unit/knife/environment_edit_spec.rb +79 -0
  505. data/spec/unit/knife/environment_from_file_spec.rb +90 -0
  506. data/spec/unit/knife/environment_list_spec.rb +54 -0
  507. data/spec/unit/knife/environment_show_spec.rb +52 -0
  508. data/spec/unit/knife/key_create_spec.rb +223 -0
  509. data/spec/unit/knife/key_delete_spec.rb +133 -0
  510. data/spec/unit/knife/key_edit_spec.rb +264 -0
  511. data/spec/unit/knife/key_helper.rb +74 -0
  512. data/spec/unit/knife/key_list_spec.rb +216 -0
  513. data/spec/unit/knife/key_show_spec.rb +126 -0
  514. data/spec/unit/knife/node_bulk_delete_spec.rb +94 -0
  515. data/spec/unit/knife/node_delete_spec.rb +77 -0
  516. data/spec/unit/knife/node_edit_spec.rb +116 -0
  517. data/spec/unit/knife/node_environment_set_spec.rb +61 -0
  518. data/spec/unit/knife/node_from_file_spec.rb +59 -0
  519. data/spec/unit/knife/node_list_spec.rb +62 -0
  520. data/spec/unit/knife/node_policy_set_spec.rb +122 -0
  521. data/spec/unit/knife/node_run_list_add_spec.rb +145 -0
  522. data/spec/unit/knife/node_run_list_remove_spec.rb +106 -0
  523. data/spec/unit/knife/node_run_list_set_spec.rb +115 -0
  524. data/spec/unit/knife/node_show_spec.rb +65 -0
  525. data/spec/unit/knife/org_create_spec.rb +76 -0
  526. data/spec/unit/knife/org_delete_spec.rb +41 -0
  527. data/spec/unit/knife/org_edit_spec.rb +49 -0
  528. data/spec/unit/knife/org_list_spec.rb +58 -0
  529. data/spec/unit/knife/org_show_spec.rb +45 -0
  530. data/spec/unit/knife/org_user_add_spec.rb +39 -0
  531. data/spec/unit/knife/raw_spec.rb +43 -0
  532. data/spec/unit/knife/role_bulk_delete_spec.rb +80 -0
  533. data/spec/unit/knife/role_create_spec.rb +80 -0
  534. data/spec/unit/knife/role_delete_spec.rb +67 -0
  535. data/spec/unit/knife/role_edit_spec.rb +77 -0
  536. data/spec/unit/knife/role_env_run_list_add_spec.rb +217 -0
  537. data/spec/unit/knife/role_env_run_list_clear_spec.rb +94 -0
  538. data/spec/unit/knife/role_env_run_list_remove_spec.rb +102 -0
  539. data/spec/unit/knife/role_env_run_list_replace_spec.rb +105 -0
  540. data/spec/unit/knife/role_env_run_list_set_spec.rb +99 -0
  541. data/spec/unit/knife/role_from_file_spec.rb +69 -0
  542. data/spec/unit/knife/role_list_spec.rb +54 -0
  543. data/spec/unit/knife/role_run_list_add_spec.rb +179 -0
  544. data/spec/unit/knife/role_run_list_clear_spec.rb +84 -0
  545. data/spec/unit/knife/role_run_list_remove_spec.rb +92 -0
  546. data/spec/unit/knife/role_run_list_replace_spec.rb +98 -0
  547. data/spec/unit/knife/role_run_list_set_spec.rb +89 -0
  548. data/spec/unit/knife/role_show_spec.rb +59 -0
  549. data/spec/unit/knife/ssh_spec.rb +403 -0
  550. data/spec/unit/knife/ssl_check_spec.rb +256 -0
  551. data/spec/unit/knife/ssl_fetch_spec.rb +222 -0
  552. data/spec/unit/knife/status_spec.rb +112 -0
  553. data/spec/unit/knife/supermarket_download_spec.rb +152 -0
  554. data/spec/unit/knife/supermarket_install_spec.rb +203 -0
  555. data/spec/unit/knife/supermarket_list_spec.rb +70 -0
  556. data/spec/unit/knife/supermarket_search_spec.rb +85 -0
  557. data/spec/unit/knife/supermarket_share_spec.rb +208 -0
  558. data/spec/unit/knife/supermarket_unshare_spec.rb +78 -0
  559. data/spec/unit/knife/tag_create_spec.rb +23 -0
  560. data/spec/unit/knife/tag_delete_spec.rb +25 -0
  561. data/spec/unit/knife/tag_list_spec.rb +23 -0
  562. data/spec/unit/knife/user_create_spec.rb +256 -0
  563. data/spec/unit/knife/user_delete_spec.rb +171 -0
  564. data/spec/unit/knife/user_edit_spec.rb +54 -0
  565. data/spec/unit/knife/user_list_spec.rb +73 -0
  566. data/spec/unit/knife/user_password_spec.rb +64 -0
  567. data/spec/unit/knife/user_reregister_spec.rb +56 -0
  568. data/spec/unit/knife/user_show_spec.rb +91 -0
  569. data/spec/unit/knife_spec.rb +634 -0
  570. metadata +566 -2
@@ -0,0 +1,131 @@
1
+ #
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require "knife_spec_helper"
18
+ require "support/shared/integration/integration_helper"
19
+ require "support/shared/context/config"
20
+
21
+ describe "knife client bulk delete", :workstation do
22
+ include IntegrationSupport
23
+ include KnifeSupport
24
+
25
+ include_context "default config options"
26
+
27
+ when_the_chef_server "has some clients" do
28
+ before do
29
+ client "concat", {}
30
+ client "cons", {}
31
+ client "car", {}
32
+ client "cdr", {}
33
+ client "cat", {}
34
+ end
35
+
36
+ it "deletes all matching clients" do
37
+ knife("client bulk delete ^ca.*", input: "Y").should_succeed <<~EOM
38
+ The following clients will be deleted:
39
+
40
+ car cat
41
+
42
+ Are you sure you want to delete these clients? (Y/N) Deleted client car
43
+ Deleted client cat
44
+ EOM
45
+
46
+ knife("client list").should_succeed <<~EOM
47
+ cdr
48
+ chef-validator
49
+ chef-webui
50
+ concat
51
+ cons
52
+ EOM
53
+ end
54
+
55
+ it "deletes all matching clients when unanchored" do
56
+ knife("client bulk delete ca.*", input: "Y").should_succeed <<~EOM
57
+ The following clients will be deleted:
58
+
59
+ car cat concat
60
+
61
+ Are you sure you want to delete these clients? (Y/N) Deleted client car
62
+ Deleted client cat
63
+ Deleted client concat
64
+ EOM
65
+
66
+ knife("client list").should_succeed <<~EOM
67
+ cdr
68
+ chef-validator
69
+ chef-webui
70
+ cons
71
+ EOM
72
+ end
73
+ end
74
+
75
+ when_the_chef_server "has a validator client" do
76
+ before do
77
+ client "cons", {}
78
+ client "car", {}
79
+ client "car-validator", { validator: true }
80
+ client "cdr", {}
81
+ client "cat", {}
82
+ end
83
+
84
+ it "refuses to delete a validator normally" do
85
+ knife("client bulk delete ^ca.*", input: "Y").should_succeed <<~EOM
86
+ The following clients are validators and will not be deleted:
87
+
88
+ car-validator
89
+
90
+ You must specify --delete-validators to delete the validator clients
91
+ The following clients will be deleted:
92
+
93
+ car cat
94
+
95
+ Are you sure you want to delete these clients? (Y/N) Deleted client car
96
+ Deleted client cat
97
+ EOM
98
+
99
+ knife("client list").should_succeed <<~EOM
100
+ car-validator
101
+ cdr
102
+ chef-validator
103
+ chef-webui
104
+ cons
105
+ EOM
106
+ end
107
+
108
+ it "deletes a validator when told to" do
109
+ knife("client bulk delete ^ca.* -D", input: "Y\nY").should_succeed <<~EOM
110
+ The following validators will be deleted:
111
+
112
+ car-validator
113
+
114
+ Are you sure you want to delete these validators? (Y/N) Deleted client car-validator
115
+ The following clients will be deleted:
116
+
117
+ car cat
118
+
119
+ Are you sure you want to delete these clients? (Y/N) Deleted client car
120
+ Deleted client cat
121
+ EOM
122
+
123
+ knife("client list").should_succeed <<~EOM
124
+ cdr
125
+ chef-validator
126
+ chef-webui
127
+ cons
128
+ EOM
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,70 @@
1
+ #
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require "knife_spec_helper"
18
+ require "support/shared/integration/integration_helper"
19
+ require "support/shared/context/config"
20
+ require "openssl"
21
+
22
+ describe "knife client create", :workstation do
23
+ include IntegrationSupport
24
+ include KnifeSupport
25
+
26
+ include_context "default config options"
27
+
28
+ let(:out) { "Created client[bah]\n" }
29
+
30
+ when_the_chef_server "is empty" do
31
+ it "creates a new client" do
32
+ knife("client create -k bah").should_succeed stderr: out
33
+ end
34
+
35
+ it "creates a new validator client" do
36
+ knife("client create -k --validator bah").should_succeed stderr: out
37
+ knife("client show bah").should_succeed <<~EOM
38
+ admin: false
39
+ chef_type: client
40
+ name: bah
41
+ validator: true
42
+ EOM
43
+ end
44
+
45
+ it "refuses to add an existing client" do
46
+ pending "Knife client create must not blindly overwrite an existing client"
47
+ knife("client create -k bah").should_succeed stderr: out
48
+ expect { knife("client create -k bah") }.to raise_error(Net::HTTPClientException)
49
+ end
50
+
51
+ it "saves the private key to a file" do
52
+ Dir.mktmpdir do |tgt|
53
+ knife("client create -f #{tgt}/bah.pem bah").should_succeed stderr: out
54
+ expect(File).to exist("#{tgt}/bah.pem")
55
+ end
56
+ end
57
+
58
+ it "reads the public key from a file" do
59
+ Dir.mktmpdir do |tgt|
60
+ key = OpenSSL::PKey::RSA.generate(1024)
61
+ File.open("#{tgt}/public.pem", "w") { |pub| pub.write(key.public_key.to_pem) }
62
+ knife("client create -p #{tgt}/public.pem bah").should_succeed stderr: out
63
+ end
64
+ end
65
+
66
+ it "refuses to run if conflicting options are passed" do
67
+ knife("client create -p public.pem --prevent-keygen blah").should_fail stderr: "FATAL: You cannot pass --public-key and --prevent-keygen\n", stdout: /^USAGE.*/
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,64 @@
1
+ #
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require "knife_spec_helper"
18
+ require "support/shared/integration/integration_helper"
19
+ require "support/shared/context/config"
20
+
21
+ describe "knife client delete", :workstation do
22
+ include IntegrationSupport
23
+ include KnifeSupport
24
+
25
+ include_context "default config options"
26
+
27
+ when_the_chef_server "has some clients" do
28
+ before do
29
+ client "cons", {}
30
+ client "car", {}
31
+ client "car-validator", { validator: true }
32
+ client "cdr", {}
33
+ client "cat", {}
34
+ end
35
+
36
+ it "deletes a client" do
37
+ knife("client delete car", input: "Y").should_succeed <<~EOM
38
+ Do you really want to delete car? (Y/N) Deleted client[car]
39
+ EOM
40
+
41
+ knife("client list").should_succeed <<~EOM
42
+ car-validator
43
+ cat
44
+ cdr
45
+ chef-validator
46
+ chef-webui
47
+ cons
48
+ EOM
49
+ end
50
+
51
+ it "refuses to delete a validator normally" do
52
+ knife("client delete car-validator", input: "Y").should_fail exit_code: 2, stdout: "Do you really want to delete car-validator? (Y/N) ", stderr: <<~EOM
53
+ FATAL: You must specify --delete-validators to delete the validator client car-validator
54
+ EOM
55
+ end
56
+
57
+ it "deletes a validator correctly" do
58
+ knife("client delete car-validator -D", input: "Y").should_succeed <<~EOM
59
+ Do you really want to delete car-validator? (Y/N) Deleted client[car-validator]
60
+ EOM
61
+ end
62
+
63
+ end
64
+ end
@@ -0,0 +1,66 @@
1
+ #
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require "knife_spec_helper"
18
+ require "support/shared/integration/integration_helper"
19
+ require "support/shared/context/config"
20
+ require "openssl"
21
+
22
+ describe "knife client key create", :workstation do
23
+ include IntegrationSupport
24
+ include KnifeSupport
25
+
26
+ include_context "default config options"
27
+
28
+ let(:out) { "Created key: new" }
29
+
30
+ when_the_chef_server "has a client" do
31
+ before do
32
+ client "bah", {}
33
+ end
34
+
35
+ it "creates a new client key" do
36
+ knife("client key create -k new bah").should_succeed stderr: /^#{out}/, stdout: /.*BEGIN RSA PRIVATE KEY/
37
+ end
38
+
39
+ it "creates a new client key with an expiration date" do
40
+ date = "2017-12-31T23:59:59Z"
41
+ knife("client key create -k new -e #{date} bah").should_succeed stderr: /^#{out}/, stdout: /.*BEGIN RSA PRIVATE KEY/
42
+ knife("client key show bah new").should_succeed(/expiration_date:.*#{date}/)
43
+ end
44
+
45
+ it "refuses to add an already existing key" do
46
+ knife("client key create -k new bah")
47
+ expect { knife("client key create -k new bah") }.to raise_error(Net::HTTPClientException)
48
+ end
49
+
50
+ it "saves the private key to a file" do
51
+ Dir.mktmpdir do |tgt|
52
+ knife("client key create -f #{tgt}/bah.pem -k new bah").should_succeed stderr: /^#{out}/
53
+ expect(File).to exist("#{tgt}/bah.pem")
54
+ end
55
+ end
56
+
57
+ it "reads the public key from a file" do
58
+ Dir.mktmpdir do |tgt|
59
+ key = OpenSSL::PKey::RSA.generate(1024)
60
+ File.open("#{tgt}/public.pem", "w") { |pub| pub.write(key.public_key.to_pem) }
61
+ knife("client key create -p #{tgt}/public.pem -k new bah").should_succeed stderr: /^#{out}/
62
+ end
63
+ end
64
+
65
+ end
66
+ end
@@ -0,0 +1,43 @@
1
+ #
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require "knife_spec_helper"
18
+ require "support/shared/integration/integration_helper"
19
+ require "support/shared/context/config"
20
+
21
+ describe "knife client key delete", :workstation do
22
+ include IntegrationSupport
23
+ include KnifeSupport
24
+
25
+ include_context "default config options"
26
+
27
+ when_the_chef_server "has a client" do
28
+ before do
29
+ client "car", {}
30
+ end
31
+
32
+ it "deletes a client" do
33
+ out = "Do you really want to delete the key named new for the client named car? (Y/N) "
34
+ knife("client key create -k new car")
35
+ knife("client key delete car new", input: "Y").should_succeed stdout: out, stderr: <<~EOM
36
+ Deleted key named new for the client named car
37
+ EOM
38
+
39
+ knife("client key list car").should_succeed ""
40
+ end
41
+
42
+ end
43
+ end
@@ -0,0 +1,61 @@
1
+ #
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require "knife_spec_helper"
18
+ require "support/shared/integration/integration_helper"
19
+ require "support/shared/context/config"
20
+ require "date"
21
+
22
+ describe "knife client key list", :workstation do
23
+ include IntegrationSupport
24
+ include KnifeSupport
25
+
26
+ include_context "default config options"
27
+
28
+ let(:now) { DateTime.now }
29
+ let(:last_month) { (now << 1).strftime("%FT%TZ") }
30
+ let(:next_month) { (now >> 1).strftime("%FT%TZ") }
31
+
32
+ when_the_chef_server "has a client" do
33
+ before do
34
+ client "cons", {}
35
+ knife("client key create cons -k new")
36
+ knife("client key create cons -k next_month -e #{next_month}")
37
+ knife("client key create cons -k expired -e #{last_month}")
38
+ end
39
+
40
+ it "lists the keys for a client" do
41
+ knife("client key list cons").should_succeed "expired\nnew\nnext_month\n"
42
+ end
43
+
44
+ it "shows detailed output" do
45
+ knife("client key list -w cons").should_succeed <<~EOM
46
+ expired: http://127.0.0.1:8900/clients/cons/keys/expired (expired)
47
+ new: http://127.0.0.1:8900/clients/cons/keys/new
48
+ next_month: http://127.0.0.1:8900/clients/cons/keys/next_month
49
+ EOM
50
+ end
51
+
52
+ it "lists the expired keys for a client" do
53
+ knife("client key list -e cons").should_succeed "expired\n"
54
+ end
55
+
56
+ it "lists the unexpired keys for a client" do
57
+ knife("client key list -n cons").should_succeed "new\nnext_month\n"
58
+ end
59
+
60
+ end
61
+ end
@@ -0,0 +1,45 @@
1
+ #
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require "knife_spec_helper"
18
+ require "support/shared/integration/integration_helper"
19
+ require "support/shared/context/config"
20
+ require "date"
21
+
22
+ describe "knife client key show", :workstation do
23
+ include IntegrationSupport
24
+ include KnifeSupport
25
+
26
+ include_context "default config options"
27
+
28
+ let(:now) { DateTime.now }
29
+ let(:last_month) { (now << 1).strftime("%FT%TZ") }
30
+ let(:next_month) { (now >> 1).strftime("%FT%TZ") }
31
+
32
+ when_the_chef_server "has a client" do
33
+ before do
34
+ client "cons", {}
35
+ knife("client key create cons -k new")
36
+ knife("client key create cons -k next_month -e #{next_month}")
37
+ knife("client key create cons -k expired -e #{last_month}")
38
+ end
39
+
40
+ it "shows a key for a client" do
41
+ knife("client key show cons new").should_succeed stdout: /.*name:.*new/
42
+ end
43
+
44
+ end
45
+ end