cuken 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +5 -3
- data/Gemfile.lock +61 -18
- data/LICENSE +13 -0
- data/NOTICE +3 -0
- data/Rakefile +3 -3
- data/VERSION +1 -1
- data/cucumber.yml +8 -0
- data/cuken.gemspec +397 -13
- data/examples/chef/features/support/env.rb +16 -0
- data/features/chef/cookbooks/cookbook.feature +14 -0
- data/features/chef/cookbooks/metadata.feature +40 -0
- data/features/chef/cookbooks/repo.feature +13 -0
- data/features/chef/knife.feature +140 -0
- data/features/chef/knife_steps.feature +19 -0
- data/features/command_steps.feature +68 -0
- data/features/commands.feature +5 -5
- data/features/common_steps.feature +13 -0
- data/features/data/Rakefile +38 -0
- data/features/data/apt/chef-integration-test-1.0/debian/changelog +5 -0
- data/features/data/apt/chef-integration-test-1.0/debian/compat +1 -0
- data/features/data/apt/chef-integration-test-1.0/debian/control +13 -0
- data/features/data/apt/chef-integration-test-1.0/debian/copyright +34 -0
- data/features/data/apt/chef-integration-test-1.0/debian/files +1 -0
- data/features/data/apt/chef-integration-test-1.0/debian/rules +13 -0
- data/features/data/apt/chef-integration-test-1.0/debian/source/format +1 -0
- data/features/data/apt/chef-integration-test-1.1/debian/changelog +11 -0
- data/features/data/apt/chef-integration-test-1.1/debian/compat +1 -0
- data/features/data/apt/chef-integration-test-1.1/debian/control +13 -0
- data/features/data/apt/chef-integration-test-1.1/debian/copyright +34 -0
- data/features/data/apt/chef-integration-test-1.1/debian/files +1 -0
- data/features/data/apt/chef-integration-test-1.1/debian/rules +13 -0
- data/features/data/apt/chef-integration-test-1.1/debian/source/format +1 -0
- data/features/data/apt/chef-integration-test_1.0-1_amd64.changes +22 -0
- data/features/data/apt/chef-integration-test_1.0-1_amd64.deb +0 -0
- data/features/data/apt/chef-integration-test_1.0.orig.tar.gz +0 -0
- data/features/data/apt/chef-integration-test_1.1-1_amd64.changes +22 -0
- data/features/data/apt/chef-integration-test_1.1-1_amd64.deb +0 -0
- data/features/data/apt/chef-integration-test_1.1.orig.tar.gz +0 -0
- data/features/data/apt/var/www/apt/conf/distributions +7 -0
- data/features/data/apt/var/www/apt/conf/incoming +4 -0
- data/features/data/apt/var/www/apt/conf/pulls +3 -0
- data/features/data/apt/var/www/apt/db/checksums.db +0 -0
- data/features/data/apt/var/www/apt/db/contents.cache.db +0 -0
- data/features/data/apt/var/www/apt/db/packages.db +0 -0
- data/features/data/apt/var/www/apt/db/references.db +0 -0
- data/features/data/apt/var/www/apt/db/release.caches.db +0 -0
- data/features/data/apt/var/www/apt/db/version +4 -0
- data/features/data/apt/var/www/apt/dists/sid/Release +19 -0
- data/features/data/apt/var/www/apt/dists/sid/main/binary-amd64/Packages +16 -0
- data/features/data/apt/var/www/apt/dists/sid/main/binary-amd64/Packages.gz +0 -0
- data/features/data/apt/var/www/apt/dists/sid/main/binary-amd64/Release +5 -0
- data/features/data/apt/var/www/apt/pool/main/c/chef-integration-test/chef-integration-test_1.0-1_amd64.deb +0 -0
- data/features/data/apt/var/www/apt/pool/main/c/chef-integration-test/chef-integration-test_1.1-1_amd64.deb +0 -0
- data/features/data/config/client.rb +23 -0
- data/features/data/config/client_with_checksum_caching.rb +23 -0
- data/features/data/config/knife-stephen.rb +12 -0
- data/features/data/config/knife.rb +11 -0
- data/features/data/config/rake.rb +57 -0
- data/features/data/config/server.rb +52 -0
- data/features/data/cookbook_tarballs/empty_tarball.tar.gz +0 -0
- data/features/data/cookbook_tarballs/new.tar.gz +0 -0
- data/features/data/cookbook_tarballs/not_a_tarball.txt +1 -0
- data/features/data/cookbook_tarballs/original.tar.gz +0 -0
- data/features/data/cookbooks/attribute_include/README.rdoc +8 -0
- data/features/data/cookbooks/attribute_include/attributes/a.rb +4 -0
- data/features/data/cookbooks/attribute_include/attributes/b.rb +2 -0
- data/features/data/cookbooks/attribute_include/metadata.rb +6 -0
- data/features/data/cookbooks/attribute_include/recipes/default.rb +23 -0
- data/features/data/cookbooks/attribute_include_default/README.rdoc +8 -0
- data/features/data/cookbooks/attribute_include_default/attributes/a.rb +5 -0
- data/features/data/cookbooks/attribute_include_default/attributes/default.rb +2 -0
- data/features/data/cookbooks/attribute_include_default/metadata.rb +6 -0
- data/features/data/cookbooks/attribute_include_default/recipes/default.rb +23 -0
- data/features/data/cookbooks/attribute_settings/README.rdoc +8 -0
- data/features/data/cookbooks/attribute_settings/attributes/default.rb +3 -0
- data/features/data/cookbooks/attribute_settings/default.rb +1 -0
- data/features/data/cookbooks/attribute_settings/metadata.rb +6 -0
- data/features/data/cookbooks/attribute_settings/recipes/default.rb +21 -0
- data/features/data/cookbooks/attribute_settings/recipes/default_in_recipe.rb +25 -0
- data/features/data/cookbooks/attribute_settings_normal/README.rdoc +8 -0
- data/features/data/cookbooks/attribute_settings_normal/attributes/.default.rb.swo +0 -0
- data/features/data/cookbooks/attribute_settings_normal/attributes/default.rb +2 -0
- data/features/data/cookbooks/attribute_settings_normal/default.rb +1 -0
- data/features/data/cookbooks/attribute_settings_normal/metadata.rb +6 -0
- data/features/data/cookbooks/attribute_settings_normal/recipes/.default.rb.swo +0 -0
- data/features/data/cookbooks/attribute_settings_normal/recipes/.default_in_recipe.rb.swo +0 -0
- data/features/data/cookbooks/attribute_settings_normal/recipes/default.rb +21 -0
- data/features/data/cookbooks/attribute_settings_normal/recipes/normal_in_recipe.rb +25 -0
- data/features/data/cookbooks/attribute_settings_override/README.rdoc +8 -0
- data/features/data/cookbooks/attribute_settings_override/attributes/default.rb +2 -0
- data/features/data/cookbooks/attribute_settings_override/default.rb +1 -0
- data/features/data/cookbooks/attribute_settings_override/metadata.rb +6 -0
- data/features/data/cookbooks/attribute_settings_override/recipes/default.rb +21 -0
- data/features/data/cookbooks/attribute_settings_override/recipes/normal_in_recipe.rb +25 -0
- data/features/data/cookbooks/attribute_settings_override/recipes/override_in_recipe.rb +21 -0
- data/features/data/cookbooks/delayed_notifications/recipes/bad_syntax_notifies.rb +14 -0
- data/features/data/cookbooks/delayed_notifications/recipes/default.rb +18 -0
- data/features/data/cookbooks/delayed_notifications/recipes/forward_references.rb +10 -0
- data/features/data/cookbooks/delayed_notifications/recipes/invalid_forward_reference.rb +16 -0
- data/features/data/cookbooks/delayed_notifications/recipes/notify_a_resource_from_a_single_source.rb +26 -0
- data/features/data/cookbooks/delayed_notifications/recipes/notify_a_resource_from_multiple_sources.rb +31 -0
- data/features/data/cookbooks/delayed_notifications/recipes/notify_different_resources_for_different_actions.rb +31 -0
- data/features/data/cookbooks/deploy/recipes/callbacks.rb +78 -0
- data/features/data/cookbooks/deploy/recipes/default.rb +51 -0
- data/features/data/cookbooks/deploy/recipes/deploy_commit1.rb +25 -0
- data/features/data/cookbooks/deploy/recipes/deploy_commit2.rb +25 -0
- data/features/data/cookbooks/deploy/recipes/embedded_recipe_callbacks.rb +70 -0
- data/features/data/cookbooks/deploy/recipes/revision_deploy.rb +51 -0
- data/features/data/cookbooks/deploy/recipes/rollback_commit2.rb +24 -0
- data/features/data/cookbooks/deploy/templates/default/app_config.yml.erb +23 -0
- data/features/data/cookbooks/deploy/templates/default/database.yml.erb +18 -0
- data/features/data/cookbooks/deploy/templates/default/embedded_recipe_before_symlink.rb.erb +4 -0
- data/features/data/cookbooks/deploy/templates/default/sneaky_after_restart_hook.rb.erb +4 -0
- data/features/data/cookbooks/deploy/templates/default/sneaky_before_migrate_hook.rb.erb +2 -0
- data/features/data/cookbooks/deploy/templates/default/sneaky_before_restart_hook.rb.erb +4 -0
- data/features/data/cookbooks/deploy/templates/default/sneaky_before_symlink_hook.rb.erb +2 -0
- data/features/data/cookbooks/directory_provider/recipes/create.rb +25 -0
- data/features/data/cookbooks/directory_provider/recipes/default.rb +18 -0
- data/features/data/cookbooks/directory_provider/recipes/delete.rb +29 -0
- data/features/data/cookbooks/directory_provider/recipes/delete_nonexistent.rb +23 -0
- data/features/data/cookbooks/directory_provider/recipes/owner_update.rb +31 -0
- data/features/data/cookbooks/directory_provider/recipes/set_the_accessibility_of_a_created_directory.rb +55 -0
- data/features/data/cookbooks/execute_commands/metadata.rb +5 -0
- data/features/data/cookbooks/execute_commands/recipes/4k.rb +25 -0
- data/features/data/cookbooks/execute_commands/recipes/debug.rb +22 -0
- data/features/data/cookbooks/execute_commands/recipes/default.rb +22 -0
- data/features/data/cookbooks/execute_commands/recipes/umask.rb +23 -0
- data/features/data/cookbooks/integration_setup/attributes/integration.rb +25 -0
- data/features/data/cookbooks/integration_setup/recipes/default.rb +24 -0
- data/features/data/cookbooks/lwrp/providers/default.rb +9 -0
- data/features/data/cookbooks/lwrp/providers/lwp_non_default.rb +3 -0
- data/features/data/cookbooks/lwrp/providers/lwp_overridden_load_current_resource.rb +8 -0
- data/features/data/cookbooks/lwrp/providers/provider_is_omitted.rb +3 -0
- data/features/data/cookbooks/lwrp/recipes/default_everything.rb +4 -0
- data/features/data/cookbooks/lwrp/recipes/non_default_provider.rb +6 -0
- data/features/data/cookbooks/lwrp/recipes/non_default_resource.rb +6 -0
- data/features/data/cookbooks/lwrp/recipes/overridden_provider_load_current_resource.rb +6 -0
- data/features/data/cookbooks/lwrp/recipes/overridden_resource_initialize.rb +6 -0
- data/features/data/cookbooks/lwrp/recipes/provider_invokes_resource.rb +6 -0
- data/features/data/cookbooks/lwrp/recipes/provider_is_a_class.rb +6 -0
- data/features/data/cookbooks/lwrp/recipes/provider_is_a_string.rb +6 -0
- data/features/data/cookbooks/lwrp/recipes/provider_is_a_symbol.rb +6 -0
- data/features/data/cookbooks/lwrp/recipes/provider_is_omitted.rb +3 -0
- data/features/data/cookbooks/lwrp/resources/default.rb +4 -0
- data/features/data/cookbooks/lwrp/resources/lwr_non_default.rb +3 -0
- data/features/data/cookbooks/lwrp/resources/lwr_overridden_initialize.rb +8 -0
- data/features/data/cookbooks/lwrp/resources/provider_is_omitted.rb +1 -0
- data/features/data/cookbooks/manage_files/recipes/create_a_file.rb +22 -0
- data/features/data/cookbooks/manage_files/recipes/default.rb +19 -0
- data/features/data/cookbooks/manage_files/recipes/delete_a_file.rb +24 -0
- data/features/data/cookbooks/manage_files/recipes/delete_a_file_that_does_not_already_exist.rb +22 -0
- data/features/data/cookbooks/manage_files/recipes/manage_file_contents.rb +23 -0
- data/features/data/cookbooks/manage_files/recipes/set_the_accessibility_of_a_created_file.rb +79 -0
- data/features/data/cookbooks/manage_files/recipes/set_the_owner_of_a_created_file.rb +23 -0
- data/features/data/cookbooks/manage_files/recipes/touch_a_file.rb +22 -0
- data/features/data/cookbooks/metadata/metadata.rb +17 -0
- data/features/data/cookbooks/metadata/recipes/default.rb +18 -0
- data/features/data/cookbooks/no_attributes/README.rdoc +8 -0
- data/features/data/cookbooks/no_attributes/metadata.rb +6 -0
- data/features/data/cookbooks/no_attributes/recipes/default.rb +21 -0
- data/features/data/cookbooks/node_cookbook_sync/README.rdoc +8 -0
- data/features/data/cookbooks/node_cookbook_sync/attributes/attr_file.rb +0 -0
- data/features/data/cookbooks/node_cookbook_sync/definitions/def_file.rb +0 -0
- data/features/data/cookbooks/node_cookbook_sync/libraries/lib_file.rb +0 -0
- data/features/data/cookbooks/node_cookbook_sync/metadata.rb +6 -0
- data/features/data/cookbooks/node_cookbook_sync/recipes/default.rb +18 -0
- data/features/data/cookbooks/packages/recipes/default.rb +0 -0
- data/features/data/cookbooks/packages/recipes/gem_package.rb +26 -0
- data/features/data/cookbooks/packages/recipes/install_apt_package.rb +3 -0
- data/features/data/cookbooks/packages/recipes/install_dpkg_package.rb +4 -0
- data/features/data/cookbooks/packages/recipes/install_gem_noshell.rb +26 -0
- data/features/data/cookbooks/packages/recipes/install_gem_package_twice.rb +26 -0
- data/features/data/cookbooks/packages/recipes/macports_install_bad_package.rb +3 -0
- data/features/data/cookbooks/packages/recipes/macports_install_yydecode.rb +3 -0
- data/features/data/cookbooks/packages/recipes/macports_purge_yydecode.rb +3 -0
- data/features/data/cookbooks/packages/recipes/macports_remove_yydecode.rb +3 -0
- data/features/data/cookbooks/packages/recipes/macports_upgrade_yydecode.rb +7 -0
- data/features/data/cookbooks/packages/recipes/manually_upgrade_gem_package.rb +32 -0
- data/features/data/cookbooks/packages/recipes/upgrade_gem_noshell.rb +33 -0
- data/features/data/cookbooks/packages/recipes/upgrade_gem_package.rb +33 -0
- data/features/data/cookbooks/recipe_include/README.rdoc +8 -0
- data/features/data/cookbooks/recipe_include/metadata.rb +6 -0
- data/features/data/cookbooks/recipe_include/recipes/default.rb +21 -0
- data/features/data/cookbooks/recipe_include/recipes/second.rb +23 -0
- data/features/data/cookbooks/roles/recipes/default.rb +26 -0
- data/features/data/cookbooks/roles/recipes/env_test.rb +25 -0
- data/features/data/cookbooks/run_interval/recipes/default.rb +27 -0
- data/features/data/cookbooks/scm/metadata.rb +8 -0
- data/features/data/cookbooks/scm/recipes/git.rb +25 -0
- data/features/data/cookbooks/search/attributes/search_attrs.rb +1 -0
- data/features/data/cookbooks/search/recipes/default.rb +18 -0
- data/features/data/cookbooks/search/recipes/search_data.rb +28 -0
- data/features/data/cookbooks/search/recipes/search_data_manual.rb +33 -0
- data/features/data/cookbooks/search/recipes/search_data_noblock.rb +32 -0
- data/features/data/cookbooks/show_cookbook/README.rdoc +8 -0
- data/features/data/cookbooks/show_cookbook/attributes/attr_file.rb +0 -0
- data/features/data/cookbooks/show_cookbook/definitions/def_file.rb +0 -0
- data/features/data/cookbooks/show_cookbook/files/default/prime_time.txt +0 -0
- data/features/data/cookbooks/show_cookbook/files/host-latte/prime_time.txt +0 -0
- data/features/data/cookbooks/show_cookbook/files/mac_os_x-10.5/prime_time.txt +0 -0
- data/features/data/cookbooks/show_cookbook/files/mac_os_x/prime_time.txt +0 -0
- data/features/data/cookbooks/show_cookbook/libraries/lib_file.rb +0 -0
- data/features/data/cookbooks/show_cookbook/metadata.rb +6 -0
- data/features/data/cookbooks/show_cookbook/recipes/default.rb +18 -0
- data/features/data/cookbooks/show_cookbook/templates/default/prime_time.txt.erb +0 -0
- data/features/data/cookbooks/show_cookbook/templates/host-latte/prime_time.txt.erb +0 -0
- data/features/data/cookbooks/show_cookbook/templates/mac_os_x-10.5/prime_time.txt.erb +0 -0
- data/features/data/cookbooks/show_cookbook/templates/mac_os_x/prime_time.txt.erb +0 -0
- data/features/data/cookbooks/synchronize/recipes/default.rb +18 -0
- data/features/data/cookbooks/synchronize_deps/metadata.json +30 -0
- data/features/data/cookbooks/synchronize_deps/metadata.rb +1 -0
- data/features/data/cookbooks/synchronize_deps/recipes/default.rb +18 -0
- data/features/data/cookbooks/template/README.rdoc +8 -0
- data/features/data/cookbooks/template/metadata.rb +6 -0
- data/features/data/cookbooks/template/recipes/default.rb +26 -0
- data/features/data/cookbooks/template/recipes/interval.rb +37 -0
- data/features/data/cookbooks/template/recipes/render_node_attrs.rb +26 -0
- data/features/data/cookbooks/template/templates/default/node.txt.erb +3 -0
- data/features/data/cookbooks/template/templates/default/template.txt.erb +1 -0
- data/features/data/cookbooks/transfer_remote_directories/files/default/transfer_directory_feature/bar.txt +1 -0
- data/features/data/cookbooks/transfer_remote_directories/files/default/transfer_directory_feature/baz.txt +1 -0
- data/features/data/cookbooks/transfer_remote_directories/files/default/transfer_directory_feature/foo.txt +1 -0
- data/features/data/cookbooks/transfer_remote_directories/recipes/transfer_directory.rb +29 -0
- data/features/data/cookbooks/transfer_remote_files/files/default/transfer_a_file_from_a_cookbook.txt +1 -0
- data/features/data/cookbooks/transfer_remote_files/metadata.json +30 -0
- data/features/data/cookbooks/transfer_remote_files/metadata.rb +1 -0
- data/features/data/cookbooks/transfer_remote_files/recipes/change_remote_file_perms_trickery.rb +33 -0
- data/features/data/cookbooks/transfer_remote_files/recipes/default.rb +18 -0
- data/features/data/cookbooks/transfer_remote_files/recipes/should_prefer_the_file_for_this_specific_host.rb +22 -0
- data/features/data/cookbooks/transfer_remote_files/recipes/transfer_a_file_from_a_cookbook.rb +22 -0
- data/features/data/cookbooks/transfer_remote_files/recipes/transfer_a_file_from_a_specific_cookbook.rb +20 -0
- data/features/data/cookbooks/transfer_remote_files/recipes/transfer_a_non-existent_file_from_a_cookbook.rb +22 -0
- data/features/data/cookbooks/transfer_remote_files_definition/definitions/transfer.rb +6 -0
- data/features/data/cookbooks/transfer_remote_files_definition/files/default/easy.txt +1 -0
- data/features/data/cookbooks/transfer_some_cookbook_files/files/default/should_be_transferred.txt +3 -0
- data/features/data/cookbooks/transfer_some_cookbook_files/files/default/should_not_be_transferred.txt +2 -0
- data/features/data/cookbooks/transfer_some_cookbook_files/recipes/default.rb +26 -0
- data/features/data/cookbooks/transfer_some_cookbook_files/templates/default/should_be_transferred.erb +2 -0
- data/features/data/cookbooks/transfer_some_cookbook_files/templates/default/should_not_be_transferred.erb +3 -0
- data/features/data/cookbooks/version_deps/metadata.rb +1 -0
- data/features/data/cookbooks/version_deps/recipes/default.rb +1 -0
- data/features/data/cookbooks/versions/metadata.rb +5 -0
- data/features/data/cookbooks/versions/recipes/default.rb +5 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_a_1.0.0/metadata.json +31 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_a_1.0.0/metadata.rb +8 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_a_1.0.0/recipes/default.rb +18 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_a_2.0.0/metadata.json +29 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_a_2.0.0/metadata.rb +6 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_a_2.0.0/recipes/default.rb +18 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_a_3.0.0/metadata.json +30 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_a_3.0.0/metadata.rb +7 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_a_3.0.0/recipes/default.rb +18 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_b_1.0.0/metadata.json +31 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_b_1.0.0/metadata.rb +8 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_b_1.0.0/recipes/default.rb +18 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_b_2.0.0/metadata.json +31 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_b_2.0.0/metadata.rb +8 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_b_2.0.0/recipes/default.rb +18 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_b_3.0.0/metadata.json +30 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_b_3.0.0/metadata.rb +7 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_b_3.0.0/recipes/default.rb +18 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_c_1.0.0/metadata.json +31 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_c_1.0.0/metadata.rb +8 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_c_1.0.0/recipes/default.rb +18 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_c_2.0.0/metadata.json +29 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_c_2.0.0/metadata.rb +6 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_c_2.0.0/recipes/default.rb +18 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_c_3.0.0/metadata.json +29 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_c_3.0.0/metadata.rb +6 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/dep_test_c_3.0.0/recipes/default.rb +18 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/test_cookbook/attributes/attr1.rb +1 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/test_cookbook/attributes/attr2.rb +1 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/test_cookbook/recipes/default.rb +2 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_invalid_empty_except_metadata/metadata.json +38 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_invalid_empty_except_metadata/metadata.rb +6 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_invalid_nometadata/attributes/attributes.rb +1 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_invalid_nometadata/recipes/default.rb +2 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid/attributes/attributes.rb +1 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid/metadata.json +38 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid/metadata.rb +6 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid/recipes/default.rb +2 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid_v0.1.0_with_different_dependencies/attributes/attributes.rb +1 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid_v0.1.0_with_different_dependencies/metadata.json +40 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid_v0.1.0_with_different_dependencies/metadata.rb +7 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid_v0.1.0_with_different_dependencies/recipes/default.rb +2 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid_v0.2.0/attributes/attributes.rb +1 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid_v0.2.0/metadata.json +38 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid_v0.2.0/metadata.rb +6 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_valid_v0.2.0/recipes/default.rb +2 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_wrong_metadata/metadata.json +40 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/testcookbook_wrong_metadata/recipes/default.rb +1 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.1.0/metadata.json +39 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.1.0/metadata.rb +6 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.1.0/recipes/default.rb +18 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.1.1/metadata.json +39 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.1.1/metadata.rb +6 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.1.1/recipes/default.rb +18 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.10.0/metadata.json +39 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.10.0/metadata.rb +6 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.10.0/recipes/default.rb +18 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.2.0/metadata.json +39 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.2.0/metadata.rb +6 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.2.0/recipes/default.rb +18 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.9.0/metadata.json +39 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.9.0/metadata.rb +6 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.9.0/recipes/default.rb +18 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.9.7/metadata.json +39 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.9.7/metadata.rb +6 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_test_0.9.7/recipes/default.rb +18 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_updated/attributes/attributes.rb +1 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_updated/metadata.json +29 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_updated/metadata.rb +6 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/version_updated/recipes/default.rb +2 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/versions/metadata.json +38 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/versions/metadata.rb +5 -0
- data/features/data/cookbooks_not_uploaded_at_feature_start/versions/recipes/default.rb +5 -0
- data/features/data/gems/Marshal.4.8 +0 -0
- data/features/data/gems/Marshal.4.8.Z +0 -0
- data/features/data/gems/latest_specs.4.8 +0 -0
- data/features/data/gems/latest_specs.4.8.gz +0 -0
- data/features/data/gems/prerelease_specs.4.8 +0 -0
- data/features/data/gems/prerelease_specs.4.8.gz +0 -0
- data/features/data/gems/quick/Marshal.4.8/chef-integration-test-0.1.0.gemspec.rz +0 -0
- data/features/data/gems/quick/Marshal.4.8/chef-integration-test-0.1.1.gemspec.rz +0 -0
- data/features/data/gems/quick/chef-integration-test-0.1.0.gemspec.rz +0 -0
- data/features/data/gems/quick/chef-integration-test-0.1.1.gemspec.rz +0 -0
- data/features/data/gems/quick/index +2 -0
- data/features/data/gems/quick/index.rz +0 -0
- data/features/data/gems/quick/latest_index +1 -0
- data/features/data/gems/quick/latest_index.rz +0 -0
- data/features/data/gems/specs.4.8 +0 -0
- data/features/data/gems/specs.4.8.gz +0 -0
- data/features/data/gems/yaml +122 -0
- data/features/data/gems/yaml.Z +0 -0
- data/features/data/json_attribs/attribute_settings.json +3 -0
- data/features/data/json_attribs/json_runlist_and_attrs.json +4 -0
- data/features/data/myapp.bundle +0 -0
- data/features/data/node-load-test.rb +84 -0
- data/features/data/node-simple.rb +18 -0
- data/features/data/repositories/chef-repo/.gitignore +2 -0
- data/features/data/repositories/chef-repo/README.md +66 -0
- data/features/data/repositories/chef-repo/Rakefile +65 -0
- data/features/data/repositories/chef-repo/certificates/README.md +19 -0
- data/features/data/repositories/chef-repo/config/rake.rb +38 -0
- data/features/data/repositories/chef-repo/cookbooks/README.md +53 -0
- data/features/data/repositories/chef-repo/data_bags/README.md +23 -0
- data/features/data/repositories/chef-repo/roles/README.md +16 -0
- data/features/data/repositories/cookbooks/hosts/attributes/hosts.rb +1 -0
- data/features/data/repositories/cookbooks/hosts/cc.gemspec +36 -0
- data/features/data/repositories/cookbooks/hosts/metadata.json +41 -0
- data/features/data/repositories/cookbooks/hosts/metadata.rb +4 -0
- data/features/data/repositories/cookbooks/hosts/recipes/default.rb +6 -0
- data/features/data/repositories/cookbooks/hosts/templates/default/hosts.erb +27 -0
- data/features/data/search-tests/do_knife_search_test.rb +175 -0
- data/features/data/search-tests/search-test-nodes.rb +174 -0
- data/features/data/test_git_repo.tar.gz +0 -0
- data/features/file_steps.feature +70 -0
- data/features/files.feature +30 -16
- data/features/ssh.feature +2 -1
- data/features/ssh_steps.feature +20 -0
- data/features/step_definitions/cuken_steps.rb +10 -0
- data/features/support/env.rb +1 -0
- data/lib/cuken/api/chef.rb +115 -0
- data/lib/cuken/api/chef/common.rb +80 -0
- data/lib/cuken/api/file.rb +23 -3
- data/lib/cuken/chef.rb +3 -0
- data/lib/cuken/common.rb +0 -1
- data/lib/cuken/cucumber/chef.rb +16 -0
- data/lib/cuken/cucumber/chef/common.rb +68 -0
- data/lib/cuken/cucumber/chef/cookbook.rb +75 -0
- data/lib/cuken/cucumber/chef/cookbook_steps.rb +406 -0
- data/lib/cuken/cucumber/chef/deploy_steps.rb +84 -0
- data/lib/cuken/cucumber/chef/done_directory_steps.rb +41 -0
- data/lib/cuken/cucumber/chef/done_file_steps.rb +107 -0
- data/lib/cuken/cucumber/chef/done_knife_steps.rb +34 -0
- data/lib/cuken/cucumber/chef/fixture_steps.rb +413 -0
- data/lib/cuken/cucumber/chef/knife.rb +34 -0
- data/lib/cuken/cucumber/chef/node.rb +27 -0
- data/lib/cuken/cucumber/chef/node_steps.rb +88 -0
- data/lib/cuken/cucumber/chef/packages.rb +144 -0
- data/lib/cuken/cucumber/chef/pending_steps.rb +21 -0
- data/lib/cuken/cucumber/chef/recipe_steps.rb +23 -0
- data/lib/cuken/cucumber/chef/request_steps.rb +98 -0
- data/lib/cuken/cucumber/chef/response_steps.rb +233 -0
- data/lib/cuken/cucumber/chef/result_steps.rb +15 -0
- data/lib/cuken/cucumber/chef/run_client_steps.rb +260 -0
- data/lib/cuken/cucumber/chef/run_solo.rb +78 -0
- data/lib/cuken/cucumber/chef/sandbox_steps.rb +137 -0
- data/lib/cuken/cucumber/chef/search_steps.rb +70 -0
- data/lib/cuken/cucumber/chef/webrat_steps.rb +39 -0
- data/lib/cuken/cucumber/cmd.rb +18 -1
- data/lib/cuken/cucumber/common.rb +4 -0
- data/lib/cuken/cucumber/file.rb +25 -27
- data/lib/cuken/cucumber/ssh.rb +6 -6
- metadata +427 -27
- data/LICENSE.txt +0 -20
@@ -0,0 +1,84 @@
|
|
1
|
+
require 'chef/shell_out'
|
2
|
+
|
3
|
+
|
4
|
+
# Given /^I have a clone of typo in the data\/tmp dir$/ do
|
5
|
+
# cmd = "git clone #{datadir}/typo.bundle #{tmpdir}/gitrepo/typo"
|
6
|
+
# `#{cmd}`
|
7
|
+
# end
|
8
|
+
def gem_installed?(gem_name, version)
|
9
|
+
cmd = "gem list -i #{gem_name} -v #{version}"
|
10
|
+
`#{cmd}`=~ /true/ ? true : false
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
Given /^I have a clone of the rails app in the data\/tmp dir$/ do
|
15
|
+
cmd = "git clone #{datadir}/myapp.bundle #{tmpdir}/gitrepo/myapp"
|
16
|
+
`#{cmd}`
|
17
|
+
end
|
18
|
+
|
19
|
+
Given /^that I have '(.*)' '(.*)' installed$/ do |gem_name, version|
|
20
|
+
unless gem_installed?(gem_name, version)
|
21
|
+
pending "This Cucumber feature will not execute, as #{gem_name} #{version} is not installed."
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
Given /^a test git repo in the temp directory$/ do
|
26
|
+
test_git_repo_tarball_filename = "#{datadir}/test_git_repo.tar.gz"
|
27
|
+
cmd = Chef::ShellOut.new("tar xzvf #{test_git_repo_tarball_filename} -C #{tmpdir}")
|
28
|
+
cmd.run_command.exitstatus.should == 0
|
29
|
+
end
|
30
|
+
|
31
|
+
Then /^I should hear about it$/ do
|
32
|
+
puts "==deploy:"
|
33
|
+
puts `ls #{tmpdir}/deploy/`
|
34
|
+
puts "==Releases:"
|
35
|
+
puts `ls #{tmpdir}/deploy/releases/`
|
36
|
+
puts "==Releases/*/"
|
37
|
+
puts `ls #{tmpdir}/deploy/releases/*/`
|
38
|
+
puts "==Releases/*/db"
|
39
|
+
puts `ls #{tmpdir}/deploy/releases/*/db/`
|
40
|
+
puts "==Releases/*/config/"
|
41
|
+
puts `ls #{tmpdir}/deploy/releases/*/config/`
|
42
|
+
puts "==current:"
|
43
|
+
puts `ls #{tmpdir}/deploy/current/`
|
44
|
+
puts "==current/db:"
|
45
|
+
puts `ls #{tmpdir}/deploy/current/db/`
|
46
|
+
puts "==current/deploy:"
|
47
|
+
puts `ls #{tmpdir}/deploy/current/deploy/`
|
48
|
+
puts "==current/app:"
|
49
|
+
puts `ls #{tmpdir}/deploy/current/app/`
|
50
|
+
puts "==current/config:"
|
51
|
+
puts `ls #{tmpdir}/deploy/current/config/`
|
52
|
+
puts "==shared/config/app_config.yml"
|
53
|
+
puts `ls #{tmpdir}/deploy/shared/config/`
|
54
|
+
end
|
55
|
+
|
56
|
+
Then /^there should be '(.*)' releases?$/ do |n|
|
57
|
+
numnums = {"one" => 1, "two" => 2, "three" => 3}
|
58
|
+
n = numnums.has_key?(n) ? numnums[n] : n.to_i
|
59
|
+
@releases = Dir.glob(tmpdir + "/deploy/releases/*")
|
60
|
+
@releases.size.should eql(n)
|
61
|
+
end
|
62
|
+
|
63
|
+
Then /^a callback named <callback_file> should exist$/ do |callback_files|
|
64
|
+
callback_files.raw.each do |file|
|
65
|
+
want_file = "deploy/current/deploy/#{file.first}"
|
66
|
+
Then "a file named '#{want_file}' should exist"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
Then /^the callback named <callback> should have run$/ do |callback_files|
|
71
|
+
callback_files.raw.each do |file|
|
72
|
+
hook_name = file.first.gsub(/\.rb$/, "")
|
73
|
+
evidence_file = "deploy/current/app/" + hook_name
|
74
|
+
expected_contents = {"hook_name" => hook_name, "env" => "production"}
|
75
|
+
actual_contents = Chef::JSONCompat.from_json(IO.read(File.join(tmpdir, evidence_file)))
|
76
|
+
expected_contents.should == actual_contents
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
Then /^the second chef run should have skipped deployment$/ do
|
81
|
+
expected_deploy = "#{tmpdir}/deploy/releases/62c9979f6694612d9659259f8a68d71048ae9a5b"
|
82
|
+
Then "'stdout' should not have 'INFO: Already deployed app at #{expected_deploy}. Rolling back to it - use action :force_deploy to re-checkout this revision.'"
|
83
|
+
end
|
84
|
+
|
@@ -0,0 +1,41 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Adam Jacob (<adam@opscode.com>)
|
3
|
+
# Copyright:: Copyright (c) 2008 Opscode, 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
|
+
|
19
|
+
#Then /^a directory named '(.+)' should exist$/ do |dir|
|
20
|
+
# File.directory?(File.join(tmpdir, dir)).should be(true)
|
21
|
+
#end
|
22
|
+
#
|
23
|
+
#Then /^a directory named '(.+)' should not exist$/ do |dir|
|
24
|
+
# File.directory?(File.join(tmpdir, dir)).should be(false)
|
25
|
+
#end
|
26
|
+
|
27
|
+
#Then /^the directory named '(.+)' should be owned by '(.+)'$/ do |dirname, owner|
|
28
|
+
# uid = Etc.getpwnam(owner).uid
|
29
|
+
# cstats = File.stat(File.join(tmpdir, dirname))
|
30
|
+
# cstats.uid.should == uid
|
31
|
+
#end
|
32
|
+
|
33
|
+
#Then /^the directory named '(.+)' should have octal mode '(.+)'$/ do |dirname, expected_mode|
|
34
|
+
# cstats = File.stat(File.join(tmpdir, dirname))
|
35
|
+
# (cstats.mode & 007777).should == expected_mode.oct
|
36
|
+
#end
|
37
|
+
|
38
|
+
#Then /^the directory named '(.+)' should have decimal mode '(.+)'$/ do |dirname, expected_mode|
|
39
|
+
# cstats = File.stat(File.join(tmpdir, dirname))
|
40
|
+
# (cstats.mode & 007777).should == expected_mode.to_i
|
41
|
+
#end
|
@@ -0,0 +1,107 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Adam Jacob (<adam@opscode.com>)
|
3
|
+
# Copyright:: Copyright (c) 2008 Opscode, 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
|
+
|
19
|
+
require 'etc'
|
20
|
+
|
21
|
+
###
|
22
|
+
# Given
|
23
|
+
###
|
24
|
+
|
25
|
+
#Given /^we have an empty file named '(.+)'$/ do |filename|
|
26
|
+
# filename = File.new(File.join(tmpdir, filename), 'w')
|
27
|
+
# filename.close
|
28
|
+
#end
|
29
|
+
|
30
|
+
#Given /^we have an empty file named '(.+)' in the client cache$/ do |filename|
|
31
|
+
# cache_dir = File.expand_path(File.join(File.dirname(__FILE__), "..", "data", "tmp", "cache"))
|
32
|
+
# filename = File.new(File.join(cache_dir, filename), 'w')
|
33
|
+
# filename.close
|
34
|
+
#end
|
35
|
+
|
36
|
+
#Given /^we have the atime\/mtime of '(.+)'$/ do |filename|
|
37
|
+
# @mtime = File.mtime(File.join(tmpdir, filename))
|
38
|
+
# @atime = File.atime(File.join(tmpdir, filename))
|
39
|
+
#end
|
40
|
+
|
41
|
+
####
|
42
|
+
# Then
|
43
|
+
####
|
44
|
+
|
45
|
+
#Then /^a file named '(.+)' should exist$/ do |filename|
|
46
|
+
# File.exists?(File.join(tmpdir, filename)).should be(true)
|
47
|
+
#end
|
48
|
+
|
49
|
+
#Then /^a file named '(.+)' should not exist$/ do |filename|
|
50
|
+
# File.exists?(File.join(tmpdir, filename)).should be(false)
|
51
|
+
#end
|
52
|
+
|
53
|
+
#currently using absolute path (specified in recipe execute_commands/recipes/umask.rb)
|
54
|
+
#Then /^'(.+)' should exist and raise error when copying$/ do |filename|
|
55
|
+
# File.exists?(filename).should be(true)
|
56
|
+
# lambda{copy(filename, filename + "_copy", false)}.should raise_error()
|
57
|
+
# File.delete(filename)
|
58
|
+
#end
|
59
|
+
|
60
|
+
|
61
|
+
#Then /^the (.)time of '(.+)' should be different$/ do |time_type, filename|
|
62
|
+
# case time_type
|
63
|
+
# when "m"
|
64
|
+
# current_mtime = File.mtime(File.join(tmpdir, filename))
|
65
|
+
# current_mtime.should_not == @mtime
|
66
|
+
# when "a"
|
67
|
+
# current_atime = File.atime(File.join(tmpdir, filename))
|
68
|
+
# current_atime.should_not == @atime
|
69
|
+
# end
|
70
|
+
#end
|
71
|
+
|
72
|
+
#Then /^a file named '(.+)' should contain '(.+)'$/ do |filename, contents|
|
73
|
+
# file = IO.read(File.join(tmpdir, filename))
|
74
|
+
# file.should =~ /#{contents}/m
|
75
|
+
#end
|
76
|
+
|
77
|
+
#Then /^a file named '(.+)' should be from the '(.+)' specific directory$/ do |filename, specificity|
|
78
|
+
# file = IO.read(File.join(tmpdir, filename))
|
79
|
+
# file.should == "#{specificity}\n"
|
80
|
+
#end
|
81
|
+
|
82
|
+
#Then /^a file named '(.+)' should contain '(.+)' only '(.+)' time$/ do |filename, string, count|
|
83
|
+
# seen_count = 0
|
84
|
+
# IO.foreach(File.join(tmpdir, filename)) do |line|
|
85
|
+
# if line =~ /#{string}/
|
86
|
+
# seen_count += 1
|
87
|
+
# end
|
88
|
+
# end
|
89
|
+
# seen_count.should == count.to_i
|
90
|
+
#end
|
91
|
+
#
|
92
|
+
#Then /^the file named '(.+)' should be owned by '(.+)'$/ do |filename, owner|
|
93
|
+
# uid = Etc.getpwnam(owner).uid
|
94
|
+
# cstats = File.stat(File.join(tmpdir, filename))
|
95
|
+
# cstats.uid.should == uid
|
96
|
+
#end
|
97
|
+
#
|
98
|
+
#Then /^the file named '(.+)' should have octal mode '(.+)'$/ do |filename, expected_mode|
|
99
|
+
# cstats = File.stat(File.join(tmpdir, filename))
|
100
|
+
# (cstats.mode & 007777).should == expected_mode.oct
|
101
|
+
#end
|
102
|
+
#
|
103
|
+
#Then /^the file named '(.+)' should have decimal mode '(.+)'$/ do |filename, expected_mode|
|
104
|
+
# cstats = File.stat(File.join(tmpdir, filename))
|
105
|
+
# (cstats.mode & 007777).should == expected_mode.to_i
|
106
|
+
#end
|
107
|
+
#
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#When "I upload the '$cookbook_name' cookbook with knife" do |cookbook_name|
|
2
|
+
# cookbook_fixture = File.join(FEATURES_DATA, "cookbooks_not_uploaded_at_feature_start", cookbook_name)
|
3
|
+
# cookbook_dir = ::Tempfile.open("knife-cuke-cookbook-dir").path
|
4
|
+
# FileUtils.rm(cookbook_dir)
|
5
|
+
# FileUtils.mkdir_p(cookbook_dir)
|
6
|
+
# FileUtils.cp_r(cookbook_fixture, cookbook_dir)
|
7
|
+
# shell_out!("#{KNIFE_CMD} cookbook upload #{cookbook_name} -o #{cookbook_dir} -c #{KNIFE_CONFIG}")
|
8
|
+
#end
|
9
|
+
#
|
10
|
+
#When "I run knife '$knife_subcommand'" do |knife_subcommand|
|
11
|
+
# @knife_command_result = shell_out("#{KNIFE_CMD} #{knife_subcommand} -c #{KNIFE_CONFIG}")
|
12
|
+
#end
|
13
|
+
#
|
14
|
+
#RSpec::Matchers.define :be_successful do
|
15
|
+
# match do |shell_out_result|
|
16
|
+
# shell_out_result.status.success?
|
17
|
+
# end
|
18
|
+
# failure_message_for_should do |shell_out_result|
|
19
|
+
# "Expected command #{shell_out_result.command} to exit successfully, but it exited with status #{shell_out_result.exitstatus}.\n"\
|
20
|
+
# "STDOUT OUTPUT:\n#{shell_out_result.stdout}\nSTDERR OUTPUT:\n#{shell_out_result.stderr}\n"
|
21
|
+
# end
|
22
|
+
# failure_message_for_should_not do |shell_out_result|
|
23
|
+
# "Expected command #{shell_out_result.command} to fail, but it exited with status #{shell_out_result.exitstatus}.\n"\
|
24
|
+
# "STDOUT OUTPUT:\n#{shell_out_result.stdout}\nSTDERR OUTPUT:\n#{shell_out_result.stderr}\n"
|
25
|
+
# end
|
26
|
+
# description do
|
27
|
+
# "The shell out command should exit 0"
|
28
|
+
# end
|
29
|
+
#end
|
30
|
+
#
|
31
|
+
#Then /^knife should succeed$/ do
|
32
|
+
# @knife_command_result.should be_successful
|
33
|
+
#end
|
34
|
+
#
|
@@ -0,0 +1,413 @@
|
|
1
|
+
|
2
|
+
require 'ostruct'
|
3
|
+
|
4
|
+
Before do
|
5
|
+
@fixtures = {
|
6
|
+
'client' => {
|
7
|
+
'isis' => Proc.new do
|
8
|
+
c = Chef::ApiClient.new
|
9
|
+
c.name "isis"
|
10
|
+
c.create_keys
|
11
|
+
c
|
12
|
+
end,
|
13
|
+
'isis_update' => {
|
14
|
+
'name' => 'isis',
|
15
|
+
'private_key' => true
|
16
|
+
},
|
17
|
+
'neurosis' => Proc.new do
|
18
|
+
c = Chef::ApiClient.new
|
19
|
+
c.name "neurosis"
|
20
|
+
c.create_keys
|
21
|
+
c
|
22
|
+
end,
|
23
|
+
'adminmonkey' => Proc.new do
|
24
|
+
c = Chef::ApiClient.new
|
25
|
+
c.name "adminmonkey"
|
26
|
+
c.admin true
|
27
|
+
c.create_keys
|
28
|
+
c
|
29
|
+
end
|
30
|
+
},
|
31
|
+
'sandbox' => {
|
32
|
+
# The filename part of these 'checksums' hashes isn't used by the API (the
|
33
|
+
# value side of that hash is ignored), and is here for documentation's sake.
|
34
|
+
'sandbox1' => {
|
35
|
+
:checksums => {
|
36
|
+
Chef::CookbookVersion.checksum_cookbook_file(File.join(datadir, "cookbooks_not_uploaded_at_feature_start", "test_cookbook", "recipes", "default.rb")) => nil
|
37
|
+
},
|
38
|
+
},
|
39
|
+
'sandbox2' => {
|
40
|
+
:checksums => {
|
41
|
+
Chef::CookbookVersion.checksum_cookbook_file(File.join(datadir, "cookbooks_not_uploaded_at_feature_start", "test_cookbook", "attributes", "attr1.rb")) => nil,
|
42
|
+
Chef::CookbookVersion.checksum_cookbook_file(File.join(datadir, "cookbooks_not_uploaded_at_feature_start", "test_cookbook", "attributes", "attr2.rb")) => nil
|
43
|
+
},
|
44
|
+
},
|
45
|
+
},
|
46
|
+
'sandbox_file' => {
|
47
|
+
"sandbox1_file1" => File.join(datadir, "cookbooks_not_uploaded_at_feature_start", "test_cookbook", "recipes", "default.rb"),
|
48
|
+
|
49
|
+
"sandbox2_file1" => File.join(datadir, "cookbooks_not_uploaded_at_feature_start", "test_cookbook", "attributes", "attr1.rb"),
|
50
|
+
"sandbox2_file2" => File.join(datadir, "cookbooks_not_uploaded_at_feature_start", "test_cookbook", "attributes", "attr2.rb"),
|
51
|
+
},
|
52
|
+
'signing_caller' =>{
|
53
|
+
:user_id=>'bobo', :secret_key => "/tmp/poop.pem"
|
54
|
+
},
|
55
|
+
'registration' => {
|
56
|
+
'bobo' => Proc.new do
|
57
|
+
OpenStruct.new({ :save => true })
|
58
|
+
end,
|
59
|
+
'not_admin' => Proc.new do
|
60
|
+
OpenStruct.new({ :save => true })
|
61
|
+
end
|
62
|
+
},
|
63
|
+
'data_bag' => {
|
64
|
+
'users' => Proc.new do
|
65
|
+
b = Chef::DataBag.new
|
66
|
+
b.name "users"
|
67
|
+
b
|
68
|
+
end,
|
69
|
+
'rubies' => Proc.new do
|
70
|
+
b = Chef::DataBag.new
|
71
|
+
b.name "rubies"
|
72
|
+
b
|
73
|
+
end
|
74
|
+
},
|
75
|
+
'data_bag_item' => {
|
76
|
+
'francis' => Proc.new do
|
77
|
+
i = Chef::DataBagItem.new
|
78
|
+
i.data_bag "users"
|
79
|
+
i.raw_data = { "id" => "francis" }
|
80
|
+
i
|
81
|
+
end,
|
82
|
+
'francis_extra' => Proc.new do
|
83
|
+
i = Chef::DataBagItem.new
|
84
|
+
i.data_bag "users"
|
85
|
+
i.raw_data = { "id" => "francis", "extra" => "majority" }
|
86
|
+
i
|
87
|
+
end,
|
88
|
+
'axl_rose' => Proc.new do
|
89
|
+
i = Chef::DataBagItem.new
|
90
|
+
i.data_bag "users"
|
91
|
+
i.raw_data = { "id" => "axl_rose" }
|
92
|
+
i
|
93
|
+
end
|
94
|
+
},
|
95
|
+
'role' => {
|
96
|
+
'webserver' => Proc.new do
|
97
|
+
r = Chef::Role.new
|
98
|
+
r.name "webserver"
|
99
|
+
r.description "monkey"
|
100
|
+
r.env_run_lists({"cucumber" => ["role[db]"], "_default" => []})
|
101
|
+
r.run_list("role[webserver]", "role[base]")
|
102
|
+
r.default_attributes({ 'a' => 'b' })
|
103
|
+
r.override_attributes({ 'c' => 'd' })
|
104
|
+
r
|
105
|
+
end,
|
106
|
+
'db' => Proc.new do
|
107
|
+
r = Chef::Role.new
|
108
|
+
r.name "db"
|
109
|
+
r.description "monkey"
|
110
|
+
r.recipes("role::db", "role::base")
|
111
|
+
r.default_attributes({ 'a' => 'bake' })
|
112
|
+
r.override_attributes({ 'c' => 'down' })
|
113
|
+
r
|
114
|
+
end,
|
115
|
+
'role_not_exist' => Proc.new do
|
116
|
+
r = Chef::Role.new
|
117
|
+
r.name 'role_not_exist'
|
118
|
+
r.description "Non-existent nested role"
|
119
|
+
r.run_list << "role[not_exist]"
|
120
|
+
r
|
121
|
+
end,
|
122
|
+
'attribute_settings_default' => Proc.new do
|
123
|
+
r = Chef::Role.new
|
124
|
+
r.name "attribute_settings_default"
|
125
|
+
r.description "sets a default value"
|
126
|
+
r.run_list("recipe[attribute_settings]")
|
127
|
+
r.default_attributes({ 'attribute_priority_was' => "came from role[attribute_settings_default] default attributes" })
|
128
|
+
r
|
129
|
+
end,
|
130
|
+
'attribute_settings_override' => Proc.new do
|
131
|
+
r = Chef::Role.new
|
132
|
+
r.name "attribute_settings_override"
|
133
|
+
r.description "sets a default value"
|
134
|
+
r.run_list("recipe[attribute_settings_override]")
|
135
|
+
r.override_attributes({ 'attribute_priority_was' => "came from role[attribute_settings_override] override attributes" })
|
136
|
+
r
|
137
|
+
end,
|
138
|
+
'role1_includes_role2' => Proc.new do
|
139
|
+
r = Chef::Role.new
|
140
|
+
r.name "role1_includes_role2"
|
141
|
+
r.description "role1 includes role2"
|
142
|
+
r.run_list("role[role2_included_by_role1]")
|
143
|
+
r
|
144
|
+
end,
|
145
|
+
'role2_included_by_role1' => Proc.new do
|
146
|
+
r = Chef::Role.new
|
147
|
+
r.name "role2_included_by_role1"
|
148
|
+
r.description "role2 is included by role1"
|
149
|
+
r.run_list("recipe[attribute_settings_override]")
|
150
|
+
r
|
151
|
+
end,
|
152
|
+
'role_test' => Proc.new do
|
153
|
+
r = Chef::Role.new
|
154
|
+
r.name "role_test"
|
155
|
+
r.description "A simple test role"
|
156
|
+
r.run_list("recipe[roles]")
|
157
|
+
r.default_attributes({
|
158
|
+
"reason" => "unbalancing",
|
159
|
+
"ossing" => "this time around"
|
160
|
+
})
|
161
|
+
r.override_attributes({
|
162
|
+
"ossining" => "whatever",
|
163
|
+
"snakes" => "on a plane"
|
164
|
+
})
|
165
|
+
r
|
166
|
+
end,
|
167
|
+
'role_env_test' => Proc.new do
|
168
|
+
r = Chef::Role.new
|
169
|
+
r.name "role_env_test"
|
170
|
+
r.description "A simple test role with environment specific run list"
|
171
|
+
r.env_run_lists({
|
172
|
+
"_default" => [],
|
173
|
+
"cucumber" => ['recipe[roles::env_test]']
|
174
|
+
})
|
175
|
+
r.default_attributes({
|
176
|
+
"reason" => "unbalancing",
|
177
|
+
"ossining" => "this time around"
|
178
|
+
})
|
179
|
+
r.override_attributes({
|
180
|
+
"ossining" => "whatever",
|
181
|
+
"snakes" => "on a plane"
|
182
|
+
})
|
183
|
+
r
|
184
|
+
end
|
185
|
+
},
|
186
|
+
'node' => {
|
187
|
+
'opsmaster' => Proc.new do
|
188
|
+
n = Chef::Node.new
|
189
|
+
n.name 'opsmaster'
|
190
|
+
n.chef_environment 'production'
|
191
|
+
n.snakes "on a plane"
|
192
|
+
n.zombie "we're not unreasonable, I mean no-ones gonna eat your eyes"
|
193
|
+
n
|
194
|
+
end,
|
195
|
+
'webserver' => Proc.new do
|
196
|
+
n = Chef::Node.new
|
197
|
+
n.name 'webserver'
|
198
|
+
n.run_list << "tacos"
|
199
|
+
n.snakes "on a plane"
|
200
|
+
n.zombie "we're not unreasonable, I mean no-ones gonna eat your eyes"
|
201
|
+
n
|
202
|
+
end,
|
203
|
+
'dbserver' => Proc.new do
|
204
|
+
n = Chef::Node.new
|
205
|
+
n.name 'dbserver'
|
206
|
+
n.run_list << "oracle"
|
207
|
+
n.just "kidding - who uses oracle?"
|
208
|
+
n
|
209
|
+
end,
|
210
|
+
'searchman' => Proc.new do
|
211
|
+
n = Chef::Node.new
|
212
|
+
n.name 'searchman'
|
213
|
+
n.run_list << "oracle"
|
214
|
+
n.default_attrs = { "one" => "two", "three" => "four" }
|
215
|
+
n.override_attrs = { "one" => "five" }
|
216
|
+
n.set["walking"] = "tall"
|
217
|
+
n
|
218
|
+
end,
|
219
|
+
'sync' => Proc.new do
|
220
|
+
n = Chef::Node.new
|
221
|
+
n.name 'sync'
|
222
|
+
n.run_list << "node_cookbook_sync"
|
223
|
+
n
|
224
|
+
end,
|
225
|
+
'role_not_exist' => Proc.new do
|
226
|
+
n = Chef::Node.new
|
227
|
+
n.name 'role_not_exist'
|
228
|
+
n.run_list << "role[not_exist]"
|
229
|
+
n
|
230
|
+
end,
|
231
|
+
'paradise' => Proc.new do
|
232
|
+
n = Chef::Node.new
|
233
|
+
n.name 'paradise'
|
234
|
+
n.run_list << "version_test"
|
235
|
+
n
|
236
|
+
end,
|
237
|
+
'has_environment' => Proc.new do
|
238
|
+
n = Chef::Node.new
|
239
|
+
n.name 'has_environment'
|
240
|
+
n.chef_environment 'cookbooks_test'
|
241
|
+
n.run_list << "version_test"
|
242
|
+
n
|
243
|
+
end,
|
244
|
+
'really_deep_node' => Proc.new do
|
245
|
+
array = []
|
246
|
+
hash = {}
|
247
|
+
max_levels = 50
|
248
|
+
|
249
|
+
max_levels.times do |num_level|
|
250
|
+
array = [num_level, "really_deep_string_in_array", array]
|
251
|
+
hash = {"really_deep_string_in_hash_#{num_level}" => hash}
|
252
|
+
num_level += 1
|
253
|
+
end
|
254
|
+
|
255
|
+
n = Chef::Node.new
|
256
|
+
n.name 'really_deep_node'
|
257
|
+
n.run_list << "deep_node_recipe"
|
258
|
+
n.deep_array = array
|
259
|
+
n.deep_hash = hash
|
260
|
+
n
|
261
|
+
end,
|
262
|
+
'empty' => Proc.new do
|
263
|
+
n = Chef::Node.new
|
264
|
+
n.name 'empty'
|
265
|
+
n
|
266
|
+
end
|
267
|
+
},
|
268
|
+
'hash' => {
|
269
|
+
'nothing' => Hash.new,
|
270
|
+
'name only' => { :name => 'test_cookbook' }
|
271
|
+
},
|
272
|
+
'environment' => {
|
273
|
+
'cucumber' => Proc.new do
|
274
|
+
e = Chef::Environment.new
|
275
|
+
e.name 'cucumber'
|
276
|
+
e.description 'I like to run tests'
|
277
|
+
e.attributes({"attribute_priority_was" => "came from environment cucumber"})
|
278
|
+
e
|
279
|
+
end,
|
280
|
+
'production' => Proc.new do
|
281
|
+
e = Chef::Environment.new
|
282
|
+
e.name 'production'
|
283
|
+
e.description 'The real deal'
|
284
|
+
e
|
285
|
+
end,
|
286
|
+
'skynet' => Proc.new do
|
287
|
+
e = Chef::Environment.new
|
288
|
+
e.name 'skynet'
|
289
|
+
e.description 'test cookbook version constraints'
|
290
|
+
e.cookbook 'version_test', '> 0.1.0'
|
291
|
+
e
|
292
|
+
end,
|
293
|
+
'chef-1607' => Proc.new do
|
294
|
+
e = Chef::Environment.new
|
295
|
+
e.name 'chef-1607'
|
296
|
+
e.description 'test cookbook version constraints'
|
297
|
+
e.cookbook 'version_test', '> 0.0.0'
|
298
|
+
e
|
299
|
+
end,
|
300
|
+
'cookbooks-0.1.0' => Proc.new do
|
301
|
+
e = Chef::Environment.new
|
302
|
+
e.name 'cookbooks_test'
|
303
|
+
e.description 'use cookbook version 0.1.0'
|
304
|
+
e.cookbook 'version_test', '= 0.1.0'
|
305
|
+
e
|
306
|
+
end,
|
307
|
+
'cookbooks-0.1.1' => Proc.new do
|
308
|
+
e = Chef::Environment.new
|
309
|
+
e.name 'cookbooks_test'
|
310
|
+
e.description 'use cookbook version 0.1.1'
|
311
|
+
e.cookbook 'version_test', '= 0.1.1'
|
312
|
+
e
|
313
|
+
end,
|
314
|
+
'cookbooks-0.2.0' => Proc.new do
|
315
|
+
e = Chef::Environment.new
|
316
|
+
e.name 'cookbooks_test'
|
317
|
+
e.description 'use cookbook version 0.2.0'
|
318
|
+
e.cookbook 'version_test', '= 0.2.0'
|
319
|
+
e
|
320
|
+
end
|
321
|
+
}
|
322
|
+
}
|
323
|
+
@stash = {}
|
324
|
+
end
|
325
|
+
|
326
|
+
def sign_request(http_method, path, private_key, user_id, body = "")
|
327
|
+
timestamp = Time.now.utc.iso8601
|
328
|
+
sign_obj = Mixlib::Auth::SignedHeaderAuth.signing_object(
|
329
|
+
:http_method=>http_method,
|
330
|
+
:path=>path,
|
331
|
+
:body=>body,
|
332
|
+
:user_id=>user_id,
|
333
|
+
:timestamp=>timestamp)
|
334
|
+
signed = sign_obj.sign(private_key).merge({:host => "localhost"})
|
335
|
+
signed.inject({}){|memo, kv| memo["#{kv[0].to_s.upcase}"] = kv[1];memo}
|
336
|
+
end
|
337
|
+
|
338
|
+
def get_fixture(stash_name, stash_key)
|
339
|
+
fixy = @fixtures[stash_name][stash_key]
|
340
|
+
if fixy.kind_of?(Proc)
|
341
|
+
fixy.call
|
342
|
+
else
|
343
|
+
fixy
|
344
|
+
end
|
345
|
+
end
|
346
|
+
|
347
|
+
Given "I am a non admin client" do
|
348
|
+
r = Chef::REST.new(Chef::Config[:registration_url], Chef::Config[:validation_client_name], Chef::Config[:validation_key])
|
349
|
+
r.register("not_admin", "#{tmpdir}/not_admin.pem")
|
350
|
+
c = Chef::ApiClient.cdb_load("not_admin")
|
351
|
+
c.cdb_save
|
352
|
+
@rest = Chef::REST.new(Chef::Config[:registration_url], 'not_admin', "#{tmpdir}/not_admin.pem")
|
353
|
+
end
|
354
|
+
|
355
|
+
Given /^an? '(.+)' named '(.+)'$/ do |stash_name, stash_key|
|
356
|
+
# BUGBUG: I need to reference fixtures individually, but the fixtures, as written, store under the type, not the fixture's identifier and I don't currently have time to re-write the tests
|
357
|
+
|
358
|
+
key = case stash_name
|
359
|
+
when 'file','hash'
|
360
|
+
stash_key
|
361
|
+
else
|
362
|
+
stash_name
|
363
|
+
end
|
364
|
+
@stash[key] = get_fixture(stash_name, stash_key)
|
365
|
+
end
|
366
|
+
|
367
|
+
Given "I am an administrator" do
|
368
|
+
make_admin
|
369
|
+
end
|
370
|
+
|
371
|
+
Given "I am a non-admin" do
|
372
|
+
make_non_admin
|
373
|
+
end
|
374
|
+
|
375
|
+
Given /^an? '(.+)' named '(.+)' exists$/ do |stash_name, stash_key|
|
376
|
+
call_as_admin do
|
377
|
+
@stash[stash_name] = get_fixture(stash_name, stash_key)
|
378
|
+
|
379
|
+
#if @stash[stash_name].respond_to?(:cdb_save)
|
380
|
+
# @stash[stash_name].cdb_save
|
381
|
+
if @stash[stash_name].respond_to?(:save)
|
382
|
+
@stash[stash_name].save
|
383
|
+
else
|
384
|
+
request_path = "/#{stash_name.pluralize}"
|
385
|
+
request(request_path, {
|
386
|
+
:method => "POST",
|
387
|
+
"HTTP_ACCEPT" => 'application/json',
|
388
|
+
"CONTENT_TYPE" => 'application/json',
|
389
|
+
:input => Chef::JSONCompat.to_json(@stash[stash_name])
|
390
|
+
}.merge(sign_request("POST", request_path, OpenSSL::PKey::RSA.new(IO.read("#{tmpdir}/client.pem")), "bobo")))
|
391
|
+
end
|
392
|
+
end
|
393
|
+
end
|
394
|
+
|
395
|
+
Given /^sending the method '(.+)' to the '(.+)' with '(.+)'/ do |method, stash_name, update_value|
|
396
|
+
update_value = Chef::JSONCompat.from_json(update_value) if update_value =~ /^\[|\{/
|
397
|
+
@stash[stash_name].send(method.to_sym, update_value)
|
398
|
+
end
|
399
|
+
|
400
|
+
Given /^changing the '(.+)' field '(.+)' to '(.+)'$/ do |stash_name, stash_key, stash_value|
|
401
|
+
@stash[stash_name].send(stash_key.to_sym, stash_value)
|
402
|
+
end
|
403
|
+
|
404
|
+
Given /^removing the '(.+)' field '(.+)'$/ do |stash_name, key|
|
405
|
+
@stash[stash_name].send(key.to_sym, '')
|
406
|
+
end
|
407
|
+
|
408
|
+
Given /^there are no (.+)$/ do |stash_name|
|
409
|
+
end
|
410
|
+
|
411
|
+
Given /^I wait for '(\d+)' seconds$/ do |time|
|
412
|
+
sleep time.to_i
|
413
|
+
end
|