knife 17.0.246 → 17.2.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (573) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -5
  3. data/Rakefile +1 -6
  4. data/knife.gemspec +2 -2
  5. data/lib/chef/knife/configure.rb +1 -1
  6. data/lib/chef/knife/org_user_add.rb +1 -1
  7. data/lib/chef/knife/ssl_fetch.rb +1 -1
  8. data/lib/chef/knife/version.rb +1 -1
  9. data/spec/data/apt/chef-integration-test-1.0/debian/changelog +5 -0
  10. data/spec/data/apt/chef-integration-test-1.0/debian/compat +1 -0
  11. data/spec/data/apt/chef-integration-test-1.0/debian/control +13 -0
  12. data/spec/data/apt/chef-integration-test-1.0/debian/copyright +34 -0
  13. data/spec/data/apt/chef-integration-test-1.0/debian/files +1 -0
  14. data/spec/data/apt/chef-integration-test-1.0/debian/rules +13 -0
  15. data/spec/data/apt/chef-integration-test-1.0/debian/source/format +1 -0
  16. data/spec/data/apt/chef-integration-test-1.1/debian/changelog +11 -0
  17. data/spec/data/apt/chef-integration-test-1.1/debian/compat +1 -0
  18. data/spec/data/apt/chef-integration-test-1.1/debian/control +13 -0
  19. data/spec/data/apt/chef-integration-test-1.1/debian/copyright +34 -0
  20. data/spec/data/apt/chef-integration-test-1.1/debian/files +1 -0
  21. data/spec/data/apt/chef-integration-test-1.1/debian/rules +13 -0
  22. data/spec/data/apt/chef-integration-test-1.1/debian/source/format +1 -0
  23. data/spec/data/apt/chef-integration-test2-1.0/debian/changelog +5 -0
  24. data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2.debhelper.log +45 -0
  25. data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2.substvars +1 -0
  26. data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2/DEBIAN/conffiles +1 -0
  27. data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2/DEBIAN/control +10 -0
  28. data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2/DEBIAN/md5sums +1 -0
  29. data/spec/data/apt/chef-integration-test2-1.0/debian/compat +1 -0
  30. data/spec/data/apt/chef-integration-test2-1.0/debian/conffiles +1 -0
  31. data/spec/data/apt/chef-integration-test2-1.0/debian/control +13 -0
  32. data/spec/data/apt/chef-integration-test2-1.0/debian/copyright +34 -0
  33. data/spec/data/apt/chef-integration-test2-1.0/debian/files +1 -0
  34. data/spec/data/apt/chef-integration-test2-1.0/debian/rules +13 -0
  35. data/spec/data/apt/chef-integration-test2-1.0/debian/source/format +1 -0
  36. data/spec/data/apt/chef-integration-test2_1.0-1.debian.tar.gz +0 -0
  37. data/spec/data/apt/chef-integration-test2_1.0-1.dsc +18 -0
  38. data/spec/data/apt/chef-integration-test2_1.0-1_amd64.build +91 -0
  39. data/spec/data/apt/chef-integration-test2_1.0-1_amd64.changes +31 -0
  40. data/spec/data/apt/chef-integration-test2_1.0-1_amd64.deb +0 -0
  41. data/spec/data/apt/chef-integration-test2_1.0.orig.tar.gz +0 -0
  42. data/spec/data/apt/chef-integration-test_1.0-1_amd64.changes +22 -0
  43. data/spec/data/apt/chef-integration-test_1.0-1_amd64.deb +0 -0
  44. data/spec/data/apt/chef-integration-test_1.0.orig.tar.gz +0 -0
  45. data/spec/data/apt/chef-integration-test_1.1-1_amd64.changes +22 -0
  46. data/spec/data/apt/chef-integration-test_1.1-1_amd64.deb +0 -0
  47. data/spec/data/apt/chef-integration-test_1.1.orig.tar.gz +0 -0
  48. data/spec/data/apt/var/www/apt/conf/distributions +7 -0
  49. data/spec/data/apt/var/www/apt/conf/incoming +4 -0
  50. data/spec/data/apt/var/www/apt/conf/pulls +3 -0
  51. data/spec/data/apt/var/www/apt/db/checksums.db +0 -0
  52. data/spec/data/apt/var/www/apt/db/contents.cache.db +0 -0
  53. data/spec/data/apt/var/www/apt/db/packages.db +0 -0
  54. data/spec/data/apt/var/www/apt/db/references.db +0 -0
  55. data/spec/data/apt/var/www/apt/db/release.caches.db +0 -0
  56. data/spec/data/apt/var/www/apt/db/version +4 -0
  57. data/spec/data/apt/var/www/apt/dists/sid/Release +19 -0
  58. data/spec/data/apt/var/www/apt/dists/sid/main/binary-amd64/Packages +16 -0
  59. data/spec/data/apt/var/www/apt/dists/sid/main/binary-amd64/Packages.gz +0 -0
  60. data/spec/data/apt/var/www/apt/dists/sid/main/binary-amd64/Release +5 -0
  61. data/spec/data/apt/var/www/apt/dists/sid/main/binary-i386/Packages +0 -0
  62. data/spec/data/apt/var/www/apt/pool/main/c/chef-integration-test/chef-integration-test_1.0-1_amd64.deb +0 -0
  63. data/spec/data/apt/var/www/apt/pool/main/c/chef-integration-test/chef-integration-test_1.1-1_amd64.deb +0 -0
  64. data/spec/data/bad-config.rb +1 -0
  65. data/spec/data/bootstrap/encrypted_data_bag_secret +1 -0
  66. data/spec/data/bootstrap/no_proxy.erb +2 -0
  67. data/spec/data/bootstrap/secret.erb +9 -0
  68. data/spec/data/bootstrap/test-hints.erb +12 -0
  69. data/spec/data/bootstrap/test.erb +1 -0
  70. data/spec/data/cb_version_cookbooks/cookbook2/files/test.txt +0 -0
  71. data/spec/data/cb_version_cookbooks/cookbook2/templates/test.erb +0 -0
  72. data/spec/data/cb_version_cookbooks/tatft/README.rdoc +3 -0
  73. data/spec/data/cb_version_cookbooks/tatft/attributes/default.rb +1 -0
  74. data/spec/data/cb_version_cookbooks/tatft/definitions/runit_service.rb +1 -0
  75. data/spec/data/cb_version_cookbooks/tatft/files/default/giant_blob.tgz +1 -0
  76. data/spec/data/cb_version_cookbooks/tatft/libraries/ownage.rb +1 -0
  77. data/spec/data/cb_version_cookbooks/tatft/providers/lwp.rb +1 -0
  78. data/spec/data/cb_version_cookbooks/tatft/recipes/default.rb +1 -0
  79. data/spec/data/cb_version_cookbooks/tatft/resources/lwr.rb +1 -0
  80. data/spec/data/cb_version_cookbooks/tatft/templates/default/configuration.erb +0 -0
  81. data/spec/data/checksum/random.txt +1 -0
  82. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-600hhz-0 +1 -0
  83. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-6m8zdk-0 +0 -0
  84. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ahd2gq-0 +1 -0
  85. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-api8ux-0 +1 -0
  86. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-b0r1m1-0 +1 -0
  87. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-bfygsi-0 +1 -0
  88. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-el14l6-0 +1 -0
  89. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ivrl3y-0 +1 -0
  90. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-kkbs85-0 +1 -0
  91. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ory1ux-0 +1 -0
  92. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-pgsq76-0 +1 -0
  93. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ra8uim-0 +1 -0
  94. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-t7k1g-0 +1 -0
  95. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-t8g0sv-0 +1 -0
  96. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ufy6g3-0 +1 -0
  97. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-x2d6j9-0 +1 -0
  98. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-xi0l6h-0 +1 -0
  99. data/spec/data/client.d_00/00-foo.rb +2 -0
  100. data/spec/data/client.d_00/01-bar.rb +1 -0
  101. data/spec/data/client.d_00/02-strings.rb +2 -0
  102. data/spec/data/client.d_00/bar +1 -0
  103. data/spec/data/client.d_01/foo/bar.rb +1 -0
  104. data/spec/data/client.d_02/foo.rb/foo.txt +1 -0
  105. data/spec/data/config.rb +6 -0
  106. data/spec/data/cookbooks/angrybash/metadata.rb +2 -0
  107. data/spec/data/cookbooks/angrybash/recipes/default.rb +8 -0
  108. data/spec/data/cookbooks/apache2/files/default/apache2_module_conf_generate.pl +2 -0
  109. data/spec/data/cookbooks/apache2/metadata.json +33 -0
  110. data/spec/data/cookbooks/apache2/metadata.rb +2 -0
  111. data/spec/data/cookbooks/apache2/recipes/default.rb +3 -0
  112. data/spec/data/cookbooks/borken/metadata.rb +2 -0
  113. data/spec/data/cookbooks/borken/recipes/default.rb +2 -0
  114. data/spec/data/cookbooks/borken/templates/default/borken.erb +2 -0
  115. data/spec/data/cookbooks/chefignore +8 -0
  116. data/spec/data/cookbooks/ignorken/files/default/not_me.rb +2 -0
  117. data/spec/data/cookbooks/ignorken/metadata.rb +2 -0
  118. data/spec/data/cookbooks/ignorken/recipes/default.rb +1 -0
  119. data/spec/data/cookbooks/ignorken/recipes/ignoreme.rb +2 -0
  120. data/spec/data/cookbooks/ignorken/templates/ubuntu-12.10/not_me.rb +2 -0
  121. data/spec/data/cookbooks/irssi/files/default/irssi.response +2 -0
  122. data/spec/data/cookbooks/java/files/default/java.response +2 -0
  123. data/spec/data/cookbooks/java/metadata.json +33 -0
  124. data/spec/data/cookbooks/java/metadata.rb +2 -0
  125. data/spec/data/cookbooks/name-mismatch-versionnumber/README.md +4 -0
  126. data/spec/data/cookbooks/name-mismatch-versionnumber/metadata.rb +8 -0
  127. data/spec/data/cookbooks/name-mismatch-versionnumber/recipes/default.rb +8 -0
  128. data/spec/data/cookbooks/openldap/.root_dotfile +0 -0
  129. data/spec/data/cookbooks/openldap/attributes/default.rb +16 -0
  130. data/spec/data/cookbooks/openldap/attributes/smokey.rb +1 -0
  131. data/spec/data/cookbooks/openldap/definitions/client.rb +5 -0
  132. data/spec/data/cookbooks/openldap/definitions/server.rb +5 -0
  133. data/spec/data/cookbooks/openldap/files/default/.dotfile +1 -0
  134. data/spec/data/cookbooks/openldap/files/default/.ssh/id_rsa +1 -0
  135. data/spec/data/cookbooks/openldap/files/default/remotedir/.a_dotdir/.a_dotfile_in_a_dotdir +1 -0
  136. data/spec/data/cookbooks/openldap/files/default/remotedir/not_a_template.erb +2 -0
  137. data/spec/data/cookbooks/openldap/files/default/remotedir/remote_dir_file1.txt +3 -0
  138. data/spec/data/cookbooks/openldap/files/default/remotedir/remote_dir_file2.txt +3 -0
  139. data/spec/data/cookbooks/openldap/files/default/remotedir/remotesubdir/.a_dotfile +1 -0
  140. data/spec/data/cookbooks/openldap/files/default/remotedir/remotesubdir/remote_subdir_file1.txt +3 -0
  141. data/spec/data/cookbooks/openldap/files/default/remotedir/remotesubdir/remote_subdir_file2.txt +3 -0
  142. data/spec/data/cookbooks/openldap/files/default/remotedir/subdir_with_no_file_just_a_subsubdir/the_subsubdir/some_file.txt +3 -0
  143. data/spec/data/cookbooks/openldap/libraries/openldap.rb +4 -0
  144. data/spec/data/cookbooks/openldap/libraries/openldap/version.rb +3 -0
  145. data/spec/data/cookbooks/openldap/metadata.rb +8 -0
  146. data/spec/data/cookbooks/openldap/recipes/default.rb +4 -0
  147. data/spec/data/cookbooks/openldap/recipes/gigantor.rb +3 -0
  148. data/spec/data/cookbooks/openldap/recipes/one.rb +15 -0
  149. data/spec/data/cookbooks/openldap/recipes/return.rb +2 -0
  150. data/spec/data/cookbooks/openldap/spec/spec_helper.rb +0 -0
  151. data/spec/data/cookbooks/openldap/templates/default/all_windows_line_endings.erb +4 -0
  152. data/spec/data/cookbooks/openldap/templates/default/helper_test.erb +1 -0
  153. data/spec/data/cookbooks/openldap/templates/default/helpers.erb +14 -0
  154. data/spec/data/cookbooks/openldap/templates/default/helpers_via_partial_test.erb +1 -0
  155. data/spec/data/cookbooks/openldap/templates/default/nested_openldap_partials.erb +1 -0
  156. data/spec/data/cookbooks/openldap/templates/default/nested_partial.erb +1 -0
  157. data/spec/data/cookbooks/openldap/templates/default/no_windows_line_endings.erb +4 -0
  158. data/spec/data/cookbooks/openldap/templates/default/openldap_nested_variable_stuff.erb +1 -0
  159. data/spec/data/cookbooks/openldap/templates/default/openldap_stuff.conf.erb +1 -0
  160. data/spec/data/cookbooks/openldap/templates/default/openldap_variable_stuff.conf.erb +1 -0
  161. data/spec/data/cookbooks/openldap/templates/default/some_windows_line_endings.erb +4 -0
  162. data/spec/data/cookbooks/openldap/templates/default/test.erb +1 -0
  163. data/spec/data/cookbooks/preseed/files/default/preseed-file.seed +1 -0
  164. data/spec/data/cookbooks/preseed/files/default/preseed-template.seed +4 -0
  165. data/spec/data/cookbooks/preseed/metadata.rb +2 -0
  166. data/spec/data/cookbooks/preseed/templates/default/preseed-template-variables.seed +1 -0
  167. data/spec/data/cookbooks/preseed/templates/default/preseed-template.seed +1 -0
  168. data/spec/data/cookbooks/starter/chefignore +8 -0
  169. data/spec/data/cookbooks/starter/files/sample.txt +1 -0
  170. data/spec/data/cookbooks/starter/metadata.rb +2 -0
  171. data/spec/data/cookbooks/starter/recipes/default.rb +4 -0
  172. data/spec/data/cookbooks/supports-platform-constraints/metadata.rb +5 -0
  173. data/spec/data/cookbooks/wget/files/default/wget.response +2 -0
  174. data/spec/data/definitions/test.rb +5 -0
  175. data/spec/data/dsc_lcm.pfx +0 -0
  176. data/spec/data/environment-config.rb +5 -0
  177. data/spec/data/file-providers-method-snapshot-chef-11-4.json +127 -0
  178. data/spec/data/fileedit/blank +0 -0
  179. data/spec/data/fileedit/hosts +4 -0
  180. data/spec/data/gems/chef-integration-test-0.1.0.gem +0 -0
  181. data/spec/data/git_bundles/example-repo.gitbundle +0 -0
  182. data/spec/data/git_bundles/sinatra-test-app-with-callback-files.gitbundle +0 -0
  183. data/spec/data/git_bundles/sinatra-test-app-with-symlinks.gitbundle +0 -0
  184. data/spec/data/git_bundles/sinatra-test-app.gitbundle +0 -0
  185. data/spec/data/incomplete-metadata-chef-repo/incomplete-metadata/README.md +4 -0
  186. data/spec/data/incomplete-metadata-chef-repo/incomplete-metadata/metadata.rb +13 -0
  187. data/spec/data/incomplete-metadata-chef-repo/incomplete-metadata/recipes/default.rb +8 -0
  188. data/spec/data/invalid-metadata-chef-repo/invalid-metadata/README.md +4 -0
  189. data/spec/data/invalid-metadata-chef-repo/invalid-metadata/metadata.rb +9 -0
  190. data/spec/data/invalid-metadata-chef-repo/invalid-metadata/recipes/default.rb +8 -0
  191. data/spec/data/kitchen/chefignore +6 -0
  192. data/spec/data/kitchen/openldap/attributes/default.rb +3 -0
  193. data/spec/data/kitchen/openldap/attributes/robinson.rb +3 -0
  194. data/spec/data/kitchen/openldap/definitions/client.rb +3 -0
  195. data/spec/data/kitchen/openldap/definitions/drewbarrymore.rb +3 -0
  196. data/spec/data/kitchen/openldap/recipes/gigantor.rb +3 -0
  197. data/spec/data/kitchen/openldap/recipes/ignoreme.rb +3 -0
  198. data/spec/data/kitchen/openldap/recipes/woot.rb +3 -0
  199. data/spec/data/knife-home/.chef/plugins/knife/example_home_subcommand.rb +0 -0
  200. data/spec/data/knife-site-subcommands/plugins/knife/example_subcommand.rb +0 -0
  201. data/spec/data/knife_subcommand/test_explicit_category.rb +7 -0
  202. data/spec/data/knife_subcommand/test_name_mapping.rb +4 -0
  203. data/spec/data/knife_subcommand/test_yourself.rb +21 -0
  204. data/spec/data/lwrp/providers/buck_passer.rb +28 -0
  205. data/spec/data/lwrp/providers/buck_passer_2.rb +26 -0
  206. data/spec/data/lwrp/providers/embedded_resource_accesses_providers_scope.rb +28 -0
  207. data/spec/data/lwrp/providers/inline_compiler.rb +24 -0
  208. data/spec/data/lwrp/providers/monkey_name_printer.rb +5 -0
  209. data/spec/data/lwrp/providers/paint_drying_watcher.rb +7 -0
  210. data/spec/data/lwrp/providers/thumb_twiddler.rb +7 -0
  211. data/spec/data/lwrp/resources/bar.rb +4 -0
  212. data/spec/data/lwrp/resources/buck_passer.rb +6 -0
  213. data/spec/data/lwrp/resources/buck_passer_2.rb +4 -0
  214. data/spec/data/lwrp/resources/embedded_resource_accesses_providers_scope.rb +4 -0
  215. data/spec/data/lwrp/resources/foo.rb +6 -0
  216. data/spec/data/lwrp/resources/inline_compiler.rb +4 -0
  217. data/spec/data/lwrp/resources/monkey_name_printer.rb +6 -0
  218. data/spec/data/lwrp/resources/paint_drying_watcher.rb +4 -0
  219. data/spec/data/lwrp/resources/thumb_twiddler.rb +4 -0
  220. data/spec/data/lwrp/resources_with_default_attributes/nodeattr.rb +3 -0
  221. data/spec/data/lwrp_const_scoping/resources/conflict.rb +1 -0
  222. data/spec/data/lwrp_override/providers/buck_passer.rb +5 -0
  223. data/spec/data/lwrp_override/resources/foo.rb +11 -0
  224. data/spec/data/mac_users/10.9.plist.xml +560 -0
  225. data/spec/data/mac_users/10.9.shadow.xml +21 -0
  226. data/spec/data/metadata/quick_start/metadata.rb +14 -0
  227. data/spec/data/mixin/invalid_data.rb +3 -0
  228. data/spec/data/mixin/real_data.rb +2 -0
  229. data/spec/data/nested.json +2 -0
  230. data/spec/data/nodes/default.rb +15 -0
  231. data/spec/data/nodes/test.example.com.rb +17 -0
  232. data/spec/data/nodes/test.rb +15 -0
  233. data/spec/data/null_config.rb +1 -0
  234. data/spec/data/object_loader/environments/test.json +7 -0
  235. data/spec/data/object_loader/environments/test.rb +2 -0
  236. data/spec/data/object_loader/environments/test_json_class.json +8 -0
  237. data/spec/data/object_loader/nodes/test.json +7 -0
  238. data/spec/data/object_loader/nodes/test.rb +2 -0
  239. data/spec/data/object_loader/nodes/test_json_class.json +8 -0
  240. data/spec/data/object_loader/roles/test.json +7 -0
  241. data/spec/data/object_loader/roles/test.rb +2 -0
  242. data/spec/data/object_loader/roles/test_json_class.json +8 -0
  243. data/spec/data/old_home_dir/my-dot-emacs +0 -0
  244. data/spec/data/old_home_dir/my-dot-vim +0 -0
  245. data/spec/data/partial_one.erb +1 -0
  246. data/spec/data/prefer_metadata_json/metadata.json +51 -0
  247. data/spec/data/prefer_metadata_json/metadata.rb +6 -0
  248. data/spec/data/prefer_metadata_json/recipes/default.rb +0 -0
  249. data/spec/data/recipes.tgz +0 -0
  250. data/spec/data/recipes/test.rb +7 -0
  251. data/spec/data/remote_directory_data/remote_dir_file.txt +1 -0
  252. data/spec/data/remote_directory_data/remote_subdirectory/remote_subdir_file.txt +1 -0
  253. data/spec/data/remote_file/nyan_cat.png +0 -0
  254. data/spec/data/remote_file/nyan_cat.png.gz +0 -0
  255. data/spec/data/root_alias_cookbooks/dup_attr/attributes.rb +1 -0
  256. data/spec/data/root_alias_cookbooks/dup_attr/attributes/default.rb +1 -0
  257. data/spec/data/root_alias_cookbooks/dup_attr/metadata.rb +2 -0
  258. data/spec/data/root_alias_cookbooks/dup_attr/recipe.rb +3 -0
  259. data/spec/data/root_alias_cookbooks/dup_recipe/attributes.rb +1 -0
  260. data/spec/data/root_alias_cookbooks/dup_recipe/metadata.rb +2 -0
  261. data/spec/data/root_alias_cookbooks/dup_recipe/recipe.rb +3 -0
  262. data/spec/data/root_alias_cookbooks/dup_recipe/recipes/default.rb +3 -0
  263. data/spec/data/root_alias_cookbooks/simple/attributes.rb +1 -0
  264. data/spec/data/root_alias_cookbooks/simple/metadata.rb +2 -0
  265. data/spec/data/root_alias_cookbooks/simple/recipe.rb +3 -0
  266. data/spec/data/rubygems.org/latest_specs.4.8.gz +0 -0
  267. data/spec/data/rubygems.org/nonexistent_gem +0 -0
  268. data/spec/data/rubygems.org/nonexistent_gem-info +1 -0
  269. data/spec/data/rubygems.org/sexp_processor +0 -0
  270. data/spec/data/rubygems.org/sexp_processor-4.15.1.gemspec.rz +0 -0
  271. data/spec/data/rubygems.org/sexp_processor-info +49 -0
  272. data/spec/data/run_context/cookbooks/circular-dep1/attributes/default.rb +2 -0
  273. data/spec/data/run_context/cookbooks/circular-dep1/definitions/circular_dep1_res.rb +1 -0
  274. data/spec/data/run_context/cookbooks/circular-dep1/libraries/lib.rb +2 -0
  275. data/spec/data/run_context/cookbooks/circular-dep1/metadata.rb +2 -0
  276. data/spec/data/run_context/cookbooks/circular-dep1/providers/provider.rb +1 -0
  277. data/spec/data/run_context/cookbooks/circular-dep1/recipes/default.rb +0 -0
  278. data/spec/data/run_context/cookbooks/circular-dep1/resources/resource.rb +2 -0
  279. data/spec/data/run_context/cookbooks/circular-dep2/attributes/default.rb +2 -0
  280. data/spec/data/run_context/cookbooks/circular-dep2/definitions/circular_dep2_res.rb +1 -0
  281. data/spec/data/run_context/cookbooks/circular-dep2/libraries/lib.rb +2 -0
  282. data/spec/data/run_context/cookbooks/circular-dep2/metadata.rb +2 -0
  283. data/spec/data/run_context/cookbooks/circular-dep2/providers/provider.rb +1 -0
  284. data/spec/data/run_context/cookbooks/circular-dep2/recipes/default.rb +0 -0
  285. data/spec/data/run_context/cookbooks/circular-dep2/resources/resource.rb +2 -0
  286. data/spec/data/run_context/cookbooks/dependency1/attributes/aa_first.rb +2 -0
  287. data/spec/data/run_context/cookbooks/dependency1/attributes/default.rb +2 -0
  288. data/spec/data/run_context/cookbooks/dependency1/attributes/unparsed_file +1 -0
  289. data/spec/data/run_context/cookbooks/dependency1/attributes/zz_last.rb +2 -0
  290. data/spec/data/run_context/cookbooks/dependency1/definitions/dependency1_res.rb +1 -0
  291. data/spec/data/run_context/cookbooks/dependency1/definitions/unparsed_file +1 -0
  292. data/spec/data/run_context/cookbooks/dependency1/libraries/lib.rb +2 -0
  293. data/spec/data/run_context/cookbooks/dependency1/libraries/unparsed_file +1 -0
  294. data/spec/data/run_context/cookbooks/dependency1/providers/provider.rb +1 -0
  295. data/spec/data/run_context/cookbooks/dependency1/providers/unparsed_file +1 -0
  296. data/spec/data/run_context/cookbooks/dependency1/recipes/default.rb +0 -0
  297. data/spec/data/run_context/cookbooks/dependency1/recipes/unparsed_file +1 -0
  298. data/spec/data/run_context/cookbooks/dependency1/resources/resource.rb +2 -0
  299. data/spec/data/run_context/cookbooks/dependency1/resources/unparsed_file +1 -0
  300. data/spec/data/run_context/cookbooks/dependency2/attributes/default.rb +2 -0
  301. data/spec/data/run_context/cookbooks/dependency2/definitions/dependency2_res.rb +1 -0
  302. data/spec/data/run_context/cookbooks/dependency2/libraries/lib.rb +2 -0
  303. data/spec/data/run_context/cookbooks/dependency2/providers/provider.rb +1 -0
  304. data/spec/data/run_context/cookbooks/dependency2/recipes/default.rb +0 -0
  305. data/spec/data/run_context/cookbooks/dependency2/resources/resource.rb +2 -0
  306. data/spec/data/run_context/cookbooks/include/recipes/default.rb +24 -0
  307. data/spec/data/run_context/cookbooks/include/recipes/includee.rb +3 -0
  308. data/spec/data/run_context/cookbooks/no-default-attr/attributes/server.rb +2 -0
  309. data/spec/data/run_context/cookbooks/no-default-attr/definitions/no_default-attr_res.rb +1 -0
  310. data/spec/data/run_context/cookbooks/no-default-attr/providers/provider.rb +1 -0
  311. data/spec/data/run_context/cookbooks/no-default-attr/recipes/default.rb +0 -0
  312. data/spec/data/run_context/cookbooks/no-default-attr/resources/resource.rb +2 -0
  313. data/spec/data/run_context/cookbooks/test-with-circular-deps/attributes/default.rb +2 -0
  314. data/spec/data/run_context/cookbooks/test-with-circular-deps/definitions/test_with-circular-deps_res.rb +1 -0
  315. data/spec/data/run_context/cookbooks/test-with-circular-deps/libraries/lib.rb +2 -0
  316. data/spec/data/run_context/cookbooks/test-with-circular-deps/metadata.rb +2 -0
  317. data/spec/data/run_context/cookbooks/test-with-circular-deps/providers/provider.rb +1 -0
  318. data/spec/data/run_context/cookbooks/test-with-circular-deps/recipes/default.rb +0 -0
  319. data/spec/data/run_context/cookbooks/test-with-circular-deps/resources/resource.rb +3 -0
  320. data/spec/data/run_context/cookbooks/test-with-deps/attributes/default.rb +2 -0
  321. data/spec/data/run_context/cookbooks/test-with-deps/definitions/test_with-deps_res.rb +1 -0
  322. data/spec/data/run_context/cookbooks/test-with-deps/libraries/lib.rb +1 -0
  323. data/spec/data/run_context/cookbooks/test-with-deps/metadata.rb +3 -0
  324. data/spec/data/run_context/cookbooks/test-with-deps/providers/provider.rb +1 -0
  325. data/spec/data/run_context/cookbooks/test-with-deps/recipes/default.rb +0 -0
  326. data/spec/data/run_context/cookbooks/test-with-deps/recipes/server.rb +0 -0
  327. data/spec/data/run_context/cookbooks/test-with-deps/resources/resource.rb +2 -0
  328. data/spec/data/run_context/cookbooks/test/attributes/default.rb +0 -0
  329. data/spec/data/run_context/cookbooks/test/attributes/george.rb +1 -0
  330. data/spec/data/run_context/cookbooks/test/definitions/new_animals.rb +9 -0
  331. data/spec/data/run_context/cookbooks/test/definitions/new_cat.rb +5 -0
  332. data/spec/data/run_context/cookbooks/test/definitions/test_res.rb +1 -0
  333. data/spec/data/run_context/cookbooks/test/providers/provider.rb +1 -0
  334. data/spec/data/run_context/cookbooks/test/recipes/default.rb +5 -0
  335. data/spec/data/run_context/cookbooks/test/recipes/one.rb +7 -0
  336. data/spec/data/run_context/cookbooks/test/recipes/two.rb +7 -0
  337. data/spec/data/run_context/cookbooks/test/resources/resource.rb +3 -0
  338. data/spec/data/run_context/nodes/run_context.rb +5 -0
  339. data/spec/data/sample_msu1.xml +10 -0
  340. data/spec/data/sample_msu2.xml +14 -0
  341. data/spec/data/sample_msu3.xml +16 -0
  342. data/spec/data/search_queries_to_transform.txt +98 -0
  343. data/spec/data/shef-config.rb +11 -0
  344. data/spec/data/snap_package/async_result_success.json +6 -0
  345. data/spec/data/snap_package/change_id_result.json +175 -0
  346. data/spec/data/snap_package/find_result_failure.json +10 -0
  347. data/spec/data/snap_package/find_result_success.json +70 -0
  348. data/spec/data/snap_package/get_by_name_result_failure.json +10 -0
  349. data/spec/data/snap_package/get_by_name_result_success.json +38 -0
  350. data/spec/data/snap_package/get_conf_success.json +10 -0
  351. data/spec/data/snap_package/result_failure.json +9 -0
  352. data/spec/data/ssl/5e707473.0 +18 -0
  353. data/spec/data/ssl/binary/chef-rspec-der.cert +0 -0
  354. data/spec/data/ssl/binary/chef-rspec-der.key +0 -0
  355. data/spec/data/ssl/chef-rspec.cert +27 -0
  356. data/spec/data/ssl/chef-rspec.key +27 -0
  357. data/spec/data/ssl/key.pem +15 -0
  358. data/spec/data/ssl/private_key.pem +27 -0
  359. data/spec/data/ssl/private_key_with_whitespace.pem +32 -0
  360. data/spec/data/standalone_cookbook/Gemfile +1 -0
  361. data/spec/data/standalone_cookbook/chefignore +9 -0
  362. data/spec/data/standalone_cookbook/recipes/default.rb +3 -0
  363. data/spec/data/standalone_cookbook/vendor/bundle/ruby/2.0.0/gems/multi_json-1.9.0/lib/multi_json.rb +1 -0
  364. data/spec/data/templates/chef-seattle20160930-4388-1crv7ef.txt +1 -0
  365. data/spec/data/templates/chef-seattle20160930-4388-jjfoae.txt +1 -0
  366. data/spec/data/templates/chef-seattle20160930-4388-umeq2c.txt +1 -0
  367. data/spec/data/templates/failed.erb +5 -0
  368. data/spec/data/templates/seattle.txt +1 -0
  369. data/spec/data/trusted_certs/example.crt +22 -0
  370. data/spec/data/trusted_certs/example_no_cn.crt +36 -0
  371. data/spec/data/trusted_certs/intermediate.pem +27 -0
  372. data/spec/data/trusted_certs/opscode.pem +57 -0
  373. data/spec/data/trusted_certs/root.pem +22 -0
  374. data/spec/data/windows_certificates/base64_test.cer +20 -0
  375. data/spec/data/windows_certificates/othertest.cer +20 -0
  376. data/spec/data/windows_certificates/test.cer +20 -0
  377. data/spec/data/windows_certificates/test.p7b +0 -0
  378. data/spec/data/windows_certificates/test.pem +20 -0
  379. data/spec/data/windows_certificates/test.pfx +0 -0
  380. data/spec/functional/configure_spec.rb +33 -0
  381. data/spec/functional/cookbook_delete_spec.rb +156 -0
  382. data/spec/functional/exec_spec.rb +55 -0
  383. data/spec/functional/rehash_spec.rb +39 -0
  384. data/spec/functional/smoke_test.rb +42 -0
  385. data/spec/functional/ssh_spec.rb +352 -0
  386. data/spec/functional/version_spec.rb +26 -0
  387. data/spec/integration/chef_fs_data_store_spec.rb +557 -0
  388. data/spec/integration/chef_repo_path_spec.rb +962 -0
  389. data/spec/integration/chef_repository_file_system_spec.rb +200 -0
  390. data/spec/integration/chefignore_spec.rb +301 -0
  391. data/spec/integration/client_bulk_delete_spec.rb +131 -0
  392. data/spec/integration/client_create_spec.rb +70 -0
  393. data/spec/integration/client_delete_spec.rb +64 -0
  394. data/spec/integration/client_key_create_spec.rb +66 -0
  395. data/spec/integration/client_key_delete_spec.rb +43 -0
  396. data/spec/integration/client_key_list_spec.rb +61 -0
  397. data/spec/integration/client_key_show_spec.rb +45 -0
  398. data/spec/integration/client_list_spec.rb +49 -0
  399. data/spec/integration/client_show_spec.rb +37 -0
  400. data/spec/integration/common_options_spec.rb +174 -0
  401. data/spec/integration/config_list_spec.rb +220 -0
  402. data/spec/integration/config_show_spec.rb +192 -0
  403. data/spec/integration/config_use_spec.rb +198 -0
  404. data/spec/integration/cookbook_api_ipv6_spec.rb +113 -0
  405. data/spec/integration/cookbook_bulk_delete_spec.rb +65 -0
  406. data/spec/integration/cookbook_download_spec.rb +72 -0
  407. data/spec/integration/cookbook_list_spec.rb +55 -0
  408. data/spec/integration/cookbook_show_spec.rb +149 -0
  409. data/spec/integration/cookbook_upload_spec.rb +128 -0
  410. data/spec/integration/data_bag_create_spec.rb +125 -0
  411. data/spec/integration/data_bag_delete_spec.rb +59 -0
  412. data/spec/integration/data_bag_edit_spec.rb +105 -0
  413. data/spec/integration/data_bag_from_file_spec.rb +116 -0
  414. data/spec/integration/data_bag_list_spec.rb +44 -0
  415. data/spec/integration/data_bag_show_spec.rb +95 -0
  416. data/spec/integration/delete_spec.rb +1018 -0
  417. data/spec/integration/deps_spec.rb +703 -0
  418. data/spec/integration/diff_spec.rb +605 -0
  419. data/spec/integration/download_spec.rb +1336 -0
  420. data/spec/integration/environment_compare_spec.rb +75 -0
  421. data/spec/integration/environment_create_spec.rb +41 -0
  422. data/spec/integration/environment_delete_spec.rb +37 -0
  423. data/spec/integration/environment_from_file_spec.rb +116 -0
  424. data/spec/integration/environment_list_spec.rb +42 -0
  425. data/spec/integration/environment_show_spec.rb +77 -0
  426. data/spec/integration/list_spec.rb +1060 -0
  427. data/spec/integration/node_bulk_delete_spec.rb +52 -0
  428. data/spec/integration/node_create_spec.rb +47 -0
  429. data/spec/integration/node_delete_spec.rb +48 -0
  430. data/spec/integration/node_environment_set_spec.rb +46 -0
  431. data/spec/integration/node_from_file_spec.rb +59 -0
  432. data/spec/integration/node_list_spec.rb +45 -0
  433. data/spec/integration/node_run_list_add_spec.rb +54 -0
  434. data/spec/integration/node_run_list_remove_spec.rb +36 -0
  435. data/spec/integration/node_run_list_set_spec.rb +41 -0
  436. data/spec/integration/node_show_spec.rb +36 -0
  437. data/spec/integration/raw_spec.rb +297 -0
  438. data/spec/integration/redirection_spec.rb +64 -0
  439. data/spec/integration/role_bulk_delete_spec.rb +52 -0
  440. data/spec/integration/role_create_spec.rb +41 -0
  441. data/spec/integration/role_delete_spec.rb +48 -0
  442. data/spec/integration/role_from_file_spec.rb +96 -0
  443. data/spec/integration/role_list_spec.rb +45 -0
  444. data/spec/integration/role_show_spec.rb +51 -0
  445. data/spec/integration/search_node_spec.rb +40 -0
  446. data/spec/integration/serve_spec.rb +92 -0
  447. data/spec/integration/show_spec.rb +197 -0
  448. data/spec/integration/upload_spec.rb +1617 -0
  449. data/spec/knife_spec_helper.rb +241 -0
  450. data/spec/support/chef_helpers.rb +79 -0
  451. data/spec/support/key_helpers.rb +102 -0
  452. data/spec/support/platform_helpers.rb +251 -0
  453. data/spec/support/platforms/prof/gc.rb +51 -0
  454. data/spec/support/platforms/prof/win32.rb +45 -0
  455. data/spec/support/platforms/win32/spec_service.rb +57 -0
  456. data/spec/support/recipe_dsl_helper.rb +83 -0
  457. data/spec/support/shared/context/config.rb +18 -0
  458. data/spec/support/shared/functional/knife.rb +37 -0
  459. data/spec/support/shared/integration/integration_helper.rb +122 -0
  460. data/spec/support/shared/integration/knife_support.rb +192 -0
  461. data/spec/support/shared/matchers/exit_with_code.rb +32 -0
  462. data/spec/support/shared/matchers/match_environment_variable.rb +17 -0
  463. data/spec/support/shared/unit/knife_shared.rb +39 -0
  464. data/spec/support/shared/unit/mock_shellout.rb +49 -0
  465. data/spec/tiny_server.rb +190 -0
  466. data/spec/unit/application/knife_spec.rb +241 -0
  467. data/spec/unit/knife/bootstrap/chef_vault_handler_spec.rb +152 -0
  468. data/spec/unit/knife/bootstrap/client_builder_spec.rb +207 -0
  469. data/spec/unit/knife/bootstrap/train_connector_spec.rb +244 -0
  470. data/spec/unit/knife/bootstrap_spec.rb +2220 -0
  471. data/spec/unit/knife/client_bulk_delete_spec.rb +166 -0
  472. data/spec/unit/knife/client_create_spec.rb +169 -0
  473. data/spec/unit/knife/client_delete_spec.rb +99 -0
  474. data/spec/unit/knife/client_edit_spec.rb +53 -0
  475. data/spec/unit/knife/client_list_spec.rb +34 -0
  476. data/spec/unit/knife/client_reregister_spec.rb +62 -0
  477. data/spec/unit/knife/client_show_spec.rb +52 -0
  478. data/spec/unit/knife/configure_client_spec.rb +81 -0
  479. data/spec/unit/knife/configure_spec.rb +190 -0
  480. data/spec/unit/knife/cookbook_bulk_delete_spec.rb +87 -0
  481. data/spec/unit/knife/cookbook_delete_spec.rb +239 -0
  482. data/spec/unit/knife/cookbook_download_spec.rb +255 -0
  483. data/spec/unit/knife/cookbook_list_spec.rb +88 -0
  484. data/spec/unit/knife/cookbook_metadata_from_file_spec.rb +72 -0
  485. data/spec/unit/knife/cookbook_metadata_spec.rb +182 -0
  486. data/spec/unit/knife/cookbook_show_spec.rb +253 -0
  487. data/spec/unit/knife/cookbook_upload_spec.rb +364 -0
  488. data/spec/unit/knife/core/bootstrap_context_spec.rb +287 -0
  489. data/spec/unit/knife/core/cookbook_scm_repo_spec.rb +187 -0
  490. data/spec/unit/knife/core/cookbook_site_streaming_uploader_spec.rb +198 -0
  491. data/spec/unit/knife/core/gem_glob_loader_spec.rb +242 -0
  492. data/spec/unit/knife/core/hashed_command_loader_spec.rb +112 -0
  493. data/spec/unit/knife/core/node_editor_spec.rb +211 -0
  494. data/spec/unit/knife/core/object_loader_spec.rb +81 -0
  495. data/spec/unit/knife/core/status_presenter_spec.rb +54 -0
  496. data/spec/unit/knife/core/subcommand_loader_spec.rb +64 -0
  497. data/spec/unit/knife/core/ui_spec.rb +656 -0
  498. data/spec/unit/knife/core/windows_bootstrap_context_spec.rb +238 -0
  499. data/spec/unit/knife/data_bag_create_spec.rb +175 -0
  500. data/spec/unit/knife/data_bag_edit_spec.rb +126 -0
  501. data/spec/unit/knife/data_bag_from_file_spec.rb +174 -0
  502. data/spec/unit/knife/data_bag_secret_options_spec.rb +173 -0
  503. data/spec/unit/knife/data_bag_show_spec.rb +139 -0
  504. data/spec/unit/knife/environment_compare_spec.rb +112 -0
  505. data/spec/unit/knife/environment_create_spec.rb +91 -0
  506. data/spec/unit/knife/environment_delete_spec.rb +71 -0
  507. data/spec/unit/knife/environment_edit_spec.rb +79 -0
  508. data/spec/unit/knife/environment_from_file_spec.rb +90 -0
  509. data/spec/unit/knife/environment_list_spec.rb +54 -0
  510. data/spec/unit/knife/environment_show_spec.rb +52 -0
  511. data/spec/unit/knife/key_create_spec.rb +223 -0
  512. data/spec/unit/knife/key_delete_spec.rb +133 -0
  513. data/spec/unit/knife/key_edit_spec.rb +264 -0
  514. data/spec/unit/knife/key_helper.rb +74 -0
  515. data/spec/unit/knife/key_list_spec.rb +216 -0
  516. data/spec/unit/knife/key_show_spec.rb +126 -0
  517. data/spec/unit/knife/node_bulk_delete_spec.rb +94 -0
  518. data/spec/unit/knife/node_delete_spec.rb +77 -0
  519. data/spec/unit/knife/node_edit_spec.rb +116 -0
  520. data/spec/unit/knife/node_environment_set_spec.rb +61 -0
  521. data/spec/unit/knife/node_from_file_spec.rb +59 -0
  522. data/spec/unit/knife/node_list_spec.rb +62 -0
  523. data/spec/unit/knife/node_policy_set_spec.rb +122 -0
  524. data/spec/unit/knife/node_run_list_add_spec.rb +145 -0
  525. data/spec/unit/knife/node_run_list_remove_spec.rb +106 -0
  526. data/spec/unit/knife/node_run_list_set_spec.rb +115 -0
  527. data/spec/unit/knife/node_show_spec.rb +65 -0
  528. data/spec/unit/knife/org_create_spec.rb +76 -0
  529. data/spec/unit/knife/org_delete_spec.rb +41 -0
  530. data/spec/unit/knife/org_edit_spec.rb +49 -0
  531. data/spec/unit/knife/org_list_spec.rb +58 -0
  532. data/spec/unit/knife/org_show_spec.rb +45 -0
  533. data/spec/unit/knife/org_user_add_spec.rb +39 -0
  534. data/spec/unit/knife/raw_spec.rb +43 -0
  535. data/spec/unit/knife/role_bulk_delete_spec.rb +80 -0
  536. data/spec/unit/knife/role_create_spec.rb +80 -0
  537. data/spec/unit/knife/role_delete_spec.rb +67 -0
  538. data/spec/unit/knife/role_edit_spec.rb +77 -0
  539. data/spec/unit/knife/role_env_run_list_add_spec.rb +217 -0
  540. data/spec/unit/knife/role_env_run_list_clear_spec.rb +94 -0
  541. data/spec/unit/knife/role_env_run_list_remove_spec.rb +102 -0
  542. data/spec/unit/knife/role_env_run_list_replace_spec.rb +105 -0
  543. data/spec/unit/knife/role_env_run_list_set_spec.rb +99 -0
  544. data/spec/unit/knife/role_from_file_spec.rb +69 -0
  545. data/spec/unit/knife/role_list_spec.rb +54 -0
  546. data/spec/unit/knife/role_run_list_add_spec.rb +179 -0
  547. data/spec/unit/knife/role_run_list_clear_spec.rb +84 -0
  548. data/spec/unit/knife/role_run_list_remove_spec.rb +92 -0
  549. data/spec/unit/knife/role_run_list_replace_spec.rb +98 -0
  550. data/spec/unit/knife/role_run_list_set_spec.rb +89 -0
  551. data/spec/unit/knife/role_show_spec.rb +59 -0
  552. data/spec/unit/knife/ssh_spec.rb +403 -0
  553. data/spec/unit/knife/ssl_check_spec.rb +256 -0
  554. data/spec/unit/knife/ssl_fetch_spec.rb +222 -0
  555. data/spec/unit/knife/status_spec.rb +112 -0
  556. data/spec/unit/knife/supermarket_download_spec.rb +152 -0
  557. data/spec/unit/knife/supermarket_install_spec.rb +203 -0
  558. data/spec/unit/knife/supermarket_list_spec.rb +70 -0
  559. data/spec/unit/knife/supermarket_search_spec.rb +85 -0
  560. data/spec/unit/knife/supermarket_share_spec.rb +208 -0
  561. data/spec/unit/knife/supermarket_unshare_spec.rb +78 -0
  562. data/spec/unit/knife/tag_create_spec.rb +23 -0
  563. data/spec/unit/knife/tag_delete_spec.rb +25 -0
  564. data/spec/unit/knife/tag_list_spec.rb +23 -0
  565. data/spec/unit/knife/user_create_spec.rb +256 -0
  566. data/spec/unit/knife/user_delete_spec.rb +171 -0
  567. data/spec/unit/knife/user_edit_spec.rb +54 -0
  568. data/spec/unit/knife/user_list_spec.rb +73 -0
  569. data/spec/unit/knife/user_password_spec.rb +64 -0
  570. data/spec/unit/knife/user_reregister_spec.rb +56 -0
  571. data/spec/unit/knife/user_show_spec.rb +91 -0
  572. data/spec/unit/knife_spec.rb +634 -0
  573. metadata +568 -10
@@ -0,0 +1,49 @@
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 list", :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 "lists the clients" do
37
+ knife("client list").should_succeed <<~EOM
38
+ car
39
+ car-validator
40
+ cat
41
+ cdr
42
+ chef-validator
43
+ chef-webui
44
+ cons
45
+ EOM
46
+ end
47
+
48
+ end
49
+ end
@@ -0,0 +1,37 @@
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 show", :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 "cons", {}
30
+ end
31
+
32
+ it "shows a client" do
33
+ knife("client show cons").should_succeed stdout: /.*name:.*cons/
34
+ end
35
+
36
+ end
37
+ end
@@ -0,0 +1,174 @@
1
+ #
2
+ # Author:: John Keiser (<jkeiser@chef.io>)
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ require "knife_spec_helper"
19
+ require "support/shared/integration/integration_helper"
20
+ require "chef/knife/raw"
21
+
22
+ describe "knife common options", :workstation do
23
+ include IntegrationSupport
24
+ include KnifeSupport
25
+
26
+ before do
27
+ # Allow this for testing the various port binding stuffs. Remove when
28
+ # we kill off --listen.
29
+ Chef::Config.treat_deprecation_warnings_as_errors(false)
30
+ end
31
+
32
+ let(:local_listen_warning) { /\Awarn:.*local.*listen.*$/im }
33
+
34
+ when_the_repository "has a node" do
35
+ before { file "nodes/x.json", {} }
36
+
37
+ context "When chef_zero.enabled is true" do
38
+ before(:each) do
39
+ Chef::Config.chef_zero.enabled = true
40
+ end
41
+
42
+ it "knife raw /nodes/x should retrieve the node in socketless mode" do
43
+ Chef::Config.treat_deprecation_warnings_as_errors(true)
44
+ knife("raw /nodes/x").should_succeed( /"name": "x"/ )
45
+ end
46
+
47
+ it "knife raw /nodes/x should retrieve the node" do
48
+ knife("raw --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
49
+ end
50
+
51
+ context "And chef_zero.port is 9999" do
52
+ before(:each) { Chef::Config.chef_zero.port = 9999 }
53
+
54
+ it "knife raw /nodes/x should retrieve the node" do
55
+ knife("raw --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
56
+ expect(Chef::Config.chef_server_url).to eq("chefzero://localhost:9999")
57
+ end
58
+ end
59
+
60
+ # 0.0.0.0 is not a valid address to bind to on windows.
61
+ context "And chef_zero.host is 0.0.0.0", :unix_only do
62
+ before(:each) { Chef::Config.chef_zero.host = "0.0.0.0" }
63
+
64
+ it "knife raw /nodes/x should retrieve the role" do
65
+ knife("raw --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
66
+ end
67
+ end
68
+
69
+ context "and there is a private key" do
70
+ before do
71
+ file "mykey.pem", <<~EOM
72
+ -----BEGIN RSA PRIVATE KEY-----
73
+ MIIEogIBAAKCAQEApubutqtYYQ5UiA9QhWP7UvSmsfHsAoPKEVVPdVW/e8Svwpyf
74
+ 0Xef6OFWVmBE+W442ZjLOe2y6p2nSnaq4y7dg99NFz6X+16mcKiCbj0RCiGqCvCk
75
+ NftHhTgO9/RFvCbmKZ1RKNob1YzLrFpxBHaSh9po+DGWhApcd+I+op+ZzvDgXhNn
76
+ 0nauZu3rZmApI/r7EEAOjFedAXs7VPNXhhtZAiLSAVIrwU3ZajtSzgXOxbNzgj5O
77
+ AAAMmThK+71qPdffAdO4J198H6/MY04qgtFo7vumzCq0UCaGZfmeI1UNE4+xQWwP
78
+ HJ3pDAP61C6Ebx2snI2kAd9QMx9Y78nIedRHPwIDAQABAoIBAHssRtPM1GacWsom
79
+ 8zfeN6ZbI4KDlbetZz0vhnqDk9NVrpijWlcOP5dwZXVNitnB/HaqCqFvyPDY9JNB
80
+ zI/pEFW4QH59FVDP42mVEt0keCTP/1wfiDDGh1vLqVBYl/ZphscDcNgDTzNkuxMx
81
+ k+LFVxKnn3w7rGc59lALSkpeGvbbIDjp3LUMlUeCF8CIFyYZh9ZvXe4OCxYdyjxb
82
+ i8tnMLKvJ4Psbh5jMapsu3rHQkfPdqzztQUz8vs0NYwP5vWge46FUyk+WNm/IhbJ
83
+ G3YM22nwUS8Eu2bmTtADSJolATbCSkOwQ1D+Fybz/4obfYeGaCdOqB05ttubhenV
84
+ ShsAb7ECgYEA20ecRVxw2S7qA7sqJ4NuYOg9TpfGooptYNA1IP971eB6SaGAelEL
85
+ awYkGNuu2URmm5ElZpwJFFTDLGA7t2zB2xI1FeySPPIVPvJGSiZoFQOVlIg9WQzK
86
+ 7jTtFQ/tOMrF+bigEUJh5bP1/7HzqSpuOsPjEUb2aoCTp+tpiRGL7TUCgYEAwtns
87
+ g3ysrSEcTzpSv7fQRJRk1lkBhatgNd0oc+ikzf74DaVLhBg1jvSThDhiDCdB59mr
88
+ Jh41cnR1XqE8jmdQbCDRiFrI1Pq6TPaDZFcovDVE1gue9x86v3FOH2ukPG4d2/Xy
89
+ HevXjThtpMMsWFi0JYXuzXuV5HOvLZiP8sN3lSMCgYANpdxdGM7RRbE9ADY0dWK2
90
+ V14ReTLcxP7fyrWz0xLzEeCqmomzkz3BsIUoouu0DCTSw+rvAwExqcDoDylIVlWO
91
+ fAifz7SeZHbcDxo+3TsXK7zwnLYsx7YNs2+aIv6hzUUbMNmNmXMcZ+IEwx+mRMTN
92
+ lYmZdrA5mr0V83oDFPt/jQKBgC74RVE03pMlZiObFZNtheDiPKSG9Bz6wMh7NWMr
93
+ c37MtZLkg52mEFMTlfPLe6ceV37CM8WOhqe+dwSGrYhOU06dYqUR7VOZ1Qr0aZvo
94
+ fsNPu/Y0+u7rMkgv0fs1AXQnvz7kvKaF0YITVirfeXMafuKEtJoH7owRbur42cpV
95
+ YCAtAoGAP1rHOc+w0RUcBK3sY7aErrih0OPh9U5bvJsrw1C0FIZhCEoDVA+fNIQL
96
+ syHLXYFNy0OxMtH/bBAXBGNHd9gf5uOnqh0pYcbe/uRAxumC7Rl0cL509eURiA2T
97
+ +vFmf54y9YdnLXaqv+FhJT6B6V7WX7IpU9BMqJY1cJYXHuHG2KA=
98
+ -----END RSA PRIVATE KEY-----
99
+ EOM
100
+ end
101
+
102
+ it "knife raw /nodes/x should retrieve the node" do
103
+ knife("raw --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
104
+ end
105
+ end
106
+ end
107
+
108
+ it "knife raw -z /nodes/x retrieves the node in socketless mode" do
109
+ Chef::Config.treat_deprecation_warnings_as_errors(true)
110
+ knife("raw -z /nodes/x").should_succeed( /"name": "x"/ )
111
+ end
112
+
113
+ it "knife raw -z /nodes/x retrieves the node" do
114
+ knife("raw -z --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
115
+ end
116
+
117
+ it "knife raw --local-mode /nodes/x retrieves the node" do
118
+ knife("raw --local-mode --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
119
+ end
120
+
121
+ it "knife raw -z --chef-zero-port=9999 /nodes/x retrieves the node" do
122
+ knife("raw -z --chef-zero-port=9999 --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
123
+ expect(Chef::Config.chef_server_url).to eq("chefzero://localhost:9999")
124
+ end
125
+
126
+ context "when the default port (8889) is already bound" do
127
+ before :each do
128
+
129
+ @server = ChefZero::Server.new(host: "localhost", port: 8889)
130
+ @server.start_background
131
+ rescue Errno::EADDRINUSE
132
+ # OK. Don't care who has it in use, as long as *someone* does.
133
+
134
+ end
135
+ after :each do
136
+ @server.stop if @server
137
+ end
138
+
139
+ it "knife raw -z /nodes/x retrieves the node" do
140
+ knife("raw -z --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
141
+ expect(URI(Chef::Config.chef_server_url).port).to be > 8889
142
+ end
143
+ end
144
+
145
+ context "when port 9999 is already bound" do
146
+ before :each do
147
+
148
+ @server = ChefZero::Server.new(host: "localhost", port: 9999)
149
+ @server.start_background
150
+ rescue Errno::EADDRINUSE
151
+ # OK. Don't care who has it in use, as long as *someone* does.
152
+
153
+ end
154
+ after :each do
155
+ @server.stop if @server
156
+ end
157
+
158
+ it "knife raw -z --chef-zero-port=9999-20000 /nodes/x" do
159
+ knife("raw -z --chef-zero-port=9999-20000 --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
160
+ expect(URI(Chef::Config.chef_server_url).port).to be > 9999
161
+ end
162
+
163
+ it "knife raw -z --chef-zero-port=9999-9999,19423" do
164
+ knife("raw -z --chef-zero-port=9999-9999,19423 --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
165
+ expect(URI(Chef::Config.chef_server_url).port).to be == 19423
166
+ end
167
+ end
168
+
169
+ it "knife raw -z --chef-zero-port=9999 /nodes/x retrieves the node" do
170
+ knife("raw -z --chef-zero-port=9999 --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
171
+ expect(Chef::Config.chef_server_url).to eq("chefzero://localhost:9999")
172
+ end
173
+ end
174
+ end
@@ -0,0 +1,220 @@
1
+ #
2
+ # Copyright 2018, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ require "knife_spec_helper"
17
+ require "support/shared/integration/integration_helper"
18
+ require "support/shared/context/config"
19
+
20
+ describe "knife config list", :workstation do
21
+ include IntegrationSupport
22
+ include KnifeSupport
23
+
24
+ include_context "default config options"
25
+
26
+ when_the_repository("has a custom env") do
27
+ let(:cmd_args) { [] }
28
+ let(:knife_list) do
29
+ knife("config", "list", *cmd_args, instance_filter: lambda { |instance|
30
+ # Fake the failsafe check because this command doesn't actually process knife.rb.
31
+ $__KNIFE_INTEGRATION_FAILSAFE_CHECK << " ole"
32
+ allow(File).to receive(:file?).and_call_original
33
+ })
34
+ end
35
+ subject { knife_list.stdout }
36
+
37
+ around do |ex|
38
+ # Store and reset the value of some env vars.
39
+ old_home = ENV["HOME"]
40
+ old_wd = Dir.pwd
41
+ # Clear these out because they are cached permanently.
42
+ ChefConfig::PathHelper.class_exec { remove_class_variable(:@@home_dir) }
43
+ Chef::Knife::ConfigList.reset_config_loader!
44
+ begin
45
+ ex.run
46
+ ensure
47
+ ENV["HOME"] = old_home
48
+ Dir.chdir(old_wd)
49
+ ENV[ChefUtils.windows? ? "CD" : "PWD"] = Dir.pwd
50
+ end
51
+ end
52
+
53
+ before do
54
+ # Always run from the temp folder. This can't be in the `around` block above
55
+ # because it has to run after the before set in the "with a chef repo" shared context.
56
+ directory("repo")
57
+ Dir.chdir(path_to("repo"))
58
+ ENV[ChefUtils.windows? ? "CD" : "PWD"] = Dir.pwd
59
+ ENV["HOME"] = path_to(".")
60
+ allow(TTY::Screen).to receive(:width).and_return(200)
61
+ end
62
+
63
+ # NOTE: The funky formatting with # at the end of the line of some of the
64
+ # output examples are because of how the format strings are built, there is
65
+ # substantial trailing whitespace in most cases which many editors "helpfully" remove.
66
+
67
+ context "with no credentials file" do
68
+ subject { knife_list.stderr }
69
+ it { is_expected.to eq "FATAL: No profiles found, #{path_to(".chef/credentials")} does not exist or is empty\n" }
70
+ end
71
+
72
+ context "with an empty credentials file" do
73
+ before { file(".chef/credentials", "") }
74
+ subject { knife_list.stderr }
75
+ it { is_expected.to eq "FATAL: No profiles found, #{path_to(".chef/credentials")} does not exist or is empty\n" }
76
+ end
77
+
78
+ context "with a simple default profile" do
79
+ before { file(".chef/credentials", <<~EOH) }
80
+ [default]
81
+ client_name = "testuser"
82
+ client_key = "testkey.pem"
83
+ chef_server_url = "https://example.com/organizations/testorg"
84
+ EOH
85
+ it { is_expected.to eq <<~EOH.delete("#") }
86
+ Profile Client Key Server #
87
+ --------------------------------------------------------------------------------#
88
+ *default testuser ~/.chef/testkey.pem https://example.com/organizations/testorg #
89
+ EOH
90
+ end
91
+
92
+ context "with multiple profiles" do
93
+ before { file(".chef/credentials", <<~EOH) }
94
+ [default]
95
+ client_name = "testuser"
96
+ client_key = "testkey.pem"
97
+ chef_server_url = "https://example.com/organizations/testorg"
98
+
99
+ [prod]
100
+ client_name = "testuser"
101
+ client_key = "testkey.pem"
102
+ chef_server_url = "https://example.com/organizations/prod"
103
+
104
+ [qa]
105
+ client_name = "qauser"
106
+ client_key = "~/src/qauser.pem"
107
+ chef_server_url = "https://example.com/organizations/testorg"
108
+ EOH
109
+ it { is_expected.to eq <<~EOH.delete("#") }
110
+ Profile Client Key Server #
111
+ --------------------------------------------------------------------------------#
112
+ *default testuser ~/.chef/testkey.pem https://example.com/organizations/testorg #
113
+ prod testuser ~/.chef/testkey.pem https://example.com/organizations/prod #
114
+ qa qauser ~/src/qauser.pem https://example.com/organizations/testorg #
115
+ EOH
116
+ end
117
+
118
+ context "with a non-default active profile" do
119
+ let(:cmd_args) { %w{--profile prod} }
120
+ before { file(".chef/credentials", <<~EOH) }
121
+ [default]
122
+ client_name = "testuser"
123
+ client_key = "testkey.pem"
124
+ chef_server_url = "https://example.com/organizations/testorg"
125
+
126
+ [prod]
127
+ client_name = "testuser"
128
+ client_key = "testkey.pem"
129
+ chef_server_url = "https://example.com/organizations/prod"
130
+
131
+ [qa]
132
+ client_name = "qauser"
133
+ client_key = "~/src/qauser.pem"
134
+ chef_server_url = "https://example.com/organizations/testorg"
135
+ EOH
136
+ it { is_expected.to eq <<~EOH.delete("#") }
137
+ Profile Client Key Server #
138
+ --------------------------------------------------------------------------------#
139
+ default testuser ~/.chef/testkey.pem https://example.com/organizations/testorg #
140
+ *prod testuser ~/.chef/testkey.pem https://example.com/organizations/prod #
141
+ qa qauser ~/src/qauser.pem https://example.com/organizations/testorg #
142
+ EOH
143
+ end
144
+
145
+ context "with a bad profile as an active profile" do
146
+ let(:cmd_args) { %w{--profile production} }
147
+ before { file(".chef/credentials", <<~EOH) }
148
+ [default]
149
+ client_name = "testuser"
150
+ client_key = "testkey.pem"
151
+ chef_server_url = "https://example.com/organizations/testorg"
152
+
153
+ [prod]
154
+ client_name = "testuser"
155
+ client_key = "testkey.pem"
156
+ chef_server_url = "https://example.com/organizations/prod"
157
+
158
+ [qa]
159
+ client_name = "qauser"
160
+ client_key = "~/src/qauser.pem"
161
+ chef_server_url = "https://example.com/organizations/testorg"
162
+ EOH
163
+ it { is_expected.to eq <<~EOH.delete("#") }
164
+ Profile Client Key Server #
165
+ --------------------------------------------------------------------------------#
166
+ default testuser ~/.chef/testkey.pem https://example.com/organizations/testorg #
167
+ prod testuser ~/.chef/testkey.pem https://example.com/organizations/prod #
168
+ qa qauser ~/src/qauser.pem https://example.com/organizations/testorg #
169
+ EOH
170
+ end
171
+
172
+ context "with a minimal profile" do
173
+ before { file(".chef/credentials", <<~EOH) }
174
+ [default]
175
+ chef_server_url = "https://example.com/organizations/testorg"
176
+ EOH
177
+ it { is_expected.to match %r{^*default .*? https://example.com/organizations/testorg} }
178
+ end
179
+
180
+ context "with -i" do
181
+ let(:cmd_args) { %w{-i} }
182
+ before { file(".chef/credentials", <<~EOH) }
183
+ [default]
184
+ chef_server_url = "https://example.com/organizations/testorg"
185
+ EOH
186
+ it { is_expected.to eq <<~EOH.delete("#") }
187
+ Profile Client Key Server #
188
+ --------------------------------------------------------------#
189
+ *default https://example.com/organizations/testorg #
190
+ EOH
191
+ end
192
+
193
+ context "with --format=json" do
194
+ let(:cmd_args) { %w{--format=json node_name} }
195
+ before { file(".chef/credentials", <<~EOH) }
196
+ [default]
197
+ client_name = "testuser"
198
+ client_key = "testkey.pem"
199
+ chef_server_url = "https://example.com/organizations/testorg"
200
+
201
+ [prod]
202
+ client_name = "testuser"
203
+ client_key = "testkey.pem"
204
+ chef_server_url = "https://example.com/organizations/prod"
205
+
206
+ [qa]
207
+ client_name = "qauser"
208
+ client_key = "~/src/qauser.pem"
209
+ chef_server_url = "https://example.com/organizations/testorg"
210
+ EOH
211
+ it {
212
+ expect(JSON.parse(subject)).to eq [
213
+ { "profile" => "default", "active" => true, "client_name" => "testuser", "client_key" => path_to(".chef/testkey.pem"), "server_url" => "https://example.com/organizations/testorg" },
214
+ { "profile" => "prod", "active" => false, "client_name" => "testuser", "client_key" => path_to(".chef/testkey.pem"), "server_url" => "https://example.com/organizations/prod" },
215
+ { "profile" => "qa", "active" => false, "client_name" => "qauser", "client_key" => path_to("src/qauser.pem"), "server_url" => "https://example.com/organizations/testorg" },
216
+ ]
217
+ }
218
+ end
219
+ end
220
+ end