cuken 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (396) hide show
  1. data/Gemfile +5 -3
  2. data/Gemfile.lock +61 -18
  3. data/LICENSE +13 -0
  4. data/NOTICE +3 -0
  5. data/Rakefile +3 -3
  6. data/VERSION +1 -1
  7. data/cucumber.yml +8 -0
  8. data/cuken.gemspec +397 -13
  9. data/examples/chef/features/support/env.rb +16 -0
  10. data/features/chef/cookbooks/cookbook.feature +14 -0
  11. data/features/chef/cookbooks/metadata.feature +40 -0
  12. data/features/chef/cookbooks/repo.feature +13 -0
  13. data/features/chef/knife.feature +140 -0
  14. data/features/chef/knife_steps.feature +19 -0
  15. data/features/command_steps.feature +68 -0
  16. data/features/commands.feature +5 -5
  17. data/features/common_steps.feature +13 -0
  18. data/features/data/Rakefile +38 -0
  19. data/features/data/apt/chef-integration-test-1.0/debian/changelog +5 -0
  20. data/features/data/apt/chef-integration-test-1.0/debian/compat +1 -0
  21. data/features/data/apt/chef-integration-test-1.0/debian/control +13 -0
  22. data/features/data/apt/chef-integration-test-1.0/debian/copyright +34 -0
  23. data/features/data/apt/chef-integration-test-1.0/debian/files +1 -0
  24. data/features/data/apt/chef-integration-test-1.0/debian/rules +13 -0
  25. data/features/data/apt/chef-integration-test-1.0/debian/source/format +1 -0
  26. data/features/data/apt/chef-integration-test-1.1/debian/changelog +11 -0
  27. data/features/data/apt/chef-integration-test-1.1/debian/compat +1 -0
  28. data/features/data/apt/chef-integration-test-1.1/debian/control +13 -0
  29. data/features/data/apt/chef-integration-test-1.1/debian/copyright +34 -0
  30. data/features/data/apt/chef-integration-test-1.1/debian/files +1 -0
  31. data/features/data/apt/chef-integration-test-1.1/debian/rules +13 -0
  32. data/features/data/apt/chef-integration-test-1.1/debian/source/format +1 -0
  33. data/features/data/apt/chef-integration-test_1.0-1_amd64.changes +22 -0
  34. data/features/data/apt/chef-integration-test_1.0-1_amd64.deb +0 -0
  35. data/features/data/apt/chef-integration-test_1.0.orig.tar.gz +0 -0
  36. data/features/data/apt/chef-integration-test_1.1-1_amd64.changes +22 -0
  37. data/features/data/apt/chef-integration-test_1.1-1_amd64.deb +0 -0
  38. data/features/data/apt/chef-integration-test_1.1.orig.tar.gz +0 -0
  39. data/features/data/apt/var/www/apt/conf/distributions +7 -0
  40. data/features/data/apt/var/www/apt/conf/incoming +4 -0
  41. data/features/data/apt/var/www/apt/conf/pulls +3 -0
  42. data/features/data/apt/var/www/apt/db/checksums.db +0 -0
  43. data/features/data/apt/var/www/apt/db/contents.cache.db +0 -0
  44. data/features/data/apt/var/www/apt/db/packages.db +0 -0
  45. data/features/data/apt/var/www/apt/db/references.db +0 -0
  46. data/features/data/apt/var/www/apt/db/release.caches.db +0 -0
  47. data/features/data/apt/var/www/apt/db/version +4 -0
  48. data/features/data/apt/var/www/apt/dists/sid/Release +19 -0
  49. data/features/data/apt/var/www/apt/dists/sid/main/binary-amd64/Packages +16 -0
  50. data/features/data/apt/var/www/apt/dists/sid/main/binary-amd64/Packages.gz +0 -0
  51. data/features/data/apt/var/www/apt/dists/sid/main/binary-amd64/Release +5 -0
  52. data/features/data/apt/var/www/apt/pool/main/c/chef-integration-test/chef-integration-test_1.0-1_amd64.deb +0 -0
  53. data/features/data/apt/var/www/apt/pool/main/c/chef-integration-test/chef-integration-test_1.1-1_amd64.deb +0 -0
  54. data/features/data/config/client.rb +23 -0
  55. data/features/data/config/client_with_checksum_caching.rb +23 -0
  56. data/features/data/config/knife-stephen.rb +12 -0
  57. data/features/data/config/knife.rb +11 -0
  58. data/features/data/config/rake.rb +57 -0
  59. data/features/data/config/server.rb +52 -0
  60. data/features/data/cookbook_tarballs/empty_tarball.tar.gz +0 -0
  61. data/features/data/cookbook_tarballs/new.tar.gz +0 -0
  62. data/features/data/cookbook_tarballs/not_a_tarball.txt +1 -0
  63. data/features/data/cookbook_tarballs/original.tar.gz +0 -0
  64. data/features/data/cookbooks/attribute_include/README.rdoc +8 -0
  65. data/features/data/cookbooks/attribute_include/attributes/a.rb +4 -0
  66. data/features/data/cookbooks/attribute_include/attributes/b.rb +2 -0
  67. data/features/data/cookbooks/attribute_include/metadata.rb +6 -0
  68. data/features/data/cookbooks/attribute_include/recipes/default.rb +23 -0
  69. data/features/data/cookbooks/attribute_include_default/README.rdoc +8 -0
  70. data/features/data/cookbooks/attribute_include_default/attributes/a.rb +5 -0
  71. data/features/data/cookbooks/attribute_include_default/attributes/default.rb +2 -0
  72. data/features/data/cookbooks/attribute_include_default/metadata.rb +6 -0
  73. data/features/data/cookbooks/attribute_include_default/recipes/default.rb +23 -0
  74. data/features/data/cookbooks/attribute_settings/README.rdoc +8 -0
  75. data/features/data/cookbooks/attribute_settings/attributes/default.rb +3 -0
  76. data/features/data/cookbooks/attribute_settings/default.rb +1 -0
  77. data/features/data/cookbooks/attribute_settings/metadata.rb +6 -0
  78. data/features/data/cookbooks/attribute_settings/recipes/default.rb +21 -0
  79. data/features/data/cookbooks/attribute_settings/recipes/default_in_recipe.rb +25 -0
  80. data/features/data/cookbooks/attribute_settings_normal/README.rdoc +8 -0
  81. data/features/data/cookbooks/attribute_settings_normal/attributes/.default.rb.swo +0 -0
  82. data/features/data/cookbooks/attribute_settings_normal/attributes/default.rb +2 -0
  83. data/features/data/cookbooks/attribute_settings_normal/default.rb +1 -0
  84. data/features/data/cookbooks/attribute_settings_normal/metadata.rb +6 -0
  85. data/features/data/cookbooks/attribute_settings_normal/recipes/.default.rb.swo +0 -0
  86. data/features/data/cookbooks/attribute_settings_normal/recipes/.default_in_recipe.rb.swo +0 -0
  87. data/features/data/cookbooks/attribute_settings_normal/recipes/default.rb +21 -0
  88. data/features/data/cookbooks/attribute_settings_normal/recipes/normal_in_recipe.rb +25 -0
  89. data/features/data/cookbooks/attribute_settings_override/README.rdoc +8 -0
  90. data/features/data/cookbooks/attribute_settings_override/attributes/default.rb +2 -0
  91. data/features/data/cookbooks/attribute_settings_override/default.rb +1 -0
  92. data/features/data/cookbooks/attribute_settings_override/metadata.rb +6 -0
  93. data/features/data/cookbooks/attribute_settings_override/recipes/default.rb +21 -0
  94. data/features/data/cookbooks/attribute_settings_override/recipes/normal_in_recipe.rb +25 -0
  95. data/features/data/cookbooks/attribute_settings_override/recipes/override_in_recipe.rb +21 -0
  96. data/features/data/cookbooks/delayed_notifications/recipes/bad_syntax_notifies.rb +14 -0
  97. data/features/data/cookbooks/delayed_notifications/recipes/default.rb +18 -0
  98. data/features/data/cookbooks/delayed_notifications/recipes/forward_references.rb +10 -0
  99. data/features/data/cookbooks/delayed_notifications/recipes/invalid_forward_reference.rb +16 -0
  100. data/features/data/cookbooks/delayed_notifications/recipes/notify_a_resource_from_a_single_source.rb +26 -0
  101. data/features/data/cookbooks/delayed_notifications/recipes/notify_a_resource_from_multiple_sources.rb +31 -0
  102. data/features/data/cookbooks/delayed_notifications/recipes/notify_different_resources_for_different_actions.rb +31 -0
  103. data/features/data/cookbooks/deploy/recipes/callbacks.rb +78 -0
  104. data/features/data/cookbooks/deploy/recipes/default.rb +51 -0
  105. data/features/data/cookbooks/deploy/recipes/deploy_commit1.rb +25 -0
  106. data/features/data/cookbooks/deploy/recipes/deploy_commit2.rb +25 -0
  107. data/features/data/cookbooks/deploy/recipes/embedded_recipe_callbacks.rb +70 -0
  108. data/features/data/cookbooks/deploy/recipes/revision_deploy.rb +51 -0
  109. data/features/data/cookbooks/deploy/recipes/rollback_commit2.rb +24 -0
  110. data/features/data/cookbooks/deploy/templates/default/app_config.yml.erb +23 -0
  111. data/features/data/cookbooks/deploy/templates/default/database.yml.erb +18 -0
  112. data/features/data/cookbooks/deploy/templates/default/embedded_recipe_before_symlink.rb.erb +4 -0
  113. data/features/data/cookbooks/deploy/templates/default/sneaky_after_restart_hook.rb.erb +4 -0
  114. data/features/data/cookbooks/deploy/templates/default/sneaky_before_migrate_hook.rb.erb +2 -0
  115. data/features/data/cookbooks/deploy/templates/default/sneaky_before_restart_hook.rb.erb +4 -0
  116. data/features/data/cookbooks/deploy/templates/default/sneaky_before_symlink_hook.rb.erb +2 -0
  117. data/features/data/cookbooks/directory_provider/recipes/create.rb +25 -0
  118. data/features/data/cookbooks/directory_provider/recipes/default.rb +18 -0
  119. data/features/data/cookbooks/directory_provider/recipes/delete.rb +29 -0
  120. data/features/data/cookbooks/directory_provider/recipes/delete_nonexistent.rb +23 -0
  121. data/features/data/cookbooks/directory_provider/recipes/owner_update.rb +31 -0
  122. data/features/data/cookbooks/directory_provider/recipes/set_the_accessibility_of_a_created_directory.rb +55 -0
  123. data/features/data/cookbooks/execute_commands/metadata.rb +5 -0
  124. data/features/data/cookbooks/execute_commands/recipes/4k.rb +25 -0
  125. data/features/data/cookbooks/execute_commands/recipes/debug.rb +22 -0
  126. data/features/data/cookbooks/execute_commands/recipes/default.rb +22 -0
  127. data/features/data/cookbooks/execute_commands/recipes/umask.rb +23 -0
  128. data/features/data/cookbooks/integration_setup/attributes/integration.rb +25 -0
  129. data/features/data/cookbooks/integration_setup/recipes/default.rb +24 -0
  130. data/features/data/cookbooks/lwrp/providers/default.rb +9 -0
  131. data/features/data/cookbooks/lwrp/providers/lwp_non_default.rb +3 -0
  132. data/features/data/cookbooks/lwrp/providers/lwp_overridden_load_current_resource.rb +8 -0
  133. data/features/data/cookbooks/lwrp/providers/provider_is_omitted.rb +3 -0
  134. data/features/data/cookbooks/lwrp/recipes/default_everything.rb +4 -0
  135. data/features/data/cookbooks/lwrp/recipes/non_default_provider.rb +6 -0
  136. data/features/data/cookbooks/lwrp/recipes/non_default_resource.rb +6 -0
  137. data/features/data/cookbooks/lwrp/recipes/overridden_provider_load_current_resource.rb +6 -0
  138. data/features/data/cookbooks/lwrp/recipes/overridden_resource_initialize.rb +6 -0
  139. data/features/data/cookbooks/lwrp/recipes/provider_invokes_resource.rb +6 -0
  140. data/features/data/cookbooks/lwrp/recipes/provider_is_a_class.rb +6 -0
  141. data/features/data/cookbooks/lwrp/recipes/provider_is_a_string.rb +6 -0
  142. data/features/data/cookbooks/lwrp/recipes/provider_is_a_symbol.rb +6 -0
  143. data/features/data/cookbooks/lwrp/recipes/provider_is_omitted.rb +3 -0
  144. data/features/data/cookbooks/lwrp/resources/default.rb +4 -0
  145. data/features/data/cookbooks/lwrp/resources/lwr_non_default.rb +3 -0
  146. data/features/data/cookbooks/lwrp/resources/lwr_overridden_initialize.rb +8 -0
  147. data/features/data/cookbooks/lwrp/resources/provider_is_omitted.rb +1 -0
  148. data/features/data/cookbooks/manage_files/recipes/create_a_file.rb +22 -0
  149. data/features/data/cookbooks/manage_files/recipes/default.rb +19 -0
  150. data/features/data/cookbooks/manage_files/recipes/delete_a_file.rb +24 -0
  151. data/features/data/cookbooks/manage_files/recipes/delete_a_file_that_does_not_already_exist.rb +22 -0
  152. data/features/data/cookbooks/manage_files/recipes/manage_file_contents.rb +23 -0
  153. data/features/data/cookbooks/manage_files/recipes/set_the_accessibility_of_a_created_file.rb +79 -0
  154. data/features/data/cookbooks/manage_files/recipes/set_the_owner_of_a_created_file.rb +23 -0
  155. data/features/data/cookbooks/manage_files/recipes/touch_a_file.rb +22 -0
  156. data/features/data/cookbooks/metadata/metadata.rb +17 -0
  157. data/features/data/cookbooks/metadata/recipes/default.rb +18 -0
  158. data/features/data/cookbooks/no_attributes/README.rdoc +8 -0
  159. data/features/data/cookbooks/no_attributes/metadata.rb +6 -0
  160. data/features/data/cookbooks/no_attributes/recipes/default.rb +21 -0
  161. data/features/data/cookbooks/node_cookbook_sync/README.rdoc +8 -0
  162. data/features/data/cookbooks/node_cookbook_sync/attributes/attr_file.rb +0 -0
  163. data/features/data/cookbooks/node_cookbook_sync/definitions/def_file.rb +0 -0
  164. data/features/data/cookbooks/node_cookbook_sync/libraries/lib_file.rb +0 -0
  165. data/features/data/cookbooks/node_cookbook_sync/metadata.rb +6 -0
  166. data/features/data/cookbooks/node_cookbook_sync/recipes/default.rb +18 -0
  167. data/features/data/cookbooks/packages/recipes/default.rb +0 -0
  168. data/features/data/cookbooks/packages/recipes/gem_package.rb +26 -0
  169. data/features/data/cookbooks/packages/recipes/install_apt_package.rb +3 -0
  170. data/features/data/cookbooks/packages/recipes/install_dpkg_package.rb +4 -0
  171. data/features/data/cookbooks/packages/recipes/install_gem_noshell.rb +26 -0
  172. data/features/data/cookbooks/packages/recipes/install_gem_package_twice.rb +26 -0
  173. data/features/data/cookbooks/packages/recipes/macports_install_bad_package.rb +3 -0
  174. data/features/data/cookbooks/packages/recipes/macports_install_yydecode.rb +3 -0
  175. data/features/data/cookbooks/packages/recipes/macports_purge_yydecode.rb +3 -0
  176. data/features/data/cookbooks/packages/recipes/macports_remove_yydecode.rb +3 -0
  177. data/features/data/cookbooks/packages/recipes/macports_upgrade_yydecode.rb +7 -0
  178. data/features/data/cookbooks/packages/recipes/manually_upgrade_gem_package.rb +32 -0
  179. data/features/data/cookbooks/packages/recipes/upgrade_gem_noshell.rb +33 -0
  180. data/features/data/cookbooks/packages/recipes/upgrade_gem_package.rb +33 -0
  181. data/features/data/cookbooks/recipe_include/README.rdoc +8 -0
  182. data/features/data/cookbooks/recipe_include/metadata.rb +6 -0
  183. data/features/data/cookbooks/recipe_include/recipes/default.rb +21 -0
  184. data/features/data/cookbooks/recipe_include/recipes/second.rb +23 -0
  185. data/features/data/cookbooks/roles/recipes/default.rb +26 -0
  186. data/features/data/cookbooks/roles/recipes/env_test.rb +25 -0
  187. data/features/data/cookbooks/run_interval/recipes/default.rb +27 -0
  188. data/features/data/cookbooks/scm/metadata.rb +8 -0
  189. data/features/data/cookbooks/scm/recipes/git.rb +25 -0
  190. data/features/data/cookbooks/search/attributes/search_attrs.rb +1 -0
  191. data/features/data/cookbooks/search/recipes/default.rb +18 -0
  192. data/features/data/cookbooks/search/recipes/search_data.rb +28 -0
  193. data/features/data/cookbooks/search/recipes/search_data_manual.rb +33 -0
  194. data/features/data/cookbooks/search/recipes/search_data_noblock.rb +32 -0
  195. data/features/data/cookbooks/show_cookbook/README.rdoc +8 -0
  196. data/features/data/cookbooks/show_cookbook/attributes/attr_file.rb +0 -0
  197. data/features/data/cookbooks/show_cookbook/definitions/def_file.rb +0 -0
  198. data/features/data/cookbooks/show_cookbook/files/default/prime_time.txt +0 -0
  199. data/features/data/cookbooks/show_cookbook/files/host-latte/prime_time.txt +0 -0
  200. data/features/data/cookbooks/show_cookbook/files/mac_os_x-10.5/prime_time.txt +0 -0
  201. data/features/data/cookbooks/show_cookbook/files/mac_os_x/prime_time.txt +0 -0
  202. data/features/data/cookbooks/show_cookbook/libraries/lib_file.rb +0 -0
  203. data/features/data/cookbooks/show_cookbook/metadata.rb +6 -0
  204. data/features/data/cookbooks/show_cookbook/recipes/default.rb +18 -0
  205. data/features/data/cookbooks/show_cookbook/templates/default/prime_time.txt.erb +0 -0
  206. data/features/data/cookbooks/show_cookbook/templates/host-latte/prime_time.txt.erb +0 -0
  207. data/features/data/cookbooks/show_cookbook/templates/mac_os_x-10.5/prime_time.txt.erb +0 -0
  208. data/features/data/cookbooks/show_cookbook/templates/mac_os_x/prime_time.txt.erb +0 -0
  209. data/features/data/cookbooks/synchronize/recipes/default.rb +18 -0
  210. data/features/data/cookbooks/synchronize_deps/metadata.json +30 -0
  211. data/features/data/cookbooks/synchronize_deps/metadata.rb +1 -0
  212. data/features/data/cookbooks/synchronize_deps/recipes/default.rb +18 -0
  213. data/features/data/cookbooks/template/README.rdoc +8 -0
  214. data/features/data/cookbooks/template/metadata.rb +6 -0
  215. data/features/data/cookbooks/template/recipes/default.rb +26 -0
  216. data/features/data/cookbooks/template/recipes/interval.rb +37 -0
  217. data/features/data/cookbooks/template/recipes/render_node_attrs.rb +26 -0
  218. data/features/data/cookbooks/template/templates/default/node.txt.erb +3 -0
  219. data/features/data/cookbooks/template/templates/default/template.txt.erb +1 -0
  220. data/features/data/cookbooks/transfer_remote_directories/files/default/transfer_directory_feature/bar.txt +1 -0
  221. data/features/data/cookbooks/transfer_remote_directories/files/default/transfer_directory_feature/baz.txt +1 -0
  222. data/features/data/cookbooks/transfer_remote_directories/files/default/transfer_directory_feature/foo.txt +1 -0
  223. data/features/data/cookbooks/transfer_remote_directories/recipes/transfer_directory.rb +29 -0
  224. data/features/data/cookbooks/transfer_remote_files/files/default/transfer_a_file_from_a_cookbook.txt +1 -0
  225. data/features/data/cookbooks/transfer_remote_files/metadata.json +30 -0
  226. data/features/data/cookbooks/transfer_remote_files/metadata.rb +1 -0
  227. data/features/data/cookbooks/transfer_remote_files/recipes/change_remote_file_perms_trickery.rb +33 -0
  228. data/features/data/cookbooks/transfer_remote_files/recipes/default.rb +18 -0
  229. data/features/data/cookbooks/transfer_remote_files/recipes/should_prefer_the_file_for_this_specific_host.rb +22 -0
  230. data/features/data/cookbooks/transfer_remote_files/recipes/transfer_a_file_from_a_cookbook.rb +22 -0
  231. data/features/data/cookbooks/transfer_remote_files/recipes/transfer_a_file_from_a_specific_cookbook.rb +20 -0
  232. data/features/data/cookbooks/transfer_remote_files/recipes/transfer_a_non-existent_file_from_a_cookbook.rb +22 -0
  233. data/features/data/cookbooks/transfer_remote_files_definition/definitions/transfer.rb +6 -0
  234. data/features/data/cookbooks/transfer_remote_files_definition/files/default/easy.txt +1 -0
  235. data/features/data/cookbooks/transfer_some_cookbook_files/files/default/should_be_transferred.txt +3 -0
  236. data/features/data/cookbooks/transfer_some_cookbook_files/files/default/should_not_be_transferred.txt +2 -0
  237. data/features/data/cookbooks/transfer_some_cookbook_files/recipes/default.rb +26 -0
  238. data/features/data/cookbooks/transfer_some_cookbook_files/templates/default/should_be_transferred.erb +2 -0
  239. data/features/data/cookbooks/transfer_some_cookbook_files/templates/default/should_not_be_transferred.erb +3 -0
  240. data/features/data/cookbooks/version_deps/metadata.rb +1 -0
  241. data/features/data/cookbooks/version_deps/recipes/default.rb +1 -0
  242. data/features/data/cookbooks/versions/metadata.rb +5 -0
  243. data/features/data/cookbooks/versions/recipes/default.rb +5 -0
  244. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_a_1.0.0/metadata.json +31 -0
  245. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_a_1.0.0/metadata.rb +8 -0
  246. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_a_1.0.0/recipes/default.rb +18 -0
  247. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_a_2.0.0/metadata.json +29 -0
  248. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_a_2.0.0/metadata.rb +6 -0
  249. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_a_2.0.0/recipes/default.rb +18 -0
  250. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_a_3.0.0/metadata.json +30 -0
  251. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_a_3.0.0/metadata.rb +7 -0
  252. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_a_3.0.0/recipes/default.rb +18 -0
  253. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_b_1.0.0/metadata.json +31 -0
  254. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_b_1.0.0/metadata.rb +8 -0
  255. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_b_1.0.0/recipes/default.rb +18 -0
  256. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_b_2.0.0/metadata.json +31 -0
  257. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_b_2.0.0/metadata.rb +8 -0
  258. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_b_2.0.0/recipes/default.rb +18 -0
  259. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_b_3.0.0/metadata.json +30 -0
  260. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_b_3.0.0/metadata.rb +7 -0
  261. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_b_3.0.0/recipes/default.rb +18 -0
  262. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_c_1.0.0/metadata.json +31 -0
  263. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_c_1.0.0/metadata.rb +8 -0
  264. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_c_1.0.0/recipes/default.rb +18 -0
  265. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_c_2.0.0/metadata.json +29 -0
  266. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_c_2.0.0/metadata.rb +6 -0
  267. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_c_2.0.0/recipes/default.rb +18 -0
  268. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_c_3.0.0/metadata.json +29 -0
  269. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_c_3.0.0/metadata.rb +6 -0
  270. data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_c_3.0.0/recipes/default.rb +18 -0
  271. data/features/data/cookbooks_not_uploaded_at_feature_start/test_cookbook/attributes/attr1.rb +1 -0
  272. data/features/data/cookbooks_not_uploaded_at_feature_start/test_cookbook/attributes/attr2.rb +1 -0
  273. data/features/data/cookbooks_not_uploaded_at_feature_start/test_cookbook/recipes/default.rb +2 -0
  274. data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_invalid_empty_except_metadata/metadata.json +38 -0
  275. data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_invalid_empty_except_metadata/metadata.rb +6 -0
  276. data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_invalid_nometadata/attributes/attributes.rb +1 -0
  277. data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_invalid_nometadata/recipes/default.rb +2 -0
  278. data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid/attributes/attributes.rb +1 -0
  279. data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid/metadata.json +38 -0
  280. data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid/metadata.rb +6 -0
  281. data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid/recipes/default.rb +2 -0
  282. data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid_v0.1.0_with_different_dependencies/attributes/attributes.rb +1 -0
  283. data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid_v0.1.0_with_different_dependencies/metadata.json +40 -0
  284. data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid_v0.1.0_with_different_dependencies/metadata.rb +7 -0
  285. data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid_v0.1.0_with_different_dependencies/recipes/default.rb +2 -0
  286. data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid_v0.2.0/attributes/attributes.rb +1 -0
  287. data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid_v0.2.0/metadata.json +38 -0
  288. data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid_v0.2.0/metadata.rb +6 -0
  289. data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid_v0.2.0/recipes/default.rb +2 -0
  290. data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_wrong_metadata/metadata.json +40 -0
  291. data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_wrong_metadata/recipes/default.rb +1 -0
  292. data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.1.0/metadata.json +39 -0
  293. data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.1.0/metadata.rb +6 -0
  294. data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.1.0/recipes/default.rb +18 -0
  295. data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.1.1/metadata.json +39 -0
  296. data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.1.1/metadata.rb +6 -0
  297. data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.1.1/recipes/default.rb +18 -0
  298. data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.10.0/metadata.json +39 -0
  299. data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.10.0/metadata.rb +6 -0
  300. data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.10.0/recipes/default.rb +18 -0
  301. data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.2.0/metadata.json +39 -0
  302. data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.2.0/metadata.rb +6 -0
  303. data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.2.0/recipes/default.rb +18 -0
  304. data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.9.0/metadata.json +39 -0
  305. data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.9.0/metadata.rb +6 -0
  306. data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.9.0/recipes/default.rb +18 -0
  307. data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.9.7/metadata.json +39 -0
  308. data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.9.7/metadata.rb +6 -0
  309. data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.9.7/recipes/default.rb +18 -0
  310. data/features/data/cookbooks_not_uploaded_at_feature_start/version_updated/attributes/attributes.rb +1 -0
  311. data/features/data/cookbooks_not_uploaded_at_feature_start/version_updated/metadata.json +29 -0
  312. data/features/data/cookbooks_not_uploaded_at_feature_start/version_updated/metadata.rb +6 -0
  313. data/features/data/cookbooks_not_uploaded_at_feature_start/version_updated/recipes/default.rb +2 -0
  314. data/features/data/cookbooks_not_uploaded_at_feature_start/versions/metadata.json +38 -0
  315. data/features/data/cookbooks_not_uploaded_at_feature_start/versions/metadata.rb +5 -0
  316. data/features/data/cookbooks_not_uploaded_at_feature_start/versions/recipes/default.rb +5 -0
  317. data/features/data/gems/Marshal.4.8 +0 -0
  318. data/features/data/gems/Marshal.4.8.Z +0 -0
  319. data/features/data/gems/latest_specs.4.8 +0 -0
  320. data/features/data/gems/latest_specs.4.8.gz +0 -0
  321. data/features/data/gems/prerelease_specs.4.8 +0 -0
  322. data/features/data/gems/prerelease_specs.4.8.gz +0 -0
  323. data/features/data/gems/quick/Marshal.4.8/chef-integration-test-0.1.0.gemspec.rz +0 -0
  324. data/features/data/gems/quick/Marshal.4.8/chef-integration-test-0.1.1.gemspec.rz +0 -0
  325. data/features/data/gems/quick/chef-integration-test-0.1.0.gemspec.rz +0 -0
  326. data/features/data/gems/quick/chef-integration-test-0.1.1.gemspec.rz +0 -0
  327. data/features/data/gems/quick/index +2 -0
  328. data/features/data/gems/quick/index.rz +0 -0
  329. data/features/data/gems/quick/latest_index +1 -0
  330. data/features/data/gems/quick/latest_index.rz +0 -0
  331. data/features/data/gems/specs.4.8 +0 -0
  332. data/features/data/gems/specs.4.8.gz +0 -0
  333. data/features/data/gems/yaml +122 -0
  334. data/features/data/gems/yaml.Z +0 -0
  335. data/features/data/json_attribs/attribute_settings.json +3 -0
  336. data/features/data/json_attribs/json_runlist_and_attrs.json +4 -0
  337. data/features/data/myapp.bundle +0 -0
  338. data/features/data/node-load-test.rb +84 -0
  339. data/features/data/node-simple.rb +18 -0
  340. data/features/data/repositories/chef-repo/.gitignore +2 -0
  341. data/features/data/repositories/chef-repo/README.md +66 -0
  342. data/features/data/repositories/chef-repo/Rakefile +65 -0
  343. data/features/data/repositories/chef-repo/certificates/README.md +19 -0
  344. data/features/data/repositories/chef-repo/config/rake.rb +38 -0
  345. data/features/data/repositories/chef-repo/cookbooks/README.md +53 -0
  346. data/features/data/repositories/chef-repo/data_bags/README.md +23 -0
  347. data/features/data/repositories/chef-repo/roles/README.md +16 -0
  348. data/features/data/repositories/cookbooks/hosts/attributes/hosts.rb +1 -0
  349. data/features/data/repositories/cookbooks/hosts/cc.gemspec +36 -0
  350. data/features/data/repositories/cookbooks/hosts/metadata.json +41 -0
  351. data/features/data/repositories/cookbooks/hosts/metadata.rb +4 -0
  352. data/features/data/repositories/cookbooks/hosts/recipes/default.rb +6 -0
  353. data/features/data/repositories/cookbooks/hosts/templates/default/hosts.erb +27 -0
  354. data/features/data/search-tests/do_knife_search_test.rb +175 -0
  355. data/features/data/search-tests/search-test-nodes.rb +174 -0
  356. data/features/data/test_git_repo.tar.gz +0 -0
  357. data/features/file_steps.feature +70 -0
  358. data/features/files.feature +30 -16
  359. data/features/ssh.feature +2 -1
  360. data/features/ssh_steps.feature +20 -0
  361. data/features/step_definitions/cuken_steps.rb +10 -0
  362. data/features/support/env.rb +1 -0
  363. data/lib/cuken/api/chef.rb +115 -0
  364. data/lib/cuken/api/chef/common.rb +80 -0
  365. data/lib/cuken/api/file.rb +23 -3
  366. data/lib/cuken/chef.rb +3 -0
  367. data/lib/cuken/common.rb +0 -1
  368. data/lib/cuken/cucumber/chef.rb +16 -0
  369. data/lib/cuken/cucumber/chef/common.rb +68 -0
  370. data/lib/cuken/cucumber/chef/cookbook.rb +75 -0
  371. data/lib/cuken/cucumber/chef/cookbook_steps.rb +406 -0
  372. data/lib/cuken/cucumber/chef/deploy_steps.rb +84 -0
  373. data/lib/cuken/cucumber/chef/done_directory_steps.rb +41 -0
  374. data/lib/cuken/cucumber/chef/done_file_steps.rb +107 -0
  375. data/lib/cuken/cucumber/chef/done_knife_steps.rb +34 -0
  376. data/lib/cuken/cucumber/chef/fixture_steps.rb +413 -0
  377. data/lib/cuken/cucumber/chef/knife.rb +34 -0
  378. data/lib/cuken/cucumber/chef/node.rb +27 -0
  379. data/lib/cuken/cucumber/chef/node_steps.rb +88 -0
  380. data/lib/cuken/cucumber/chef/packages.rb +144 -0
  381. data/lib/cuken/cucumber/chef/pending_steps.rb +21 -0
  382. data/lib/cuken/cucumber/chef/recipe_steps.rb +23 -0
  383. data/lib/cuken/cucumber/chef/request_steps.rb +98 -0
  384. data/lib/cuken/cucumber/chef/response_steps.rb +233 -0
  385. data/lib/cuken/cucumber/chef/result_steps.rb +15 -0
  386. data/lib/cuken/cucumber/chef/run_client_steps.rb +260 -0
  387. data/lib/cuken/cucumber/chef/run_solo.rb +78 -0
  388. data/lib/cuken/cucumber/chef/sandbox_steps.rb +137 -0
  389. data/lib/cuken/cucumber/chef/search_steps.rb +70 -0
  390. data/lib/cuken/cucumber/chef/webrat_steps.rb +39 -0
  391. data/lib/cuken/cucumber/cmd.rb +18 -1
  392. data/lib/cuken/cucumber/common.rb +4 -0
  393. data/lib/cuken/cucumber/file.rb +25 -27
  394. data/lib/cuken/cucumber/ssh.rb +6 -6
  395. metadata +427 -27
  396. data/LICENSE.txt +0 -20
@@ -0,0 +1,174 @@
1
+ example_nodes = {
2
+ 'a' => Proc.new do
3
+ n = Chef::Node.new
4
+ n.name 'a'
5
+ n.run_list << "alpha"
6
+ n.tag "apples"
7
+ n.nested({:a1 => {
8
+ :a2 => {:a3 => "A1_A2_A3-a"},
9
+ :b2 => {:a3 => "A1_B2_A3-a"}
10
+ },
11
+ :b1 => {
12
+ :a2 => {:a3 => "B1_A2_A3-a"},
13
+ :b2 => {:a3 => "B1_B2_A3-a"}
14
+ }
15
+ })
16
+ n.value 1
17
+ n.multi_word "foo bar baz"
18
+ n
19
+ end,
20
+
21
+ 'b' => Proc.new do
22
+ n = Chef::Node.new
23
+ n.name 'b'
24
+ n.run_list << "bravo"
25
+ n.tag "apes"
26
+ n.nested({:a1 => {
27
+ :a2 => {:a3 => "A1_A2_A3-b"},
28
+ :b2 => {:a3 => "A1_B2_A3-b"}
29
+ },
30
+ :b1 => {
31
+ :a2 => {:a3 => "B1_A2_A3-b"},
32
+ :b2 => {:a3 => "B1_B2_A3-b"}
33
+ }
34
+ })
35
+ n.value 2
36
+ n.multi_word "bar"
37
+ n
38
+ end,
39
+
40
+ 'ab' => Proc.new do
41
+ n = Chef::Node.new
42
+ n.name 'ab'
43
+ n.run_list << "alpha"
44
+ n.run_list << "bravo"
45
+ n.tag "ack"
46
+ n.multi_word "bar foo"
47
+ n.quotes "\"one\" \"two\" \"three\""
48
+ n
49
+ end,
50
+
51
+ 'c' => Proc.new do
52
+ n = Chef::Node.new
53
+ n.name 'c'
54
+ n.run_list << "charlie"
55
+ n.tag "apes"
56
+ n.nested({:a1 => {
57
+ :a2 => {:a3 => "A1_A2_A3-c"},
58
+ :b2 => {:a3 => "A1_B2_A3-c"}
59
+ },
60
+ :b1 => {
61
+ :a2 => {:a3 => "B1_A2_A3-c"},
62
+ :b2 => {:a3 => "B1_B2_A3-c"}
63
+ }
64
+ })
65
+ n.value 3
66
+ n.multi_word "foo"
67
+ n
68
+ end
69
+ }
70
+
71
+ example_data_bags = {
72
+ 'toys' => Proc.new do
73
+ items = []
74
+ bag = Chef::DataBag.new
75
+ bag.name "toys"
76
+ bag.save
77
+ item = Chef::DataBagItem.new
78
+ item_data = {
79
+ "id" => "marbles",
80
+ "colors" => ["black", "white", "green", "red", "blue"]
81
+ }
82
+ item.data_bag "toys"
83
+ item.raw_data = item_data
84
+ item.save
85
+ items << item
86
+
87
+ item = Chef::DataBagItem.new
88
+ item_data = {
89
+ "id" => "balls",
90
+ "baseballs" => 4,
91
+ "soccerballs" => 2,
92
+ "footballs" => 1
93
+ }
94
+ item.data_bag "toys"
95
+ item.raw_data = item_data
96
+ item.save
97
+ items << item
98
+ items
99
+ end,
100
+
101
+ 'fruit' => Proc.new do
102
+ items = []
103
+ bag = Chef::DataBag.new
104
+ bag.name "fruit"
105
+ bag.save
106
+ item = Chef::DataBagItem.new
107
+ item_data = {
108
+ "id" => "citrus",
109
+ "names" => ["orange", "lemon", "lime"]
110
+ }
111
+ item.data_bag "fruit"
112
+ item.raw_data = item_data
113
+ item.save
114
+ items << item
115
+
116
+ item = Chef::DataBagItem.new
117
+ item_data = {
118
+ "id" => "tropical",
119
+ "names" => ["banana", "papaya", "mango"]
120
+ }
121
+ item.data_bag "fruit"
122
+ item.raw_data = item_data
123
+ item.save
124
+ items << item
125
+ items
126
+ end
127
+ }
128
+
129
+ example_roles = {
130
+ 'prod' =>
131
+ Proc.new do
132
+ r = Chef::Role.new
133
+ r.name "prod"
134
+ r.run_list << "base"
135
+ r.run_list << "role[monitoring]"
136
+ r.default_attributes["key"] = 123
137
+ r.save
138
+ r
139
+ end,
140
+ 'web' =>
141
+ Proc.new do
142
+ r = Chef::Role.new
143
+ r.name "web"
144
+ r.run_list << "base"
145
+ r.run_list << "nginx"
146
+ r.default_attributes["key"] = 456
147
+ r.save
148
+ r
149
+ end
150
+
151
+ }
152
+
153
+ example_nodes.each do |name, nproc|
154
+ n = nproc.call
155
+ n.save
156
+ puts "saved node: #{name}"
157
+ end
158
+
159
+ example_data_bags.each do |name, nproc|
160
+ items = nproc.call
161
+ puts "saved #{items.size} data bag items"
162
+ end
163
+
164
+ %w(ac ab cc).each do |client_name|
165
+ client = Chef::ApiClient.new
166
+ client.name client_name
167
+ client.save
168
+ puts "saved client: #{client.name}"
169
+ end
170
+
171
+ example_roles.each do |name, r|
172
+ a_role = r.call
173
+ puts "saved role: #{a_role.name}"
174
+ end
@@ -0,0 +1,70 @@
1
+ @step_features
2
+ Feature: Listing file steps
3
+ In order to test a running system
4
+ As an administrator
5
+ I want to know what files steps are available
6
+
7
+ Background:
8
+ Given that "cuken/file" has been required
9
+
10
+ Scenario: File and directory navigation
11
+ Then these steps are defined for "cuken/cucumber/file.rb":
12
+ | step |
13
+ |I cd to "([^"]*)" |
14
+
15
+ Scenario: File and directory existence
16
+ Then these steps are defined for "cuken/cucumber/file.rb":
17
+ | step |
18
+ |a directory named "([^"]*)" |
19
+ |a directory named "([^"]*)" should exist |
20
+ |a directory named "([^"]*)" should not exist |
21
+ |a file named "([^"]*)" should exist |
22
+ |a file named "([^"]*)" should not exist |
23
+ |I remove the file "([^"]*)" |
24
+ |the directory "([^"]*)" exists |
25
+ |the directory "([^"]*)" does not exist |
26
+ |the file "([^"]*)" exists |
27
+ |the file "([^"]*)" does not exist |
28
+ |the file "([^"]*)" should not exist |
29
+ |the following directories should exist: |
30
+ |the following directories should not exist: |
31
+ |the following files should exist: |
32
+ |the following files should not exist: |
33
+ |these files exist: |
34
+ |these files do not exist: |
35
+ |these directories exist: |
36
+ |these directories do not exist: |
37
+
38
+ Scenario: File and directory properties
39
+ Then these steps are defined for "cuken/cucumber/file.rb":
40
+ | step |
41
+ |the file "([^"]*)" has mode "([^"]*)" |
42
+ |the directory "([^"]*)" has decimal mode "(\d+)" |
43
+ |the directory "([^"]*)" has octal mode "(\d+)" |
44
+ |the directory "(.+)" is owned by "(.+)" |
45
+ |the file "([^"]*)" has decimal mode "(\d+)" |
46
+ |the file "([^"]*)" has octal mode "(\d+)" |
47
+ |the file "(.+)" is owned by "(.+)" |
48
+ |the (.)time of "(.+)" changes |
49
+ |we record the a-mtime of "(.+)" |
50
+
51
+ Scenario: File and directory content
52
+ Then these steps are defined for "cuken/cucumber/file.rb":
53
+ | step |
54
+ |a file named "([^"]*)" with: |
55
+ |an empty file named "([^"]*)" |
56
+ |the file "([^"]*)" with: |
57
+ |the empty file "([^"]*)" |
58
+ |the file "([^"]*)" contains "([^"]*)" |
59
+ |the file "([^"]*)" contains "([^"]*)" exactly (\d+) times |
60
+ |the file "([^"]*)" contains exactly: |
61
+ |the file "([^"]*)" does not contain "([^"]*)" exactly "(\d+)" times |
62
+ |the file "([^"]*)" should contain "([^"]*)" |
63
+ |the file "([^"]*)" should not contain "([^"]*)" |
64
+ |the file "([^"]*)" should contain exactly: |
65
+ |the file "([^"]*)" should match \/([^\/]*)\/ |
66
+ |the file "([^"]*)" should not match \/([^\/]*)\/ |
67
+ |I write to "([^"]*)" with: |
68
+ |I overwrite "([^"]*)" with: |
69
+ |I append to "([^"]*)" with: |
70
+
@@ -22,16 +22,16 @@ Feature: Examining files
22
22
  Scenario: Atime
23
23
  Given the empty file "foo.file"
24
24
  And we record the a/mtime of "foo.file"
25
- And I run "sleep 1"
26
- And I run "touch -a foo.file"
25
+ And I run `sleep 1`
26
+ And I run `touch -a foo.file`
27
27
  Then the atime of "foo.file" changes
28
28
 
29
29
  @steps
30
30
  Scenario: Mtime
31
31
  Given an empty file named "foo.file"
32
32
  And we record the a/mtime of "foo.file"
33
- And I run "sleep 1"
34
- And I run "touch -m foo.file"
33
+ And I run `sleep 1`
34
+ And I run `touch -m foo.file`
35
35
  Then the mtime of "foo.file" changes
36
36
 
37
37
  @steps
@@ -44,7 +44,7 @@ Feature: Examining files
44
44
  Then the file "monkeytest.file" contains "monkeypants"
45
45
 
46
46
  @steps
47
- Scenario: File contents multiple times
47
+ Scenario: File contents exact match
48
48
  When I write to "monkeytest.file" with:
49
49
  """
50
50
  monkeypants
@@ -57,12 +57,26 @@ Feature: Examining files
57
57
  monkeyshorts
58
58
 
59
59
  """
60
+ Scenario: File contents multiple matches
61
+ When I write to "monkeytest.file" with:
62
+ """
63
+ monkeypants
64
+ monkeyshorts
65
+ monkeypants
66
+ monkeyshorts
67
+
68
+ """
69
+ Then the file "monkeytest.file" contains "monkeyp" exactly "2" times
70
+ Then the file "monkeytest.file" does not contain "monkey" exactly "2" times
71
+
60
72
  @steps
61
73
  Scenario: File modes
62
- When I run "touch filemode.file"
63
- And I run "chmod 644 filemode.file"
64
- Then the file "filemode.file" has mode "644"
65
- And the file "filemode.file" has mode "0644"
74
+ When I run `touch filemode.file`
75
+ And I run `chmod 644 filemode.file`
76
+ Then the file "filemode.file" has octal mode "188"
77
+ And the file "filemode.file" has octal mode "33188"
78
+ And the file "filemode.file" has decimal mode "644"
79
+ And the file "filemode.file" has decimal mode "0644"
66
80
 
67
81
  @steps
68
82
  Scenario: Directory exists
@@ -74,10 +88,10 @@ Feature: Examining files
74
88
  Then the directory "dirtest-m000" does not exist
75
89
 
76
90
  @steps
77
- Scenario: Directory mode
78
- When I run "mkdir -p dirtest"
79
- And I run "chmod 755 dirtest"
80
- Then the directory "dirtest" has mode "755"
81
- And the directory "dirtest" has mode "0755"
82
-
83
-
91
+ Scenario: Directory modes
92
+ When I run `mkdir -p dirtest`
93
+ And I run `chmod 755 dirtest`
94
+ Then the directory "dirtest" has decimal mode "755"
95
+ And the directory "dirtest" has decimal mode "2755"
96
+ Then the directory "dirtest" has octal mode "901"
97
+ And the directory "dirtest" has octal mode "17901"
@@ -1,6 +1,7 @@
1
1
  # For complete Aruba step listing see:
2
2
  # lib/aruba/cucumber.rb
3
3
  # or https://github.com/aslakhellesoy/aruba/blob/master/lib/aruba/cucumber.rb
4
+ @announce
4
5
  Feature: SSH steps
5
6
  In order to specify remote command execution
6
7
  As a developer using Cucumber
@@ -21,5 +22,5 @@ Feature: SSH steps
21
22
  | `whoami` | `hostname` | `echo cuken` | `echo 22` |
22
23
  | :default | localhost | `echo cuken` | 22 |
23
24
  | :default | :default | :default | :default |
24
- And I successfully run "ssh cuken 'echo Supercalifragilisticexpialidocious;'"
25
+ And I successfully run `ssh cuken 'echo Supercalifragilisticexpialidocious;'`
25
26
  Then the output should contain "Supercalifragilisticexpialidocious"
@@ -0,0 +1,20 @@
1
+ @step_features
2
+ Feature: Listing file steps
3
+ In order to test a running system
4
+ As an administrator
5
+ I want to know what SSH steps are available
6
+
7
+ Background:
8
+ Given that "cuken/ssh" has been required
9
+
10
+ Scenario: SSH
11
+ Then these steps are defined for "cuken/cucumber/ssh.rb":
12
+ | step |
13
+ |a SSH client user |
14
+ |a SSH client user "([^\"]*)" |
15
+ |a SSH client hostname |
16
+ |a SSH client hostname "([^\"]*)" |
17
+ |default ssh-forever options |
18
+ |I initialize password-less SSH access |
19
+ |I initialize password-less SSH access for: |
20
+ |the ssh-forever options: |
@@ -6,6 +6,16 @@ Given /^that "([^\"]*)" has been required$/ do |lib|
6
6
  require(lib).should be_false
7
7
  end
8
8
 
9
+ Then /^these steps are defined for "([^\"]*)":$/ do |file, table|
10
+ rsc = ::Cucumber::Runtime::SupportCode.new 'ui', :autoload_code_paths => 'lib/cuken/cucumber'
11
+ rsc.load_files! ["lib/#{file}", "#{ENV['GEM_HOME']}/gems/aruba-0.3.5/lib/aruba/cucumber.rb"]
12
+ sd_array = rsc.step_definitions
13
+ #sd_array.each{|sd| puts sd.regexp_source}
14
+ table.hashes.each do |hsh|
15
+ sd_array.each{|sd| res = sd.regexp_source == %Q{/^#{hsh['step']}$/}; break('found') if res}.should == 'found'
16
+ end
17
+ end
18
+
9
19
  When /^I do aruba (.*)$/ do |aruba_step|
10
20
  begin
11
21
  When(aruba_step)
@@ -11,5 +11,6 @@ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
11
11
  require 'cuken/ssh'
12
12
  require 'cuken/cmd'
13
13
  require 'cuken/file'
14
+ require 'cuken/chef'
14
15
 
15
16
  require 'rspec/expectations'
@@ -0,0 +1,115 @@
1
+ require 'aruba/api' unless defined? Aruba::Api
2
+ require 'chef' unless defined? Chef
3
+ require 'cuken/api/chef/common'
4
+
5
+ module ::Cuken
6
+ module Api
7
+ module Chef
8
+
9
+ include ::Cuken::Api::Chef::Common
10
+
11
+ def update_cookbook_paths(ckbk_path, cookbook)
12
+ lp = Pathname(ckbk_path).expand_path.realdirpath
13
+ lrp = lp + '.git'
14
+ if lrp.exist?
15
+ chef.cookbook_paths << lp if cookbook
16
+ chef.cookbooks_paths << lp.parent if cookbook
17
+ lrp
18
+ end
19
+ end
20
+
21
+ def chef_clone_repo(ckbk_path, cookbook = false, repo = chef.remote_chef_repo, brnch = 'master')
22
+ in_current_dir do
23
+ if Dir.exists?(ckbk_path)
24
+ update_cookbook_paths(ckbk_path, cookbook)
25
+ else
26
+ clone_opts = {:quiet => false, :verbose => true, :progress => true, :branch => brnch}
27
+ gritty = ::Grit::Git.new(current_dir)
28
+ gritty.clone(clone_opts, repo, ckbk_path)
29
+ update_cookbook_paths(ckbk_path, cookbook)
30
+ end
31
+ end
32
+ end
33
+
34
+ def run_knife_command(cmd, interactive=false)
35
+ in_current_dir do
36
+ unless chef.client_knife_path
37
+ chef.client_knife_path = Pathname(chef.local_chef_repo).ascend { |d| h=d+'.chef'+'knife.rb'; break h if h.file? }
38
+ end
39
+ cmd += " -c #{chef.client_knife_path.expand_path.to_s}" if chef.client_knife_path.expand_path.exist?
40
+ cmd += " -o #{(chef.cookbooks_paths.collect { |pn| pn.expand_path.to_s }).join(':')}" unless chef.cookbooks_paths.empty?
41
+ cmd += " --log_level debug" if chef.knife_debug
42
+ if interactive
43
+ run_interactive(unescape("#{chef.knife}" + cmd))
44
+ else
45
+ run_simple(unescape("#{chef.knife}" + cmd))
46
+ end
47
+ end
48
+ end
49
+
50
+ def rest
51
+ @rest ||= ::Chef::REST.new('http://localhost:4000', nil, nil)
52
+ end
53
+
54
+ def tmpdir
55
+ @tmpdir ||= ::File.join(Dir.tmpdir, "chef_integration")
56
+ end
57
+
58
+ def server_tmpdir
59
+ @server_tmpdir ||= ::File.expand_path(File.join(datadir, "tmp"))
60
+ end
61
+
62
+ def datadir
63
+ @datadir ||= ::File.join(File.dirname(__FILE__), "..", "data")
64
+ end
65
+
66
+ def configdir
67
+ @configdir ||= ::File.join(File.dirname(__FILE__), "..", "data", "config")
68
+ end
69
+
70
+ def cleanup_files
71
+ @cleanup_files ||= ::Array.new
72
+ end
73
+
74
+ def cleanup_dirs
75
+ @cleanup_dirs ||= ::Array.new
76
+ end
77
+
78
+ def stash
79
+ @stash ||= ::Hash.new
80
+ end
81
+
82
+ def gemserver
83
+ @gemserver ||= ::WEBrick::HTTPServer.new(
84
+ :Port => 8000,
85
+ :DocumentRoot => datadir + "/gems/",
86
+ # Make WEBrick STFU
87
+ :Logger => ::Logger.new(StringIO.new),
88
+ :AccessLog => [ ::StringIO.new, ::WEBrick::AccessLog::COMMON_LOG_FORMAT ]
89
+ )
90
+ end
91
+
92
+ attr_accessor :apt_server_thread
93
+
94
+ def apt_server
95
+ @apt_server ||= ::WEBrick::HTTPServer.new(
96
+ :Port => 9000,
97
+ :DocumentRoot => datadir + "/apt/var/www/apt",
98
+ # Make WEBrick STFU
99
+ :Logger => ::Logger.new(StringIO.new),
100
+ :AccessLog => [ ::StringIO.new, ::WEBrick::AccessLog::COMMON_LOG_FORMAT ]
101
+ )
102
+ end
103
+
104
+ def admin_rest
105
+ admin_client
106
+ @admin_rest ||= ::Chef::REST.new(Chef::Config[:registration_url], 'bobo', "#{tmpdir}/bobo.pem")
107
+ end
108
+
109
+ def couchdb_rest_client
110
+ ::Chef::REST.new('http://localhost:5984/chef_integration', false, false)
111
+ end
112
+
113
+ end
114
+ end
115
+ end