chef 12.6.0-universal-mingw32 → 12.7.2-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +26 -19
- data/README.md +26 -23
- data/Rakefile +28 -17
- data/VERSION +1 -0
- data/acceptance/.gitignore +1 -0
- data/acceptance/.shared/kitchen_acceptance/.kitchen.digitalocean.yml +27 -0
- data/acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml +281 -0
- data/acceptance/.shared/kitchen_acceptance/.kitchen.vagrant.yml +49 -0
- data/acceptance/.shared/kitchen_acceptance/libraries/kitchen.rb +46 -0
- data/acceptance/.shared/kitchen_acceptance/metadata.rb +1 -0
- data/acceptance/Gemfile +11 -0
- data/acceptance/README.md +86 -0
- data/acceptance/basics/.acceptance/acceptance-cookbook/.gitignore +2 -0
- data/acceptance/basics/.acceptance/acceptance-cookbook/metadata.rb +3 -0
- data/acceptance/basics/.acceptance/acceptance-cookbook/recipes/destroy.rb +1 -0
- data/acceptance/basics/.acceptance/acceptance-cookbook/recipes/provision.rb +1 -0
- data/acceptance/basics/.acceptance/acceptance-cookbook/recipes/verify.rb +1 -0
- data/acceptance/basics/.kitchen.yml +4 -0
- data/acceptance/basics/test/integration/chef-current-install/serverspec/chef_client_spec.rb +19 -0
- data/acceptance/basics/test/integration/chef-current-install/serverspec/spec_helper.rb +6 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/.gitignore +2 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/cookbook_kitchen.rb +43 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/top_cookbooks.rb +21 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/metadata.rb +3 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/destroy.rb +1 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/provision.rb +1 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/verify.rb +1 -0
- data/acceptance/top-cookbooks/.gitignore +1 -0
- data/acceptance/top-cookbooks/.kitchen.git.yml +10 -0
- data/acceptance/top-cookbooks/.kitchen.learn-the-basics-rhel.yml +4 -0
- data/acceptance/top-cookbooks/.kitchen.learn-the-basics-ubuntu.yml +4 -0
- data/acceptance/top-cookbooks/.kitchen.learn-the-basics-windows.yml +4 -0
- data/acceptance/trivial/.acceptance/acceptance-cookbook/.gitignore +2 -0
- data/acceptance/trivial/.acceptance/acceptance-cookbook/metadata.rb +2 -0
- data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/destroy.rb +1 -0
- data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/provision.rb +1 -0
- data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/verify.rb +1 -0
- data/acceptance/trivial/.kitchen.yml +7 -0
- data/acceptance/trivial/test/integration/chef-current-install/inspec/chef_client_spec.rb +5 -0
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/.gitignore +2 -0
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/metadata.rb +2 -0
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/destroy.rb +1 -0
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/provision.rb +1 -0
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/verify.rb +1 -0
- data/acceptance/windows-service/.kitchen.yml +7 -0
- data/acceptance/windows-service/test/integration/chef-windows-service/inspec/chef_windows_service_spec.rb +58 -0
- data/bin/chef-apply +3 -3
- data/bin/chef-client +5 -5
- data/bin/chef-service-manager +7 -7
- data/bin/chef-shell +1 -1
- data/bin/chef-solo +4 -4
- data/bin/chef-windows-service +5 -5
- data/bin/knife +4 -5
- data/chef-windows.gemspec +5 -2
- data/chef.gemspec +13 -13
- data/distro/common/html/_static/basic.css +1 -1
- data/distro/common/html/_static/doctools.js +1 -1
- data/distro/common/html/_static/searchtools.js +1 -1
- data/distro/common/html/_static/websupport.js +1 -1
- data/ext/win32-eventlog/Rakefile +13 -14
- data/lib-backcompat/chef/chef_fs/file_system/acl_entry.rb +5 -0
- data/lib-backcompat/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb +5 -0
- data/lib-backcompat/chef/chef_fs/file_system/chef_server_root_dir.rb +5 -0
- data/lib/chef.rb +17 -17
- data/lib/chef/api_client.rb +31 -30
- data/lib/chef/api_client/registration.rb +34 -10
- data/lib/chef/api_client_v1.rb +36 -36
- data/lib/chef/application.rb +32 -23
- data/lib/chef/application/apply.rb +20 -20
- data/lib/chef/application/client.rb +63 -43
- data/lib/chef/application/knife.rb +21 -15
- data/lib/chef/application/solo.rb +52 -41
- data/lib/chef/application/windows_service.rb +25 -25
- data/lib/chef/application/windows_service_manager.rb +22 -22
- data/lib/chef/applications.rb +4 -4
- data/lib/chef/audit/audit_event_proxy.rb +3 -3
- data/lib/chef/audit/audit_reporter.rb +8 -10
- data/lib/chef/audit/control_group_data.rb +9 -10
- data/lib/chef/audit/logger.rb +3 -3
- data/lib/chef/audit/rspec_formatter.rb +2 -2
- data/lib/chef/audit/runner.rb +15 -14
- data/lib/chef/chef_class.rb +10 -7
- data/lib/chef/chef_fs.rb +51 -1
- data/lib/chef/chef_fs/chef_fs_data_store.rb +320 -125
- data/lib/chef/chef_fs/command_line.rb +8 -8
- data/lib/chef/chef_fs/config.rb +52 -23
- data/lib/chef/chef_fs/data_handler/acl_data_handler.rb +10 -10
- data/lib/chef/chef_fs/data_handler/client_data_handler.rb +12 -12
- data/lib/chef/chef_fs/data_handler/container_data_handler.rb +6 -6
- data/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb +15 -15
- data/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb +11 -11
- data/lib/chef/chef_fs/data_handler/data_handler_base.rb +8 -8
- data/lib/chef/chef_fs/data_handler/environment_data_handler.rb +14 -14
- data/lib/chef/chef_fs/data_handler/group_data_handler.rb +18 -18
- data/lib/chef/chef_fs/data_handler/node_data_handler.rb +14 -14
- data/lib/chef/chef_fs/data_handler/organization_data_handler.rb +9 -9
- data/lib/chef/chef_fs/data_handler/organization_invites_data_handler.rb +2 -2
- data/lib/chef/chef_fs/data_handler/organization_members_data_handler.rb +2 -2
- data/lib/chef/chef_fs/data_handler/policy_data_handler.rb +30 -3
- data/lib/chef/chef_fs/data_handler/policy_group_data_handler.rb +27 -0
- data/lib/chef/chef_fs/data_handler/role_data_handler.rb +16 -16
- data/lib/chef/chef_fs/data_handler/user_data_handler.rb +12 -12
- data/lib/chef/chef_fs/file_pattern.rb +25 -25
- data/lib/chef/chef_fs/file_system.rb +10 -10
- data/lib/chef/chef_fs/file_system/already_exists_error.rb +3 -6
- data/lib/chef/chef_fs/file_system/base_fs_dir.rb +4 -4
- data/lib/chef/chef_fs/file_system/base_fs_object.rb +8 -8
- data/lib/chef/chef_fs/file_system/chef_server/acl_dir.rb +65 -0
- data/lib/chef/chef_fs/file_system/chef_server/acl_entry.rb +60 -0
- data/lib/chef/chef_fs/file_system/chef_server/acls_dir.rb +75 -0
- data/lib/chef/chef_fs/file_system/chef_server/chef_server_root_dir.rb +196 -0
- data/lib/chef/chef_fs/file_system/{chef_repository_file_system_acls_dir.rb → chef_server/cookbook_artifact_dir.rb} +13 -12
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_artifacts_dir.rb +102 -0
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb +222 -0
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_file.rb +84 -0
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_subdir.rb +61 -0
- data/lib/chef/chef_fs/file_system/chef_server/cookbooks_acl_dir.rb +42 -0
- data/lib/chef/chef_fs/file_system/chef_server/cookbooks_dir.rb +102 -0
- data/lib/chef/chef_fs/file_system/chef_server/data_bag_dir.rb +71 -0
- data/lib/chef/chef_fs/file_system/chef_server/data_bags_dir.rb +69 -0
- data/lib/chef/chef_fs/file_system/chef_server/environments_dir.rb +57 -0
- data/lib/chef/chef_fs/file_system/chef_server/nodes_dir.rb +53 -0
- data/lib/chef/chef_fs/file_system/chef_server/org_entry.rb +31 -0
- data/lib/chef/chef_fs/file_system/chef_server/organization_invites_entry.rb +61 -0
- data/lib/chef/chef_fs/file_system/chef_server/organization_members_entry.rb +60 -0
- data/lib/chef/chef_fs/file_system/chef_server/policies_acl_dir.rb +41 -0
- data/lib/chef/chef_fs/file_system/chef_server/policies_dir.rb +160 -0
- data/lib/chef/chef_fs/file_system/chef_server/policy_group_entry.rb +137 -0
- data/lib/chef/chef_fs/file_system/chef_server/policy_groups_dir.rb +43 -0
- data/lib/chef/chef_fs/file_system/chef_server/policy_revision_entry.rb +34 -0
- data/lib/chef/chef_fs/file_system/chef_server/rest_list_dir.rb +178 -0
- data/lib/chef/chef_fs/file_system/chef_server/rest_list_entry.rb +187 -0
- data/lib/chef/chef_fs/file_system/chef_server/versioned_cookbook_dir.rb +45 -0
- data/lib/chef/chef_fs/file_system/chef_server/versioned_cookbooks_dir.rb +107 -0
- data/lib/chef/chef_fs/file_system/cookbook_frozen_error.rb +3 -6
- data/lib/chef/chef_fs/file_system/default_environment_cannot_be_modified_error.rb +3 -7
- data/lib/chef/chef_fs/file_system/file_system_error.rb +14 -3
- data/lib/chef/chef_fs/file_system/memory/memory_dir.rb +53 -0
- data/lib/chef/chef_fs/file_system/memory/memory_file.rb +20 -0
- data/lib/chef/chef_fs/file_system/memory/memory_root.rb +23 -0
- data/lib/chef/chef_fs/file_system/multiplexed_dir.rb +2 -2
- data/lib/chef/chef_fs/file_system/must_delete_recursively_error.rb +3 -6
- data/lib/chef/chef_fs/file_system/nonexistent_fs_object.rb +4 -4
- data/lib/chef/chef_fs/file_system/not_found_error.rb +3 -6
- data/lib/chef/chef_fs/file_system/operation_failed_error.rb +5 -5
- data/lib/chef/chef_fs/file_system/operation_not_allowed_error.rb +16 -18
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_acls_dir.rb +39 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_artifact_dir.rb +41 -0
- data/lib/chef/chef_fs/file_system/{chef_repository_file_system_policies_dir.rb → repository/chef_repository_file_system_cookbook_artifacts_dir.rb} +9 -13
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_dir.rb +95 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb +82 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbooks_dir.rb +84 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_data_bags_dir.rb +38 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_entry.rb +83 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_policies_dir.rb +38 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb +210 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_versioned_cookbook_dir.rb +42 -0
- data/lib/chef/chef_fs/file_system/{chef_repository_file_system_data_bags_dir.rb → repository/chef_repository_file_system_versioned_cookbooks_dir.rb} +9 -11
- data/lib/chef/chef_fs/file_system/repository/file_system_entry.rb +117 -0
- data/lib/chef/chef_fs/file_system/{file_system_root_dir.rb → repository/file_system_root_dir.rb} +8 -6
- data/lib/chef/chef_fs/knife.rb +16 -16
- data/lib/chef/chef_fs/parallelizer.rb +3 -3
- data/lib/chef/chef_fs/parallelizer/flatten_enumerable.rb +1 -1
- data/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb +3 -3
- data/lib/chef/chef_fs/path_utils.rb +11 -10
- data/lib/chef/client.rb +80 -71
- data/lib/chef/config.rb +10 -10
- data/lib/chef/config_fetcher.rb +12 -4
- data/lib/chef/constants.rb +2 -1
- data/lib/chef/cookbook/chefignore.rb +4 -5
- data/lib/chef/cookbook/cookbook_collection.rb +6 -6
- data/lib/chef/cookbook/cookbook_version_loader.rb +15 -15
- data/lib/chef/cookbook/file_system_file_vendor.rb +4 -4
- data/lib/chef/cookbook/file_vendor.rb +3 -4
- data/lib/chef/cookbook/metadata.rb +108 -107
- data/lib/chef/cookbook/remote_file_vendor.rb +7 -7
- data/lib/chef/cookbook/synchronizer.rb +11 -10
- data/lib/chef/cookbook/syntax_check.rb +14 -14
- data/lib/chef/cookbook_loader.rb +14 -14
- data/lib/chef/cookbook_manifest.rb +16 -15
- data/lib/chef/cookbook_site_streaming_uploader.rb +22 -22
- data/lib/chef/cookbook_uploader.rb +22 -21
- data/lib/chef/cookbook_version.rb +87 -87
- data/lib/chef/daemon.rb +6 -6
- data/lib/chef/data_bag.rb +32 -26
- data/lib/chef/data_bag_item.rb +43 -40
- data/lib/chef/delayed_evaluator.rb +1 -1
- data/lib/chef/deprecation/mixin/template.rb +4 -4
- data/lib/chef/deprecation/provider/cookbook_file.rb +2 -3
- data/lib/chef/deprecation/provider/file.rb +10 -10
- data/lib/chef/deprecation/provider/remote_directory.rb +5 -5
- data/lib/chef/deprecation/provider/remote_file.rb +3 -3
- data/lib/chef/deprecation/provider/template.rb +3 -3
- data/lib/chef/deprecation/warnings.rb +2 -2
- data/lib/chef/digester.rb +6 -6
- data/lib/chef/dsl.rb +6 -6
- data/lib/chef/dsl/audit.rb +4 -4
- data/lib/chef/dsl/chef_provisioning.rb +5 -5
- data/lib/chef/dsl/cheffish.rb +5 -5
- data/lib/chef/dsl/data_query.rb +10 -10
- data/lib/chef/dsl/declare_resource.rb +8 -8
- data/lib/chef/dsl/definitions.rb +1 -2
- data/lib/chef/dsl/include_attribute.rb +4 -6
- data/lib/chef/dsl/include_recipe.rb +4 -4
- data/lib/chef/dsl/platform_introspection.rb +8 -14
- data/lib/chef/dsl/powershell.rb +3 -3
- data/lib/chef/dsl/reboot_pending.rb +12 -13
- data/lib/chef/dsl/recipe.rb +20 -20
- data/lib/chef/dsl/registry_helper.rb +7 -3
- data/lib/chef/dsl/resources.rb +6 -5
- data/lib/chef/encrypted_data_bag_item.rb +10 -10
- data/lib/chef/encrypted_data_bag_item/assertions.rb +4 -4
- data/lib/chef/encrypted_data_bag_item/check_encrypted.rb +3 -3
- data/lib/chef/encrypted_data_bag_item/decryption_failure.rb +2 -2
- data/lib/chef/encrypted_data_bag_item/decryptor.rb +16 -14
- data/lib/chef/encrypted_data_bag_item/encrypted_data_bag_item_assertions.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/encryption_failure.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/encryptor.rb +20 -20
- data/lib/chef/encrypted_data_bag_item/unacceptable_encrypted_data_bag_item_format.rb +2 -2
- data/lib/chef/encrypted_data_bag_item/unsupported_cipher.rb +2 -2
- data/lib/chef/encrypted_data_bag_item/unsupported_encrypted_data_bag_item_format.rb +2 -2
- data/lib/chef/environment.rb +41 -34
- data/lib/chef/event_dispatch/base.rb +2 -2
- data/lib/chef/event_dispatch/dispatcher.rb +2 -2
- data/lib/chef/event_dispatch/dsl.rb +6 -5
- data/lib/chef/event_loggers/base.rb +3 -3
- data/lib/chef/event_loggers/windows_eventlog.rb +11 -11
- data/lib/chef/exceptions.rb +23 -34
- data/lib/chef/file_access_control.rb +6 -6
- data/lib/chef/file_access_control/unix.rb +5 -5
- data/lib/chef/file_access_control/windows.rb +5 -5
- data/lib/chef/file_cache.rb +21 -21
- data/lib/chef/file_content_management/content_base.rb +2 -2
- data/lib/chef/file_content_management/deploy.rb +5 -6
- data/lib/chef/file_content_management/deploy/cp.rb +2 -2
- data/lib/chef/file_content_management/deploy/mv_unix.rb +2 -3
- data/lib/chef/file_content_management/deploy/mv_windows.rb +4 -6
- data/lib/chef/file_content_management/tempfile.rb +3 -3
- data/lib/chef/formatters/base.rb +8 -9
- data/lib/chef/formatters/doc.rb +7 -7
- data/lib/chef/formatters/error_descriptor.rb +5 -5
- data/lib/chef/formatters/error_inspectors.rb +5 -5
- data/lib/chef/formatters/error_inspectors/api_error_formatting.rb +50 -15
- data/lib/chef/formatters/error_inspectors/compile_error_inspector.rb +11 -11
- data/lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb +8 -8
- data/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb +8 -6
- data/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb +14 -13
- data/lib/chef/formatters/error_inspectors/registration_error_inspector.rb +19 -17
- data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +8 -11
- data/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb +15 -14
- data/lib/chef/formatters/error_mapper.rb +2 -2
- data/lib/chef/formatters/indentable_output_stream.rb +5 -5
- data/lib/chef/formatters/minimal.rb +7 -9
- data/lib/chef/guard_interpreter.rb +3 -3
- data/lib/chef/guard_interpreter/default_guard_interpreter.rb +3 -4
- data/lib/chef/guard_interpreter/resource_guard_interpreter.rb +9 -9
- data/lib/chef/handler.rb +4 -4
- data/lib/chef/handler/error_report.rb +4 -4
- data/lib/chef/handler/json_file.rb +5 -5
- data/lib/chef/http.rb +32 -35
- data/lib/chef/http/auth_credentials.rb +12 -12
- data/lib/chef/http/authenticator.rb +17 -12
- data/lib/chef/http/basic_client.rb +20 -20
- data/lib/chef/http/cookie_jar.rb +7 -7
- data/lib/chef/http/cookie_manager.rb +8 -8
- data/lib/chef/http/decompressor.rb +7 -9
- data/lib/chef/http/http_request.rb +31 -32
- data/lib/chef/http/json_input.rb +9 -9
- data/lib/chef/http/json_output.rb +9 -9
- data/lib/chef/http/json_to_model_output.rb +4 -4
- data/lib/chef/http/remote_request_id.rb +6 -6
- data/lib/chef/http/simple.rb +23 -5
- data/lib/chef/http/simple_json.rb +43 -0
- data/lib/chef/http/socketless_chef_zero_client.rb +56 -57
- data/lib/chef/http/ssl_policies.rb +9 -9
- data/lib/chef/http/validate_content_length.rb +12 -12
- data/lib/chef/json_compat.rb +6 -6
- data/lib/chef/key.rb +44 -42
- data/lib/chef/knife.rb +47 -44
- data/lib/chef/knife/bootstrap.rb +32 -32
- data/lib/chef/knife/bootstrap/chef_vault_handler.rb +16 -23
- data/lib/chef/knife/bootstrap/client_builder.rb +15 -13
- data/lib/chef/knife/bootstrap/templates/chef-full.erb +1 -1
- data/lib/chef/knife/client_bulk_delete.rb +5 -5
- data/lib/chef/knife/client_create.rb +5 -5
- data/lib/chef/knife/client_delete.rb +6 -6
- data/lib/chef/knife/client_edit.rb +5 -5
- data/lib/chef/knife/client_key_create.rb +6 -6
- data/lib/chef/knife/client_key_delete.rb +6 -6
- data/lib/chef/knife/client_key_edit.rb +8 -9
- data/lib/chef/knife/client_key_list.rb +5 -5
- data/lib/chef/knife/client_key_show.rb +5 -5
- data/lib/chef/knife/client_list.rb +5 -5
- data/lib/chef/knife/client_reregister.rb +5 -5
- data/lib/chef/knife/client_show.rb +5 -5
- data/lib/chef/knife/configure.rb +14 -14
- data/lib/chef/knife/configure_client.rb +6 -6
- data/lib/chef/knife/cookbook_bulk_delete.rb +9 -10
- data/lib/chef/knife/cookbook_create.rb +12 -12
- data/lib/chef/knife/cookbook_delete.rb +10 -10
- data/lib/chef/knife/cookbook_download.rb +8 -10
- data/lib/chef/knife/cookbook_list.rb +5 -5
- data/lib/chef/knife/cookbook_metadata.rb +8 -8
- data/lib/chef/knife/cookbook_metadata_from_file.rb +5 -5
- data/lib/chef/knife/cookbook_show.rb +14 -18
- data/lib/chef/knife/cookbook_site_download.rb +22 -22
- data/lib/chef/knife/cookbook_site_install.rb +10 -10
- data/lib/chef/knife/cookbook_site_list.rb +6 -10
- data/lib/chef/knife/cookbook_site_search.rb +5 -10
- data/lib/chef/knife/cookbook_site_share.rb +17 -18
- data/lib/chef/knife/cookbook_site_show.rb +7 -12
- data/lib/chef/knife/cookbook_site_unshare.rb +6 -6
- data/lib/chef/knife/cookbook_site_vendor.rb +5 -5
- data/lib/chef/knife/cookbook_test.rb +6 -7
- data/lib/chef/knife/cookbook_upload.rb +19 -20
- data/lib/chef/knife/core/bootstrap_context.rb +25 -21
- data/lib/chef/knife/core/cookbook_scm_repo.rb +11 -12
- data/lib/chef/knife/core/custom_manifest_loader.rb +2 -2
- data/lib/chef/knife/core/gem_glob_loader.rb +11 -11
- data/lib/chef/knife/core/generic_presenter.rb +33 -34
- data/lib/chef/knife/core/hashed_command_loader.rb +6 -6
- data/lib/chef/knife/core/node_editor.rb +59 -38
- data/lib/chef/knife/core/node_presenter.rb +13 -14
- data/lib/chef/knife/core/object_loader.rb +9 -9
- data/lib/chef/knife/core/status_presenter.rb +17 -17
- data/lib/chef/knife/core/subcommand_loader.rb +19 -20
- data/lib/chef/knife/core/text_formatter.rb +13 -14
- data/lib/chef/knife/core/ui.rb +17 -18
- data/lib/chef/knife/data_bag_create.rb +11 -10
- data/lib/chef/knife/data_bag_delete.rb +6 -8
- data/lib/chef/knife/data_bag_edit.rb +8 -11
- data/lib/chef/knife/data_bag_from_file.rb +12 -11
- data/lib/chef/knife/data_bag_list.rb +4 -8
- data/lib/chef/knife/data_bag_secret_options.rb +6 -6
- data/lib/chef/knife/data_bag_show.rb +31 -31
- data/lib/chef/knife/delete.rb +6 -7
- data/lib/chef/knife/deps.rb +18 -18
- data/lib/chef/knife/diff.rb +8 -9
- data/lib/chef/knife/download.rb +11 -12
- data/lib/chef/knife/edit.rb +5 -6
- data/lib/chef/knife/environment_compare.rb +23 -23
- data/lib/chef/knife/environment_create.rb +5 -5
- data/lib/chef/knife/environment_delete.rb +5 -5
- data/lib/chef/knife/environment_edit.rb +5 -5
- data/lib/chef/knife/environment_from_file.rb +4 -5
- data/lib/chef/knife/environment_list.rb +5 -5
- data/lib/chef/knife/environment_show.rb +5 -5
- data/lib/chef/knife/exec.rb +7 -7
- data/lib/chef/knife/help.rb +7 -9
- data/lib/chef/knife/index_rebuild.rb +4 -5
- data/lib/chef/knife/key_create.rb +5 -5
- data/lib/chef/knife/key_create_base.rb +1 -1
- data/lib/chef/knife/key_delete.rb +2 -2
- data/lib/chef/knife/key_edit.rb +5 -5
- data/lib/chef/knife/key_edit_base.rb +1 -1
- data/lib/chef/knife/key_list.rb +12 -12
- data/lib/chef/knife/key_list_base.rb +1 -1
- data/lib/chef/knife/key_show.rb +4 -4
- data/lib/chef/knife/list.rb +14 -13
- data/lib/chef/knife/node_bulk_delete.rb +6 -12
- data/lib/chef/knife/node_create.rb +5 -8
- data/lib/chef/knife/node_delete.rb +5 -6
- data/lib/chef/knife/node_edit.rb +6 -8
- data/lib/chef/knife/node_environment_set.rb +4 -4
- data/lib/chef/knife/node_from_file.rb +10 -10
- data/lib/chef/knife/node_list.rb +5 -7
- data/lib/chef/knife/node_run_list_add.rb +8 -8
- data/lib/chef/knife/node_run_list_remove.rb +8 -8
- data/lib/chef/knife/node_run_list_set.rb +6 -6
- data/lib/chef/knife/node_show.rb +6 -7
- data/lib/chef/knife/osc_user_create.rb +5 -5
- data/lib/chef/knife/osc_user_delete.rb +5 -5
- data/lib/chef/knife/osc_user_edit.rb +5 -5
- data/lib/chef/knife/osc_user_list.rb +5 -5
- data/lib/chef/knife/osc_user_reregister.rb +5 -5
- data/lib/chef/knife/osc_user_show.rb +5 -5
- data/lib/chef/knife/raw.rb +18 -17
- data/lib/chef/knife/recipe_list.rb +4 -4
- data/lib/chef/knife/rehash.rb +9 -9
- data/lib/chef/knife/role_bulk_delete.rb +5 -10
- data/lib/chef/knife/role_create.rb +5 -7
- data/lib/chef/knife/role_delete.rb +5 -6
- data/lib/chef/knife/role_edit.rb +5 -8
- data/lib/chef/knife/role_env_run_list_add.rb +9 -9
- data/lib/chef/knife/role_env_run_list_clear.rb +4 -4
- data/lib/chef/knife/role_env_run_list_remove.rb +13 -13
- data/lib/chef/knife/role_env_run_list_replace.rb +6 -6
- data/lib/chef/knife/role_env_run_list_set.rb +6 -6
- data/lib/chef/knife/role_from_file.rb +6 -11
- data/lib/chef/knife/role_list.rb +5 -6
- data/lib/chef/knife/role_run_list_add.rb +9 -9
- data/lib/chef/knife/role_run_list_clear.rb +4 -4
- data/lib/chef/knife/role_run_list_remove.rb +13 -13
- data/lib/chef/knife/role_run_list_replace.rb +6 -6
- data/lib/chef/knife/role_run_list_set.rb +6 -6
- data/lib/chef/knife/role_show.rb +5 -8
- data/lib/chef/knife/search.rb +11 -11
- data/lib/chef/knife/serve.rb +10 -10
- data/lib/chef/knife/show.rb +4 -4
- data/lib/chef/knife/ssh.rb +34 -34
- data/lib/chef/knife/ssl_check.rb +12 -11
- data/lib/chef/knife/ssl_fetch.rb +13 -15
- data/lib/chef/knife/status.rb +10 -10
- data/lib/chef/knife/tag_create.rb +5 -5
- data/lib/chef/knife/tag_delete.rb +5 -5
- data/lib/chef/knife/tag_list.rb +5 -5
- data/lib/chef/knife/upload.rb +10 -11
- data/lib/chef/knife/user_create.rb +6 -8
- data/lib/chef/knife/user_delete.rb +6 -7
- data/lib/chef/knife/user_edit.rb +6 -7
- data/lib/chef/knife/user_key_create.rb +7 -7
- data/lib/chef/knife/user_key_delete.rb +6 -6
- data/lib/chef/knife/user_key_edit.rb +8 -9
- data/lib/chef/knife/user_key_list.rb +5 -5
- data/lib/chef/knife/user_key_show.rb +5 -5
- data/lib/chef/knife/user_list.rb +5 -5
- data/lib/chef/knife/user_reregister.rb +6 -7
- data/lib/chef/knife/user_show.rb +6 -6
- data/lib/chef/knife/xargs.rb +22 -23
- data/lib/chef/local_mode.rb +13 -11
- data/lib/chef/log.rb +10 -10
- data/lib/chef/log/syslog.rb +5 -6
- data/lib/chef/log/winevt.rb +12 -12
- data/lib/chef/mash.rb +6 -5
- data/lib/chef/mixin/api_version_request_handling.rb +1 -1
- data/lib/chef/mixin/checksum.rb +4 -4
- data/lib/chef/mixin/command.rb +13 -13
- data/lib/chef/mixin/command/unix.rb +7 -7
- data/lib/chef/mixin/command/windows.rb +6 -7
- data/lib/chef/mixin/convert_to_class_name.rb +11 -11
- data/lib/chef/mixin/create_path.rb +3 -3
- data/lib/chef/mixin/deep_merge.rb +3 -3
- data/lib/chef/mixin/deprecation.rb +24 -25
- data/lib/chef/mixin/descendants_tracker.rb +2 -3
- data/lib/chef/mixin/enforce_ownership_and_permissions.rb +3 -3
- data/lib/chef/mixin/file_class.rb +9 -11
- data/lib/chef/mixin/from_file.rb +3 -3
- data/lib/chef/mixin/get_source_from_package.rb +2 -3
- data/lib/chef/mixin/homebrew_user.rb +6 -6
- data/lib/chef/mixin/language.rb +5 -5
- data/lib/chef/mixin/language_include_attribute.rb +4 -5
- data/lib/chef/mixin/language_include_recipe.rb +4 -5
- data/lib/chef/mixin/params_validate.rb +38 -18
- data/lib/chef/mixin/path_sanity.rb +7 -7
- data/lib/chef/mixin/powershell_out.rb +5 -5
- data/lib/chef/mixin/powershell_type_coercions.rb +12 -10
- data/lib/chef/mixin/properties.rb +8 -8
- data/lib/chef/mixin/provides.rb +2 -2
- data/lib/chef/mixin/proxified_socket.rb +4 -4
- data/lib/chef/mixin/recipe_definition_dsl_core.rb +4 -4
- data/lib/chef/mixin/securable.rb +24 -27
- data/lib/chef/mixin/shell_out.rb +10 -10
- data/lib/chef/mixin/subclass_directive.rb +2 -2
- data/lib/chef/mixin/template.rb +8 -9
- data/lib/chef/mixin/unformatter.rb +1 -1
- data/lib/chef/mixin/uris.rb +2 -3
- data/lib/chef/mixin/which.rb +3 -3
- data/lib/chef/mixin/why_run.rb +6 -7
- data/lib/chef/mixin/wide_string.rb +7 -7
- data/lib/chef/mixin/windows_architecture_helper.rb +9 -10
- data/lib/chef/mixin/windows_env_helper.rb +10 -11
- data/lib/chef/mixin/xml_escape.rb +13 -13
- data/lib/chef/mixins.rb +13 -14
- data/lib/chef/monkey_patches/net-ssh-multi.rb +6 -6
- data/lib/chef/monkey_patches/net_http.rb +2 -2
- data/lib/chef/monkey_patches/webrick-utils.rb +6 -6
- data/lib/chef/monkey_patches/win32/registry.rb +6 -6
- data/lib/chef/monologger.rb +2 -4
- data/lib/chef/node.rb +66 -60
- data/lib/chef/node/attribute.rb +289 -289
- data/lib/chef/node/attribute_collections.rb +8 -8
- data/lib/chef/node/immutable_collections.rb +3 -3
- data/lib/chef/node_map.rb +11 -11
- data/lib/chef/null_logger.rb +3 -3
- data/lib/chef/org.rb +31 -30
- data/lib/chef/platform.rb +4 -4
- data/lib/chef/platform/handler_map.rb +2 -2
- data/lib/chef/platform/priority_map.rb +2 -2
- data/lib/chef/platform/provider_handler_map.rb +3 -3
- data/lib/chef/platform/provider_mapping.rb +33 -33
- data/lib/chef/platform/provider_priority_map.rb +2 -2
- data/lib/chef/platform/query_helpers.rb +10 -11
- data/lib/chef/platform/rebooter.rb +11 -11
- data/lib/chef/platform/resource_handler_map.rb +3 -3
- data/lib/chef/platform/resource_priority_map.rb +2 -2
- data/lib/chef/platform/service_helpers.rb +5 -5
- data/lib/chef/policy_builder.rb +5 -5
- data/lib/chef/policy_builder/dynamic.rb +10 -11
- data/lib/chef/policy_builder/expand_node_object.rb +24 -19
- data/lib/chef/policy_builder/policyfile.rb +13 -14
- data/lib/chef/property.rb +115 -49
- data/lib/chef/provider.rb +43 -43
- data/lib/chef/provider/apt_update.rb +79 -0
- data/lib/chef/provider/batch.rb +6 -6
- data/lib/chef/provider/breakpoint.rb +1 -1
- data/lib/chef/provider/cookbook_file.rb +5 -5
- data/lib/chef/provider/cookbook_file/content.rb +4 -4
- data/lib/chef/provider/cron.rb +8 -8
- data/lib/chef/provider/cron/aix.rb +1 -1
- data/lib/chef/provider/cron/solaris.rb +1 -1
- data/lib/chef/provider/cron/unix.rb +7 -7
- data/lib/chef/provider/deploy.rb +7 -8
- data/lib/chef/provider/deploy/revision.rb +9 -9
- data/lib/chef/provider/deploy/timestamped.rb +1 -1
- data/lib/chef/provider/directory.rb +8 -8
- data/lib/chef/provider/dsc_resource.rb +33 -27
- data/lib/chef/provider/dsc_script.rb +17 -17
- data/lib/chef/provider/env.rb +8 -8
- data/lib/chef/provider/env/windows.rb +3 -3
- data/lib/chef/provider/erl_call.rb +5 -5
- data/lib/chef/provider/execute.rb +8 -8
- data/lib/chef/provider/file.rb +24 -24
- data/lib/chef/provider/file/content.rb +4 -4
- data/lib/chef/provider/git.rb +33 -35
- data/lib/chef/provider/group.rb +7 -7
- data/lib/chef/provider/group/aix.rb +6 -6
- data/lib/chef/provider/group/dscl.rb +11 -11
- data/lib/chef/provider/group/gpasswd.rb +3 -3
- data/lib/chef/provider/group/groupadd.rb +8 -8
- data/lib/chef/provider/group/groupmod.rb +3 -3
- data/lib/chef/provider/group/pw.rb +2 -2
- data/lib/chef/provider/group/suse.rb +5 -5
- data/lib/chef/provider/group/usermod.rb +8 -8
- data/lib/chef/provider/group/windows.rb +5 -5
- data/lib/chef/provider/http_request.rb +15 -15
- data/lib/chef/provider/ifconfig.rb +15 -14
- data/lib/chef/provider/ifconfig/aix.rb +5 -4
- data/lib/chef/provider/ifconfig/debian.rb +6 -6
- data/lib/chef/provider/ifconfig/redhat.rb +3 -3
- data/lib/chef/provider/link.rb +13 -13
- data/lib/chef/provider/log.rb +1 -1
- data/lib/chef/provider/lwrp_base.rb +8 -8
- data/lib/chef/provider/mdadm.rb +4 -4
- data/lib/chef/provider/mount.rb +13 -13
- data/lib/chef/provider/mount/aix.rb +14 -14
- data/lib/chef/provider/mount/mount.rb +18 -18
- data/lib/chef/provider/mount/solaris.rb +30 -30
- data/lib/chef/provider/mount/windows.rb +4 -4
- data/lib/chef/provider/ohai.rb +2 -2
- data/lib/chef/provider/osx_profile.rb +256 -0
- data/lib/chef/provider/package.rb +19 -19
- data/lib/chef/provider/package/aix.rb +8 -9
- data/lib/chef/provider/package/apt.rb +12 -12
- data/lib/chef/provider/package/chocolatey.rb +277 -0
- data/lib/chef/provider/package/dpkg.rb +7 -7
- data/lib/chef/provider/package/easy_install.rb +14 -15
- data/lib/chef/provider/package/freebsd/base.rb +7 -7
- data/lib/chef/provider/package/freebsd/pkg.rb +8 -8
- data/lib/chef/provider/package/freebsd/pkgng.rb +6 -6
- data/lib/chef/provider/package/freebsd/port.rb +4 -4
- data/lib/chef/provider/package/homebrew.rb +16 -16
- data/lib/chef/provider/package/ips.rb +8 -8
- data/lib/chef/provider/package/macports.rb +1 -0
- data/lib/chef/provider/package/openbsd.rb +13 -13
- data/lib/chef/provider/package/pacman.rb +6 -9
- data/lib/chef/provider/package/paludis.rb +7 -10
- data/lib/chef/provider/package/portage.rb +10 -13
- data/lib/chef/provider/package/rpm.rb +7 -8
- data/lib/chef/provider/package/rubygems.rb +64 -64
- data/lib/chef/provider/package/smartos.rb +7 -10
- data/lib/chef/provider/package/solaris.rb +6 -11
- data/lib/chef/provider/package/windows.rb +38 -29
- data/lib/chef/provider/package/windows/exe.rb +9 -21
- data/lib/chef/provider/package/windows/msi.rb +12 -12
- data/lib/chef/provider/package/windows/registry_uninstall_entry.rb +7 -7
- data/lib/chef/provider/package/yum-dump.py +1 -1
- data/lib/chef/provider/package/yum.rb +43 -44
- data/lib/chef/provider/package/zypper.rb +57 -47
- data/lib/chef/provider/powershell_script.rb +14 -14
- data/lib/chef/provider/reboot.rb +5 -5
- data/lib/chef/provider/registry_key.rb +16 -16
- data/lib/chef/provider/remote_directory.rb +15 -15
- data/lib/chef/provider/remote_file.rb +5 -5
- data/lib/chef/provider/remote_file/cache_control_data.rb +11 -12
- data/lib/chef/provider/remote_file/content.rb +11 -11
- data/lib/chef/provider/remote_file/fetcher.rb +2 -2
- data/lib/chef/provider/remote_file/ftp.rb +11 -11
- data/lib/chef/provider/remote_file/http.rb +9 -9
- data/lib/chef/provider/remote_file/local_file.rb +5 -5
- data/lib/chef/provider/remote_file/network_file.rb +4 -4
- data/lib/chef/provider/route.rb +188 -188
- data/lib/chef/provider/ruby_block.rb +3 -3
- data/lib/chef/provider/script.rb +5 -5
- data/lib/chef/provider/service.rb +30 -30
- data/lib/chef/provider/service/aix.rb +4 -4
- data/lib/chef/provider/service/aixinit.rb +12 -12
- data/lib/chef/provider/service/arch.rb +5 -5
- data/lib/chef/provider/service/debian.rb +12 -13
- data/lib/chef/provider/service/freebsd.rb +7 -7
- data/lib/chef/provider/service/gentoo.rb +5 -5
- data/lib/chef/provider/service/init.rb +4 -4
- data/lib/chef/provider/service/insserv.rb +4 -4
- data/lib/chef/provider/service/invokercd.rb +3 -3
- data/lib/chef/provider/service/macosx.rb +19 -19
- data/lib/chef/provider/service/openbsd.rb +14 -14
- data/lib/chef/provider/service/redhat.rb +6 -6
- data/lib/chef/provider/service/simple.rb +10 -9
- data/lib/chef/provider/service/solaris.rb +8 -8
- data/lib/chef/provider/service/systemd.rb +4 -4
- data/lib/chef/provider/service/upstart.rb +8 -8
- data/lib/chef/provider/service/windows.rb +32 -78
- data/lib/chef/provider/subversion.rb +13 -13
- data/lib/chef/provider/template.rb +7 -7
- data/lib/chef/provider/template/content.rb +4 -4
- data/lib/chef/provider/template_finder.rb +2 -1
- data/lib/chef/provider/user.rb +9 -10
- data/lib/chef/provider/user/aix.rb +4 -3
- data/lib/chef/provider/user/dscl.rb +39 -40
- data/lib/chef/provider/user/pw.rb +9 -9
- data/lib/chef/provider/user/solaris.rb +9 -9
- data/lib/chef/provider/user/useradd.rb +9 -9
- data/lib/chef/provider/user/windows.rb +13 -13
- data/lib/chef/provider/whyrun_safe_ruby_block.rb +1 -1
- data/lib/chef/provider/windows_script.rb +5 -5
- data/lib/chef/provider_resolver.rb +3 -3
- data/lib/chef/providers.rb +113 -110
- data/lib/chef/recipe.rb +13 -14
- data/lib/chef/request_id.rb +4 -4
- data/lib/chef/resource.rb +103 -93
- data/lib/chef/resource/action_class.rb +3 -3
- data/lib/chef/resource/apt_package.rb +6 -17
- data/lib/chef/{shell/shell_rest.rb → resource/apt_update.rb} +14 -9
- data/lib/chef/resource/bash.rb +5 -5
- data/lib/chef/resource/batch.rb +4 -4
- data/lib/chef/resource/bff_package.rb +3 -3
- data/lib/chef/resource/breakpoint.rb +3 -4
- data/lib/chef/resource/chef_gem.rb +9 -25
- data/lib/chef/resource/chocolatey_package.rb +39 -0
- data/lib/chef/resource/conditional.rb +8 -8
- data/lib/chef/resource/conditional_action_not_nothing.rb +1 -1
- data/lib/chef/resource/cookbook_file.rb +10 -10
- data/lib/chef/resource/cron.rb +33 -33
- data/lib/chef/resource/csh.rb +5 -5
- data/lib/chef/resource/deploy.rb +76 -76
- data/lib/chef/resource/deploy_revision.rb +1 -1
- data/lib/chef/resource/directory.rb +12 -12
- data/lib/chef/resource/dpkg_package.rb +5 -6
- data/lib/chef/resource/dsc_resource.rb +121 -120
- data/lib/chef/resource/dsc_script.rb +25 -25
- data/lib/chef/resource/easy_install_package.rb +6 -25
- data/lib/chef/resource/env.rb +9 -9
- data/lib/chef/resource/erl_call.rb +15 -15
- data/lib/chef/resource/execute.rb +28 -28
- data/lib/chef/resource/file.rb +20 -87
- data/lib/chef/resource/file/verification.rb +11 -11
- data/lib/chef/resource/freebsd_package.rb +10 -9
- data/lib/chef/resource/gem_package.rb +8 -23
- data/lib/chef/resource/git.rb +4 -4
- data/lib/chef/resource/group.rb +18 -19
- data/lib/chef/resource/homebrew_package.rb +7 -18
- data/lib/chef/resource/http_request.rb +12 -12
- data/lib/chef/resource/ifconfig.rb +28 -28
- data/lib/chef/resource/ips_package.rb +5 -16
- data/lib/chef/resource/ksh.rb +3 -3
- data/lib/chef/resource/link.rb +18 -17
- data/lib/chef/resource/log.rb +9 -9
- data/lib/chef/resource/lwrp_base.rb +10 -10
- data/lib/chef/resource/macosx_service.rb +7 -7
- data/lib/chef/resource/macports_package.rb +3 -2
- data/lib/chef/resource/mdadm.rb +18 -19
- data/lib/chef/resource/mount.rb +34 -34
- data/lib/chef/resource/ohai.rb +7 -7
- data/lib/chef/resource/openbsd_package.rb +7 -6
- data/lib/chef/resource/osx_profile.rb +74 -0
- data/lib/chef/resource/package.rb +15 -69
- data/lib/chef/resource/pacman_package.rb +3 -2
- data/lib/chef/resource/paludis_package.rb +5 -7
- data/lib/chef/resource/perl.rb +5 -5
- data/lib/chef/resource/portage_package.rb +5 -4
- data/lib/chef/resource/powershell_script.rb +7 -7
- data/lib/chef/resource/python.rb +5 -5
- data/lib/chef/resource/reboot.rb +6 -6
- data/lib/chef/resource/registry_key.rb +15 -15
- data/lib/chef/resource/remote_directory.rb +23 -24
- data/lib/chef/resource/remote_file.rb +21 -21
- data/lib/chef/resource/resource_notification.rb +2 -2
- data/lib/chef/resource/route.rb +26 -26
- data/lib/chef/resource/rpm_package.rb +5 -15
- data/lib/chef/resource/ruby.rb +5 -5
- data/lib/chef/resource/ruby_block.rb +8 -8
- data/lib/chef/resource/scm.rb +36 -37
- data/lib/chef/resource/script.rb +13 -13
- data/lib/chef/resource/service.rb +32 -32
- data/lib/chef/resource/smartos_package.rb +4 -3
- data/lib/chef/resource/solaris_package.rb +4 -3
- data/lib/chef/resource/subversion.rb +6 -6
- data/lib/chef/resource/template.rb +19 -19
- data/lib/chef/resource/timestamped_deploy.rb +1 -1
- data/lib/chef/resource/user.rb +31 -31
- data/lib/chef/resource/whyrun_safe_ruby_block.rb +1 -1
- data/lib/chef/resource/windows_package.rb +21 -66
- data/lib/chef/resource/windows_script.rb +8 -8
- data/lib/chef/resource/windows_service.rb +9 -9
- data/lib/chef/resource/yum_package.rb +18 -42
- data/lib/chef/resource/zypper_package.rb +3 -2
- data/lib/chef/resource_builder.rb +4 -4
- data/lib/chef/resource_collection.rb +11 -11
- data/lib/chef/resource_collection/resource_collection_serialization.rb +5 -5
- data/lib/chef/resource_collection/resource_list.rb +6 -6
- data/lib/chef/resource_collection/resource_set.rb +6 -6
- data/lib/chef/resource_collection/stepable_iterator.rb +4 -4
- data/lib/chef/resource_definition.rb +7 -7
- data/lib/chef/resource_definition_list.rb +5 -5
- data/lib/chef/resource_reporter.rb +14 -15
- data/lib/chef/resource_resolver.rb +4 -5
- data/lib/chef/resources.rb +71 -68
- data/lib/chef/rest.rb +23 -23
- data/lib/chef/role.rb +49 -43
- data/lib/chef/run_context.rb +21 -23
- data/lib/chef/run_context/cookbook_compiler.rb +10 -13
- data/lib/chef/run_list.rb +17 -17
- data/lib/chef/run_list/run_list_expansion.rb +22 -26
- data/lib/chef/run_list/run_list_item.rb +8 -9
- data/lib/chef/run_list/versioned_recipe_list.rb +13 -13
- data/lib/chef/run_lock.rb +12 -12
- data/lib/chef/run_status.rb +3 -3
- data/lib/chef/runner.rb +11 -12
- data/lib/chef/scan_access_control.rb +7 -7
- data/lib/chef/search/query.rb +30 -16
- data/lib/chef/server_api.rb +42 -10
- data/lib/chef/shell.rb +24 -25
- data/lib/chef/shell/ext.rb +31 -31
- data/lib/chef/shell/model_wrapper.rb +7 -8
- data/lib/chef/shell/shell_session.rb +20 -19
- data/lib/chef/shell_out.rb +2 -2
- data/lib/chef/tasks/chef_repo.rake +62 -63
- data/lib/chef/user.rb +38 -37
- data/lib/chef/user_v1.rb +53 -58
- data/lib/chef/util/backup.rb +6 -6
- data/lib/chef/util/diff.rb +8 -8
- data/lib/chef/util/dsc/configuration_generator.rb +11 -11
- data/lib/chef/util/dsc/lcm_output_parser.rb +8 -8
- data/lib/chef/util/dsc/local_configuration_manager.rb +9 -9
- data/lib/chef/util/dsc/resource_info.rb +15 -15
- data/lib/chef/util/dsc/resource_store.rb +73 -74
- data/lib/chef/util/editor.rb +1 -2
- data/lib/chef/util/file_edit.rb +5 -5
- data/lib/chef/util/path_helper.rb +2 -2
- data/lib/chef/util/powershell/cmdlet.rb +119 -119
- data/lib/chef/util/powershell/cmdlet_result.rb +36 -36
- data/lib/chef/util/powershell/ps_credential.rb +2 -2
- data/lib/chef/util/selinux.rb +6 -6
- data/lib/chef/util/threaded_job_queue.rb +2 -2
- data/lib/chef/util/windows.rb +1 -1
- data/lib/chef/util/windows/net_group.rb +84 -85
- data/lib/chef/util/windows/net_use.rb +6 -6
- data/lib/chef/util/windows/net_user.rb +9 -8
- data/lib/chef/util/windows/volume.rb +3 -3
- data/lib/chef/version.rb +2 -2
- data/lib/chef/version/platform.rb +5 -5
- data/lib/chef/version_class.rb +6 -6
- data/lib/chef/version_constraint.rb +13 -13
- data/lib/chef/version_constraint/platform.rb +3 -3
- data/lib/chef/whitelist.rb +2 -2
- data/lib/chef/win32/api.rb +13 -8
- data/lib/chef/win32/api/crypto.rb +63 -63
- data/lib/chef/win32/api/error.rb +11 -10
- data/lib/chef/win32/api/file.rb +17 -16
- data/lib/chef/win32/api/installer.rb +15 -16
- data/lib/chef/win32/api/memory.rb +4 -4
- data/lib/chef/win32/api/net.rb +111 -123
- data/lib/chef/win32/api/process.rb +4 -4
- data/lib/chef/win32/api/psapi.rb +4 -4
- data/lib/chef/win32/api/registry.rb +4 -4
- data/lib/chef/win32/api/security.rb +51 -26
- data/lib/chef/win32/api/synchronization.rb +4 -4
- data/lib/chef/win32/api/system.rb +4 -4
- data/lib/chef/win32/api/unicode.rb +4 -4
- data/lib/chef/win32/crypto.rb +50 -50
- data/lib/chef/win32/error.rb +18 -15
- data/lib/chef/win32/eventlog.rb +2 -2
- data/lib/chef/win32/file.rb +14 -14
- data/lib/chef/win32/file/info.rb +3 -4
- data/lib/chef/win32/file/version_info.rb +4 -4
- data/lib/chef/win32/handle.rb +6 -6
- data/lib/chef/win32/memory.rb +4 -4
- data/lib/chef/win32/mutex.rb +4 -4
- data/lib/chef/win32/net.rb +26 -59
- data/lib/chef/win32/process.rb +7 -7
- data/lib/chef/win32/registry.rb +19 -33
- data/lib/chef/win32/security.rb +82 -20
- data/lib/chef/win32/security/ace.rb +6 -6
- data/lib/chef/win32/security/acl.rb +8 -8
- data/lib/chef/win32/security/securable_object.rb +5 -5
- data/lib/chef/win32/security/security_descriptor.rb +5 -5
- data/lib/chef/win32/security/sid.rb +81 -43
- data/lib/chef/win32/security/token.rb +6 -6
- data/lib/chef/win32/system.rb +4 -4
- data/lib/chef/win32/unicode.rb +7 -7
- data/lib/chef/win32/version.rb +26 -26
- data/lib/chef/workstation_config_loader.rb +2 -2
- data/spec/data/apt/chef-integration-test-1.0/debian/copyright +2 -2
- data/spec/data/apt/chef-integration-test-1.1/debian/copyright +2 -2
- data/spec/data/apt/chef-integration-test2-1.0/debian/copyright +2 -2
- data/spec/data/cookbooks/name-mismatch-versionnumber/recipes/default.rb +1 -1
- data/spec/data/cookbooks/supports-platform-constraints/metadata.rb +5 -0
- data/spec/data/incomplete-metadata-chef-repo/incomplete-metadata/recipes/default.rb +1 -1
- data/spec/data/invalid-metadata-chef-repo/invalid-metadata/metadata.rb +1 -2
- data/spec/data/invalid-metadata-chef-repo/invalid-metadata/recipes/default.rb +1 -1
- data/spec/functional/application_spec.rb +7 -7
- data/spec/functional/assets/chocolatey_feed/test-A.1.0.nupkg +0 -0
- data/spec/functional/assets/chocolatey_feed/test-A.1.5.nupkg +0 -0
- data/spec/functional/assets/chocolatey_feed/test-A.2.0.nupkg +0 -0
- data/spec/functional/assets/chocolatey_feed/test-B.1.0.nupkg +0 -0
- data/spec/functional/audit/rspec_formatter_spec.rb +8 -8
- data/spec/functional/audit/runner_spec.rb +9 -9
- data/spec/functional/dsl/reboot_pending_spec.rb +10 -15
- data/spec/functional/dsl/registry_helper_spec.rb +8 -10
- data/spec/functional/event_loggers/windows_eventlog_spec.rb +27 -22
- data/spec/functional/file_content_management/deploy_strategies_spec.rb +9 -10
- data/spec/functional/http/simple_spec.rb +11 -11
- data/spec/functional/knife/configure_spec.rb +5 -10
- data/spec/functional/knife/cookbook_delete_spec.rb +11 -11
- data/spec/functional/knife/exec_spec.rb +6 -6
- data/spec/functional/knife/smoke_test.rb +11 -3
- data/spec/functional/knife/ssh_spec.rb +22 -22
- data/spec/functional/mixin/powershell_out_spec.rb +3 -3
- data/spec/functional/mixin/shell_out_spec.rb +12 -12
- data/spec/functional/notifications_spec.rb +6 -7
- data/spec/functional/provider/remote_file/cache_control_data_spec.rb +11 -12
- data/spec/functional/provider/whyrun_safe_ruby_block_spec.rb +4 -4
- data/spec/functional/rebooter_spec.rb +12 -12
- data/spec/functional/resource/aix_service_spec.rb +7 -8
- data/spec/functional/resource/aixinit_service_spec.rb +20 -20
- data/spec/functional/resource/base.rb +1 -3
- data/spec/functional/resource/bash_spec.rb +6 -6
- data/spec/functional/resource/batch_spec.rb +5 -5
- data/spec/functional/resource/bff_spec.rb +10 -12
- data/spec/functional/resource/chocolatey_package_spec.rb +124 -0
- data/spec/functional/resource/cookbook_file_spec.rb +9 -9
- data/spec/functional/resource/cron_spec.rb +13 -13
- data/spec/functional/resource/deploy_revision_spec.rb +18 -18
- data/spec/functional/resource/directory_spec.rb +4 -4
- data/spec/functional/resource/dpkg_package_spec.rb +38 -38
- data/spec/functional/resource/dsc_resource_spec.rb +17 -22
- data/spec/functional/resource/dsc_script_spec.rb +104 -106
- data/spec/functional/resource/env_spec.rb +30 -30
- data/spec/functional/resource/execute_spec.rb +10 -10
- data/spec/functional/resource/file_spec.rb +12 -13
- data/spec/functional/resource/git_spec.rb +20 -20
- data/spec/functional/resource/group_spec.rb +21 -21
- data/spec/functional/resource/ifconfig_spec.rb +11 -11
- data/spec/functional/resource/link_spec.rb +140 -135
- data/spec/functional/resource/mount_spec.rb +17 -29
- data/spec/functional/resource/ohai_spec.rb +5 -8
- data/spec/functional/resource/package_spec.rb +11 -13
- data/spec/functional/resource/powershell_script_spec.rb +60 -60
- data/spec/functional/resource/reboot_spec.rb +12 -12
- data/spec/functional/resource/registry_spec.rb +71 -72
- data/spec/functional/resource/remote_directory_spec.rb +23 -23
- data/spec/functional/resource/remote_file_spec.rb +17 -17
- data/spec/functional/resource/rpm_spec.rb +14 -14
- data/spec/functional/resource/template_spec.rb +8 -8
- data/spec/functional/resource/user/dscl_spec.rb +3 -3
- data/spec/functional/resource/user/useradd_spec.rb +31 -37
- data/spec/functional/resource/user/windows_spec.rb +20 -20
- data/spec/functional/resource/windows_package_spec.rb +26 -35
- data/spec/functional/resource/windows_service_spec.rb +12 -8
- data/spec/functional/rest_spec.rb +6 -5
- data/spec/functional/run_lock_spec.rb +15 -14
- data/spec/functional/shell_spec.rb +11 -10
- data/spec/functional/tiny_server_spec.rb +18 -18
- data/spec/functional/util/path_helper_spec.rb +5 -5
- data/spec/functional/util/powershell/cmdlet_spec.rb +24 -27
- data/spec/functional/version_spec.rb +6 -6
- data/spec/functional/win32/crypto_spec.rb +7 -10
- data/spec/functional/win32/registry_spec.rb +105 -107
- data/spec/functional/win32/security_spec.rb +17 -17
- data/spec/functional/win32/service_manager_spec.rb +7 -8
- data/spec/functional/win32/sid_spec.rb +13 -13
- data/spec/functional/win32/version_info_spec.rb +7 -7
- data/spec/functional/win32/versions_spec.rb +13 -13
- data/spec/integration/client/client_spec.rb +65 -66
- data/spec/integration/client/ipv6_spec.rb +15 -16
- data/spec/integration/knife/chef_fs_data_store_spec.rb +432 -246
- data/spec/integration/knife/chef_repo_path_spec.rb +261 -261
- data/spec/integration/knife/chef_repository_file_system_spec.rb +84 -84
- data/spec/integration/knife/chefignore_spec.rb +82 -82
- data/spec/integration/knife/common_options_spec.rb +41 -41
- data/spec/integration/knife/cookbook_api_ipv6_spec.rb +9 -9
- data/spec/integration/knife/delete_spec.rb +262 -248
- data/spec/integration/knife/deps_spec.rb +301 -301
- data/spec/integration/knife/diff_spec.rb +237 -237
- data/spec/integration/knife/download_spec.rb +532 -401
- data/spec/integration/knife/list_spec.rb +310 -116
- data/spec/integration/knife/raw_spec.rb +39 -39
- data/spec/integration/knife/redirection_spec.rb +12 -12
- data/spec/integration/knife/serve_spec.rb +12 -12
- data/spec/integration/knife/show_spec.rb +59 -59
- data/spec/integration/knife/upload_spec.rb +661 -550
- data/spec/integration/recipes/lwrp_inline_resources_spec.rb +18 -18
- data/spec/integration/recipes/lwrp_spec.rb +7 -7
- data/spec/integration/recipes/provider_choice.rb +3 -2
- data/spec/integration/recipes/recipe_dsl_spec.rb +151 -124
- data/spec/integration/recipes/remote_directory.rb +2 -2
- data/spec/integration/recipes/resource_action_spec.rb +439 -328
- data/spec/integration/recipes/resource_converge_if_changed_spec.rb +12 -11
- data/spec/integration/recipes/resource_load_spec.rb +35 -33
- data/spec/integration/solo/solo_spec.rb +31 -32
- data/spec/scripts/ssl-serve.rb +12 -17
- data/spec/spec_helper.rb +48 -43
- data/spec/stress/win32/file_spec.rb +5 -5
- data/spec/stress/win32/memory_spec.rb +4 -4
- data/spec/stress/win32/security_spec.rb +8 -8
- data/spec/support/chef_helpers.rb +5 -6
- data/spec/support/key_helpers.rb +2 -2
- data/spec/support/lib/chef/provider/easy.rb +2 -2
- data/spec/support/lib/chef/provider/openldap_includer.rb +2 -2
- data/spec/support/lib/chef/provider/snakeoil.rb +2 -2
- data/spec/support/lib/chef/resource/cat.rb +4 -4
- data/spec/support/lib/chef/resource/one_two_three_four.rb +2 -2
- data/spec/support/lib/chef/resource/openldap_includer.rb +2 -3
- data/spec/support/lib/chef/resource/with_state.rb +4 -4
- data/spec/support/lib/chef/resource/zen_follower.rb +4 -4
- data/spec/support/lib/chef/resource/zen_master.rb +5 -6
- data/spec/support/lib/library_load_order.rb +0 -2
- data/spec/support/matchers/leak.rb +7 -5
- data/spec/support/mock/constant.rb +3 -3
- data/spec/support/mock/platform.rb +5 -5
- data/spec/support/platform_helpers.rb +36 -23
- data/spec/support/platforms/prof/gc.rb +2 -3
- data/spec/support/platforms/prof/win32.rb +3 -4
- data/spec/support/platforms/win32/spec_service.rb +3 -3
- data/spec/support/shared/context/client.rb +22 -14
- data/spec/support/shared/context/config.rb +3 -3
- data/spec/support/shared/context/win32.rb +9 -9
- data/spec/support/shared/examples/client.rb +4 -4
- data/spec/support/shared/functional/diff_disabled.rb +1 -1
- data/spec/support/shared/functional/directory_resource.rb +8 -8
- data/spec/support/shared/functional/file_resource.rb +20 -23
- data/spec/support/shared/functional/http.rb +33 -34
- data/spec/support/shared/functional/knife.rb +3 -3
- data/spec/support/shared/functional/securable_resource.rb +48 -48
- data/spec/support/shared/functional/securable_resource_with_reporting.rb +8 -12
- data/spec/support/shared/functional/win32_service.rb +3 -5
- data/spec/support/shared/functional/windows_script.rb +13 -13
- data/spec/support/shared/integration/app_server_support.rb +7 -7
- data/spec/support/shared/integration/integration_helper.rb +21 -21
- data/spec/support/shared/integration/knife_support.rb +13 -13
- data/spec/support/shared/matchers/exit_with_code.rb +2 -2
- data/spec/support/shared/matchers/match_environment_variable.rb +2 -2
- data/spec/support/shared/unit/api_error_inspector.rb +3 -5
- data/spec/support/shared/unit/api_versioning.rb +8 -8
- data/spec/support/shared/unit/execute_resource.rb +4 -4
- data/spec/support/shared/unit/file_system_support.rb +12 -13
- data/spec/support/shared/unit/knife_shared.rb +1 -2
- data/spec/support/shared/unit/mock_shellout.rb +5 -2
- data/spec/support/shared/unit/platform_introspector.rb +35 -37
- data/spec/support/shared/unit/provider/file.rb +29 -40
- data/spec/support/shared/unit/provider/useradd_based_user_provider.rb +50 -51
- data/spec/support/shared/unit/resource/static_provider_resolution.rb +2 -5
- data/spec/support/shared/unit/script_resource.rb +10 -10
- data/spec/support/shared/unit/user_and_client_shared.rb +5 -6
- data/spec/support/shared/unit/windows_script_resource.rb +6 -7
- data/spec/tiny_server.rb +24 -24
- data/spec/unit/api_client/registration_spec.rb +41 -38
- data/spec/unit/api_client_spec.rb +13 -16
- data/spec/unit/api_client_v1_spec.rb +17 -19
- data/spec/unit/application/apply_spec.rb +3 -3
- data/spec/unit/application/client_spec.rb +12 -9
- data/spec/unit/application/knife_spec.rb +69 -17
- data/spec/unit/application/solo_spec.rb +29 -48
- data/spec/unit/application_spec.rb +171 -151
- data/spec/unit/audit/audit_event_proxy_spec.rb +13 -13
- data/spec/unit/audit/audit_reporter_spec.rb +18 -25
- data/spec/unit/audit/control_group_data_spec.rb +16 -17
- data/spec/unit/audit/logger_spec.rb +5 -5
- data/spec/unit/audit/rspec_formatter_spec.rb +4 -4
- data/spec/unit/audit/runner_spec.rb +11 -12
- data/spec/unit/chef_class_spec.rb +5 -5
- data/spec/unit/chef_fs/config_spec.rb +14 -18
- data/spec/unit/chef_fs/data_handler/group_handler_spec.rb +17 -17
- data/spec/unit/chef_fs/diff_spec.rb +75 -75
- data/spec/unit/chef_fs/file_pattern_spec.rb +368 -369
- data/spec/unit/chef_fs/file_system/cookbook_subdir_spec.rb +9 -9
- data/spec/unit/chef_fs/file_system/operation_failed_error_spec.rb +9 -9
- data/spec/unit/chef_fs/file_system_spec.rb +74 -74
- data/spec/unit/chef_fs/parallelizer.rb +63 -66
- data/spec/unit/chef_fs/path_util_spec.rb +45 -45
- data/spec/unit/chef_spec.rb +3 -3
- data/spec/unit/client_spec.rb +44 -44
- data/spec/unit/config_fetcher_spec.rb +56 -28
- data/spec/unit/config_spec.rb +2 -2
- data/spec/unit/cookbook/chefignore_spec.rb +12 -12
- data/spec/unit/cookbook/cookbook_version_loader_spec.rb +5 -6
- data/spec/unit/cookbook/file_vendor_spec.rb +8 -9
- data/spec/unit/cookbook/metadata_spec.rb +73 -76
- data/spec/unit/cookbook/synchronizer_spec.rb +31 -32
- data/spec/unit/cookbook/syntax_check_spec.rb +22 -22
- data/spec/unit/cookbook_loader_spec.rb +9 -10
- data/spec/unit/cookbook_manifest_spec.rb +27 -28
- data/spec/unit/cookbook_site_streaming_uploader_spec.rb +24 -24
- data/spec/unit/cookbook_spec.rb +3 -3
- data/spec/unit/cookbook_uploader_spec.rb +10 -11
- data/spec/unit/cookbook_version_file_specificity_spec.rb +49 -50
- data/spec/unit/cookbook_version_spec.rb +45 -48
- data/spec/unit/daemon_spec.rb +5 -5
- data/spec/unit/data_bag_item_spec.rb +29 -30
- data/spec/unit/data_bag_spec.rb +47 -47
- data/spec/unit/deprecation_spec.rb +11 -11
- data/spec/unit/digester_spec.rb +5 -6
- data/spec/unit/dsl/audit_spec.rb +5 -5
- data/spec/unit/dsl/data_query_spec.rb +12 -12
- data/spec/unit/dsl/platform_introspection_spec.rb +19 -20
- data/spec/unit/dsl/reboot_pending_spec.rb +17 -17
- data/spec/unit/dsl/recipe_spec.rb +4 -6
- data/spec/unit/dsl/regsitry_helper_spec.rb +9 -12
- data/spec/unit/dsl/resources_spec.rb +13 -13
- data/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb +7 -7
- data/spec/unit/encrypted_data_bag_item_spec.rb +11 -11
- data/spec/unit/environment_spec.rb +53 -53
- data/spec/unit/event_dispatch/dispatcher_spec.rb +3 -4
- data/spec/unit/event_dispatch/dsl_spec.rb +16 -16
- data/spec/unit/exceptions_spec.rb +10 -10
- data/spec/unit/file_access_control_spec.rb +32 -32
- data/spec/unit/file_cache_spec.rb +19 -19
- data/spec/unit/file_content_management/deploy/cp_spec.rb +3 -5
- data/spec/unit/file_content_management/deploy/mv_unix_spec.rb +3 -5
- data/spec/unit/file_content_management/deploy/mv_windows_spec.rb +5 -12
- data/spec/unit/formatters/base_spec.rb +29 -6
- data/spec/unit/formatters/doc_spec.rb +7 -7
- data/spec/unit/formatters/error_inspectors/api_error_formatting_spec.rb +9 -10
- data/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb +11 -11
- data/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb +4 -7
- data/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb +3 -3
- data/spec/unit/formatters/error_inspectors/node_load_error_inspector_spec.rb +3 -4
- data/spec/unit/formatters/error_inspectors/registration_error_inspector_spec.rb +3 -4
- data/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb +4 -6
- data/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb +5 -7
- data/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb +9 -9
- data/spec/unit/guard_interpreter_spec.rb +3 -3
- data/spec/unit/handler/json_file_spec.rb +11 -12
- data/spec/unit/handler_spec.rb +7 -7
- data/spec/unit/http/authenticator_spec.rb +9 -7
- data/spec/unit/http/basic_client_spec.rb +3 -3
- data/spec/unit/http/http_request_spec.rb +22 -22
- data/spec/unit/http/json_input_spec.rb +7 -7
- data/spec/unit/http/simple_spec.rb +3 -3
- data/spec/unit/http/socketless_chef_zero_client_spec.rb +3 -4
- data/spec/unit/http/ssl_policies_spec.rb +18 -19
- data/spec/unit/http/validate_content_length_spec.rb +9 -9
- data/spec/unit/http_spec.rb +18 -18
- data/spec/unit/json_compat_spec.rb +16 -9
- data/spec/unit/key_spec.rb +41 -44
- data/spec/unit/knife/bootstrap/chef_vault_handler_spec.rb +41 -42
- data/spec/unit/knife/bootstrap/client_builder_spec.rb +30 -28
- data/spec/unit/knife/bootstrap_spec.rb +75 -37
- data/spec/unit/knife/client_bulk_delete_spec.rb +6 -6
- data/spec/unit/knife/client_create_spec.rb +11 -12
- data/spec/unit/knife/client_delete_spec.rb +13 -13
- data/spec/unit/knife/client_edit_spec.rb +9 -9
- data/spec/unit/knife/client_list_spec.rb +5 -5
- data/spec/unit/knife/client_reregister_spec.rb +13 -13
- data/spec/unit/knife/client_show_spec.rb +12 -12
- data/spec/unit/knife/configure_client_spec.rb +19 -20
- data/spec/unit/knife/configure_spec.rb +37 -39
- data/spec/unit/knife/cookbook_bulk_delete_spec.rb +17 -19
- data/spec/unit/knife/cookbook_create_spec.rb +32 -32
- data/spec/unit/knife/cookbook_delete_spec.rb +79 -79
- data/spec/unit/knife/cookbook_download_spec.rb +84 -85
- data/spec/unit/knife/cookbook_list_spec.rb +26 -26
- data/spec/unit/knife/cookbook_metadata_from_file_spec.rb +5 -5
- data/spec/unit/knife/cookbook_metadata_spec.rb +55 -55
- data/spec/unit/knife/cookbook_show_spec.rb +33 -34
- data/spec/unit/knife/cookbook_site_download_spec.rb +51 -53
- data/spec/unit/knife/cookbook_site_install_spec.rb +10 -8
- data/spec/unit/knife/cookbook_site_share_spec.rb +42 -42
- data/spec/unit/knife/cookbook_site_unshare_spec.rb +20 -20
- data/spec/unit/knife/cookbook_test_spec.rb +6 -6
- data/spec/unit/knife/cookbook_upload_spec.rb +69 -69
- data/spec/unit/knife/core/bootstrap_context_spec.rb +39 -33
- data/spec/unit/knife/core/cookbook_scm_repo_spec.rb +32 -32
- data/spec/unit/knife/core/custom_manifest_loader_spec.rb +3 -3
- data/spec/unit/knife/core/gem_glob_loader_spec.rb +23 -24
- data/spec/unit/knife/core/hashed_command_loader_spec.rb +8 -8
- data/spec/unit/knife/core/node_editor_spec.rb +211 -0
- data/spec/unit/knife/core/object_loader_spec.rb +12 -12
- data/spec/unit/knife/core/subcommand_loader_spec.rb +10 -10
- data/spec/unit/knife/core/ui_spec.rb +45 -45
- data/spec/unit/knife/data_bag_create_spec.rb +14 -14
- data/spec/unit/knife/data_bag_edit_spec.rb +12 -12
- data/spec/unit/knife/data_bag_from_file_spec.rb +9 -9
- data/spec/unit/knife/data_bag_secret_options_spec.rb +6 -6
- data/spec/unit/knife/data_bag_show_spec.rb +19 -19
- data/spec/unit/knife/environment_compare_spec.rb +32 -32
- data/spec/unit/knife/environment_create_spec.rb +2 -2
- data/spec/unit/knife/environment_delete_spec.rb +2 -2
- data/spec/unit/knife/environment_edit_spec.rb +2 -2
- data/spec/unit/knife/environment_from_file_spec.rb +5 -5
- data/spec/unit/knife/environment_list_spec.rb +4 -4
- data/spec/unit/knife/environment_show_spec.rb +2 -2
- data/spec/unit/knife/index_rebuild_spec.rb +14 -17
- data/spec/unit/knife/key_create_spec.rb +11 -12
- data/spec/unit/knife/key_delete_spec.rb +8 -10
- data/spec/unit/knife/key_edit_spec.rb +14 -17
- data/spec/unit/knife/key_helper.rb +2 -2
- data/spec/unit/knife/key_list_spec.rb +13 -13
- data/spec/unit/knife/key_show_spec.rb +11 -11
- data/spec/unit/knife/knife_help.rb +2 -2
- data/spec/unit/knife/node_bulk_delete_spec.rb +10 -13
- data/spec/unit/knife/node_delete_spec.rb +4 -4
- data/spec/unit/knife/node_edit_spec.rb +17 -18
- data/spec/unit/knife/node_environment_set_spec.rb +4 -4
- data/spec/unit/knife/node_from_file_spec.rb +5 -5
- data/spec/unit/knife/node_list_spec.rb +5 -6
- data/spec/unit/knife/node_run_list_add_spec.rb +5 -8
- data/spec/unit/knife/node_run_list_remove_spec.rb +27 -27
- data/spec/unit/knife/node_run_list_set_spec.rb +4 -4
- data/spec/unit/knife/node_show_spec.rb +6 -6
- data/spec/unit/knife/osc_user_create_spec.rb +7 -7
- data/spec/unit/knife/osc_user_delete_spec.rb +7 -7
- data/spec/unit/knife/osc_user_edit_spec.rb +6 -6
- data/spec/unit/knife/osc_user_list_spec.rb +3 -3
- data/spec/unit/knife/osc_user_reregister_spec.rb +10 -10
- data/spec/unit/knife/osc_user_show_spec.rb +8 -8
- data/spec/unit/knife/raw_spec.rb +6 -6
- data/spec/unit/knife/role_bulk_delete_spec.rb +4 -4
- data/spec/unit/knife/role_create_spec.rb +4 -4
- data/spec/unit/knife/role_delete_spec.rb +4 -4
- data/spec/unit/knife/role_edit_spec.rb +4 -6
- data/spec/unit/knife/role_env_run_list_add_spec.rb +9 -9
- data/spec/unit/knife/role_env_run_list_clear_spec.rb +38 -44
- data/spec/unit/knife/role_env_run_list_remove_spec.rb +46 -52
- data/spec/unit/knife/role_env_run_list_replace_spec.rb +49 -52
- data/spec/unit/knife/role_env_run_list_set_spec.rb +17 -20
- data/spec/unit/knife/role_from_file_spec.rb +7 -7
- data/spec/unit/knife/role_list_spec.rb +5 -7
- data/spec/unit/knife/role_run_list_add_spec.rb +7 -7
- data/spec/unit/knife/role_run_list_clear_spec.rb +28 -34
- data/spec/unit/knife/role_run_list_remove_spec.rb +36 -42
- data/spec/unit/knife/role_run_list_replace_spec.rb +42 -45
- data/spec/unit/knife/role_run_list_set_spec.rb +6 -9
- data/spec/unit/knife/role_show_spec.rb +14 -14
- data/spec/unit/knife/ssh_spec.rb +36 -36
- data/spec/unit/knife/ssl_check_spec.rb +7 -7
- data/spec/unit/knife/ssl_fetch_spec.rb +8 -8
- data/spec/unit/knife/status_spec.rb +5 -5
- data/spec/unit/knife/tag_create_spec.rb +1 -1
- data/spec/unit/knife/tag_delete_spec.rb +1 -1
- data/spec/unit/knife/tag_list_spec.rb +2 -2
- data/spec/unit/knife/user_create_spec.rb +30 -30
- data/spec/unit/knife/user_delete_spec.rb +11 -11
- data/spec/unit/knife/user_edit_spec.rb +9 -9
- data/spec/unit/knife/user_list_spec.rb +3 -3
- data/spec/unit/knife/user_reregister_spec.rb +13 -13
- data/spec/unit/knife/user_show_spec.rb +12 -12
- data/spec/unit/knife_spec.rb +61 -61
- data/spec/unit/lib_backcompat_spec.rb +34 -0
- data/spec/unit/log/syslog_spec.rb +3 -3
- data/spec/unit/log/winevt_spec.rb +3 -3
- data/spec/unit/log_spec.rb +5 -5
- data/spec/unit/lwrp_spec.rb +41 -43
- data/spec/unit/mash_spec.rb +8 -8
- data/spec/unit/mixin/api_version_request_handling_spec.rb +13 -14
- data/spec/unit/mixin/checksum_spec.rb +5 -6
- data/spec/unit/mixin/command_spec.rb +9 -9
- data/spec/unit/mixin/convert_to_class_name_spec.rb +2 -2
- data/spec/unit/mixin/deep_merge_spec.rb +107 -107
- data/spec/unit/mixin/deprecation_spec.rb +5 -5
- data/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb +9 -9
- data/spec/unit/mixin/homebrew_user_spec.rb +13 -13
- data/spec/unit/mixin/params_validate_spec.rb +71 -71
- data/spec/unit/mixin/path_sanity_spec.rb +16 -16
- data/spec/unit/mixin/powershell_out_spec.rb +9 -9
- data/spec/unit/mixin/powershell_type_coercions_spec.rb +34 -23
- data/spec/unit/mixin/properties_spec.rb +27 -27
- data/spec/unit/mixin/proxified_socket_spec.rb +6 -6
- data/spec/unit/mixin/securable_spec.rb +37 -37
- data/spec/unit/mixin/shell_out_spec.rb +68 -68
- data/spec/unit/mixin/subclass_directive_spec.rb +2 -2
- data/spec/unit/mixin/template_spec.rb +15 -12
- data/spec/unit/mixin/unformatter_spec.rb +3 -3
- data/spec/unit/mixin/uris_spec.rb +8 -8
- data/spec/unit/mixin/windows_architecture_helper_spec.rb +14 -17
- data/spec/unit/mixin/xml_escape_spec.rb +3 -3
- data/spec/unit/monkey_patches/uri_spec.rb +3 -3
- data/spec/unit/monologger_spec.rb +4 -4
- data/spec/unit/node/attribute_spec.rb +203 -248
- data/spec/unit/node/immutable_collections_spec.rb +20 -21
- data/spec/unit/node_map_spec.rb +5 -5
- data/spec/unit/node_spec.rb +165 -135
- data/spec/unit/org_spec.rb +17 -17
- data/spec/unit/platform/query_helpers_spec.rb +23 -23
- data/spec/unit/platform_spec.rb +17 -17
- data/spec/unit/policy_builder/dynamic_spec.rb +8 -10
- data/spec/unit/policy_builder/expand_node_object_spec.rb +16 -14
- data/spec/unit/policy_builder/policyfile_spec.rb +30 -37
- data/spec/unit/policy_builder_spec.rb +4 -4
- data/spec/unit/property/state_spec.rb +58 -56
- data/spec/unit/property/validation_spec.rb +255 -216
- data/spec/unit/property_spec.rb +206 -129
- data/spec/unit/provider/apt_update_spec.rb +113 -0
- data/spec/unit/provider/breakpoint_spec.rb +2 -3
- data/spec/unit/provider/cookbook_file/content_spec.rb +9 -10
- data/spec/unit/provider/cookbook_file_spec.rb +11 -11
- data/spec/unit/provider/cron/unix_spec.rb +7 -7
- data/spec/unit/provider/cron_spec.rb +67 -67
- data/spec/unit/provider/deploy/revision_spec.rb +6 -7
- data/spec/unit/provider/deploy/timestamped_spec.rb +2 -2
- data/spec/unit/provider/deploy_spec.rb +24 -25
- data/spec/unit/provider/directory_spec.rb +12 -12
- data/spec/unit/provider/dsc_resource_spec.rb +29 -27
- data/spec/unit/provider/dsc_script_spec.rb +47 -48
- data/spec/unit/provider/env/windows_spec.rb +21 -21
- data/spec/unit/provider/env_spec.rb +5 -5
- data/spec/unit/provider/erl_call_spec.rb +3 -4
- data/spec/unit/provider/execute_spec.rb +5 -5
- data/spec/unit/provider/file/content_spec.rb +4 -4
- data/spec/unit/provider/file_spec.rb +8 -9
- data/spec/unit/provider/git_spec.rb +64 -65
- data/spec/unit/provider/group/dscl_spec.rb +7 -7
- data/spec/unit/provider/group/gpasswd_spec.rb +3 -3
- data/spec/unit/provider/group/groupadd_spec.rb +9 -9
- data/spec/unit/provider/group/groupmod_spec.rb +12 -12
- data/spec/unit/provider/group/pw_spec.rb +3 -3
- data/spec/unit/provider/group/usermod_spec.rb +6 -6
- data/spec/unit/provider/group/windows_spec.rb +3 -3
- data/spec/unit/provider/group_spec.rb +16 -16
- data/spec/unit/provider/http_request_spec.rb +7 -7
- data/spec/unit/provider/ifconfig/aix_spec.rb +4 -5
- data/spec/unit/provider/ifconfig/debian_spec.rb +6 -6
- data/spec/unit/provider/ifconfig/redhat_spec.rb +3 -3
- data/spec/unit/provider/ifconfig_spec.rb +5 -5
- data/spec/unit/provider/link_spec.rb +12 -12
- data/spec/unit/provider/log_spec.rb +2 -2
- data/spec/unit/provider/mdadm_spec.rb +12 -12
- data/spec/unit/provider/mount/aix_spec.rb +7 -7
- data/spec/unit/provider/mount/mount_spec.rb +20 -20
- data/spec/unit/provider/mount/solaris_spec.rb +26 -26
- data/spec/unit/provider/mount/windows_spec.rb +8 -8
- data/spec/unit/provider/mount_spec.rb +7 -8
- data/spec/unit/provider/ohai_spec.rb +13 -13
- data/spec/unit/provider/osx_profile_spec.rb +249 -0
- data/spec/unit/provider/package/aix_spec.rb +5 -5
- data/spec/unit/provider/package/apt_spec.rb +49 -49
- data/spec/unit/provider/package/chocolatey_spec.rb +504 -0
- data/spec/unit/provider/package/dpkg_spec.rb +32 -36
- data/spec/unit/provider/package/easy_install_spec.rb +11 -15
- data/spec/unit/provider/package/freebsd/pkg_spec.rb +10 -10
- data/spec/unit/provider/package/freebsd/pkgng_spec.rb +12 -19
- data/spec/unit/provider/package/freebsd/port_spec.rb +12 -19
- data/spec/unit/provider/package/homebrew_spec.rb +139 -139
- data/spec/unit/provider/package/ips_spec.rb +10 -11
- data/spec/unit/provider/package/macports_spec.rb +3 -3
- data/spec/unit/provider/package/openbsd_spec.rb +38 -38
- data/spec/unit/provider/package/pacman_spec.rb +8 -9
- data/spec/unit/provider/package/paludis_spec.rb +9 -10
- data/spec/unit/provider/package/portage_spec.rb +2 -2
- data/spec/unit/provider/package/rpm_spec.rb +7 -11
- data/spec/unit/provider/package/rubygems_spec.rb +386 -289
- data/spec/unit/provider/package/smartos_spec.rb +8 -10
- data/spec/unit/provider/package/solaris_spec.rb +4 -4
- data/spec/unit/provider/package/windows/exe_spec.rb +17 -81
- data/spec/unit/provider/package/windows/msi_spec.rb +16 -16
- data/spec/unit/provider/package/windows_spec.rb +50 -40
- data/spec/unit/provider/package/yum_spec.rb +179 -181
- data/spec/unit/provider/package/zypper_spec.rb +53 -50
- data/spec/unit/provider/package_spec.rb +104 -104
- data/spec/unit/provider/powershell_script_spec.rb +20 -20
- data/spec/unit/provider/registry_key_spec.rb +3 -3
- data/spec/unit/provider/remote_directory_spec.rb +46 -46
- data/spec/unit/provider/remote_file/cache_control_data_spec.rb +9 -10
- data/spec/unit/provider/remote_file/content_spec.rb +5 -6
- data/spec/unit/provider/remote_file/fetcher_spec.rb +3 -3
- data/spec/unit/provider/remote_file/ftp_spec.rb +3 -3
- data/spec/unit/provider/remote_file/http_spec.rb +10 -12
- data/spec/unit/provider/remote_file/local_file_spec.rb +2 -2
- data/spec/unit/provider/remote_file/network_file_spec.rb +2 -2
- data/spec/unit/provider/remote_file_spec.rb +9 -11
- data/spec/unit/provider/route_spec.rb +26 -27
- data/spec/unit/provider/ruby_block_spec.rb +4 -5
- data/spec/unit/provider/script_spec.rb +11 -11
- data/spec/unit/provider/service/aix_service_spec.rb +5 -6
- data/spec/unit/provider/service/aixinit_service_spec.rb +26 -23
- data/spec/unit/provider/service/arch_service_spec.rb +15 -15
- data/spec/unit/provider/service/debian_service_spec.rb +37 -37
- data/spec/unit/provider/service/freebsd_service_spec.rb +9 -9
- data/spec/unit/provider/service/gentoo_service_spec.rb +4 -4
- data/spec/unit/provider/service/init_service_spec.rb +9 -9
- data/spec/unit/provider/service/insserv_service_spec.rb +3 -3
- data/spec/unit/provider/service/invokercd_service_spec.rb +9 -9
- data/spec/unit/provider/service/macosx_spec.rb +26 -26
- data/spec/unit/provider/service/openbsd_service_spec.rb +26 -26
- data/spec/unit/provider/service/redhat_spec.rb +16 -16
- data/spec/unit/provider/service/simple_service_spec.rb +5 -5
- data/spec/unit/provider/service/solaris_smf_service_spec.rb +51 -51
- data/spec/unit/provider/service/systemd_service_spec.rb +4 -4
- data/spec/unit/provider/service/upstart_service_spec.rb +13 -13
- data/spec/unit/provider/service/windows_spec.rb +28 -37
- data/spec/unit/provider/service_spec.rb +2 -3
- data/spec/unit/provider/subversion_spec.rb +27 -28
- data/spec/unit/provider/template/content_spec.rb +21 -21
- data/spec/unit/provider/template_spec.rb +15 -16
- data/spec/unit/provider/user/dscl_spec.rb +36 -37
- data/spec/unit/provider/user/pw_spec.rb +12 -12
- data/spec/unit/provider/user/solaris_spec.rb +31 -31
- data/spec/unit/provider/user/useradd_spec.rb +10 -10
- data/spec/unit/provider/user/windows_spec.rb +9 -9
- data/spec/unit/provider/user_spec.rb +19 -20
- data/spec/unit/provider/whyrun_safe_ruby_block_spec.rb +3 -4
- data/spec/unit/provider_resolver_spec.rb +63 -62
- data/spec/unit/provider_spec.rb +7 -8
- data/spec/unit/pure_application_spec.rb +3 -3
- data/spec/unit/recipe_spec.rb +13 -16
- data/spec/unit/resource/apt_package_spec.rb +4 -4
- data/spec/unit/resource/apt_update_spec.rb +38 -0
- data/spec/unit/resource/bash_spec.rb +3 -3
- data/spec/unit/resource/batch_spec.rb +5 -5
- data/spec/unit/resource/breakpoint_spec.rb +3 -3
- data/spec/unit/resource/chef_gem_spec.rb +5 -9
- data/spec/unit/resource/chocolatey_package_spec.rb +67 -0
- data/spec/unit/resource/conditional_action_not_nothing_spec.rb +2 -2
- data/spec/unit/resource/conditional_spec.rb +12 -12
- data/spec/unit/resource/cookbook_file_spec.rb +23 -24
- data/spec/unit/resource/cron_spec.rb +4 -4
- data/spec/unit/resource/csh_spec.rb +3 -3
- data/spec/unit/resource/deploy_revision_spec.rb +3 -3
- data/spec/unit/resource/deploy_spec.rb +23 -24
- data/spec/unit/resource/directory_spec.rb +4 -4
- data/spec/unit/resource/dpkg_package_spec.rb +5 -5
- data/spec/unit/resource/dsc_resource_spec.rb +11 -11
- data/spec/unit/resource/dsc_script_spec.rb +15 -15
- data/spec/unit/resource/easy_install_package_spec.rb +3 -3
- data/spec/unit/resource/env_spec.rb +5 -5
- data/spec/unit/resource/erl_call_spec.rb +3 -3
- data/spec/unit/resource/execute_spec.rb +4 -4
- data/spec/unit/resource/file/verification_spec.rb +11 -11
- data/spec/unit/resource/file_spec.rb +10 -10
- data/spec/unit/resource/freebsd_package_spec.rb +6 -9
- data/spec/unit/resource/gem_package_spec.rb +4 -4
- data/spec/unit/resource/git_spec.rb +3 -3
- data/spec/unit/resource/group_spec.rb +4 -4
- data/spec/unit/resource/homebrew_package_spec.rb +13 -13
- data/spec/unit/resource/http_request_spec.rb +5 -5
- data/spec/unit/resource/ifconfig_spec.rb +9 -9
- data/spec/unit/resource/ips_package_spec.rb +4 -4
- data/spec/unit/resource/ksh_spec.rb +2 -2
- data/spec/unit/resource/link_spec.rb +6 -6
- data/spec/unit/resource/log_spec.rb +3 -3
- data/spec/unit/resource/macports_package_spec.rb +3 -3
- data/spec/unit/resource/mdadm_spec.rb +3 -3
- data/spec/unit/resource/mount_spec.rb +7 -7
- data/spec/unit/resource/ohai_spec.rb +2 -3
- data/spec/unit/resource/openbsd_package_spec.rb +5 -6
- data/spec/unit/resource/osx_profile_spec.rb +61 -0
- data/spec/unit/resource/package_spec.rb +6 -6
- data/spec/unit/resource/pacman_package_spec.rb +3 -3
- data/spec/unit/resource/perl_spec.rb +3 -3
- data/spec/unit/resource/portage_package_spec.rb +2 -2
- data/spec/unit/resource/powershell_script_spec.rb +16 -16
- data/spec/unit/resource/python_spec.rb +3 -3
- data/spec/unit/resource/registry_key_spec.rb +21 -21
- data/spec/unit/resource/remote_directory_spec.rb +3 -3
- data/spec/unit/resource/remote_file_spec.rb +15 -15
- data/spec/unit/resource/resource_notification_spec.rb +18 -18
- data/spec/unit/resource/route_spec.rb +3 -3
- data/spec/unit/resource/rpm_package_spec.rb +4 -4
- data/spec/unit/resource/ruby_block_spec.rb +4 -4
- data/spec/unit/resource/ruby_spec.rb +3 -3
- data/spec/unit/resource/scm_spec.rb +8 -8
- data/spec/unit/resource/script_spec.rb +4 -4
- data/spec/unit/resource/service_spec.rb +4 -5
- data/spec/unit/resource/smartos_package_spec.rb +3 -3
- data/spec/unit/resource/solaris_package_spec.rb +3 -3
- data/spec/unit/resource/subversion_spec.rb +5 -5
- data/spec/unit/resource/template_spec.rb +7 -8
- data/spec/unit/resource/timestamped_deploy_spec.rb +4 -4
- data/spec/unit/resource/user_spec.rb +4 -4
- data/spec/unit/resource/windows_package_spec.rb +7 -7
- data/spec/unit/resource/windows_service_spec.rb +3 -3
- data/spec/unit/resource/yum_package_spec.rb +6 -6
- data/spec/unit/resource_collection/resource_list_spec.rb +7 -7
- data/spec/unit/resource_collection/resource_set_spec.rb +9 -9
- data/spec/unit/resource_collection/stepable_iterator_spec.rb +6 -6
- data/spec/unit/resource_collection_spec.rb +8 -9
- data/spec/unit/resource_definition_spec.rb +3 -3
- data/spec/unit/resource_reporter_spec.rb +56 -64
- data/spec/unit/resource_resolver_spec.rb +5 -6
- data/spec/unit/resource_spec.rb +80 -60
- data/spec/unit/rest/auth_credentials_spec.rb +39 -71
- data/spec/unit/rest_spec.rb +96 -90
- data/spec/unit/role_spec.rb +64 -68
- data/spec/unit/run_context/child_run_context_spec.rb +23 -23
- data/spec/unit/run_context/cookbook_compiler_spec.rb +5 -7
- data/spec/unit/run_context_spec.rb +19 -19
- data/spec/unit/run_list/run_list_expansion_spec.rb +24 -24
- data/spec/unit/run_list/run_list_item_spec.rb +28 -28
- data/spec/unit/run_list/versioned_recipe_list_spec.rb +22 -23
- data/spec/unit/run_list_spec.rb +37 -41
- data/spec/unit/run_lock_spec.rb +10 -10
- data/spec/unit/run_status_spec.rb +4 -5
- data/spec/unit/runner_spec.rb +8 -8
- data/spec/unit/scan_access_control_spec.rb +4 -5
- data/spec/unit/search/query_spec.rb +50 -46
- data/spec/unit/shell/model_wrapper_spec.rb +12 -13
- data/spec/unit/shell/shell_ext_spec.rb +5 -5
- data/spec/unit/shell/shell_session_spec.rb +8 -9
- data/spec/unit/shell_out_spec.rb +1 -1
- data/spec/unit/shell_spec.rb +9 -9
- data/spec/unit/user_spec.rb +14 -15
- data/spec/unit/user_v1_spec.rb +22 -23
- data/spec/unit/util/backup_spec.rb +17 -18
- data/spec/unit/util/diff_spec.rb +6 -9
- data/spec/unit/util/dsc/configuration_generator_spec.rb +48 -48
- data/spec/unit/util/dsc/lcm_output_parser_spec.rb +22 -22
- data/spec/unit/util/dsc/local_configuration_manager_spec.rb +30 -31
- data/spec/unit/util/dsc/resource_store.rb +22 -22
- data/spec/unit/util/editor_spec.rb +65 -65
- data/spec/unit/util/file_edit_spec.rb +7 -7
- data/spec/unit/util/powershell/cmdlet_spec.rb +27 -27
- data/spec/unit/util/powershell/ps_credential_spec.rb +13 -13
- data/spec/unit/util/selinux_spec.rb +8 -9
- data/spec/unit/util/threaded_job_queue_spec.rb +2 -2
- data/spec/unit/version/platform_spec.rb +5 -6
- data/spec/unit/version_class_spec.rb +8 -9
- data/spec/unit/version_constraint/platform_spec.rb +3 -4
- data/spec/unit/version_constraint_spec.rb +19 -19
- data/spec/unit/win32/registry_spec.rb +25 -25
- data/spec/unit/windows_service_spec.rb +20 -20
- data/tasks/cbgb.rb +84 -0
- data/tasks/external_tests.rb +12 -11
- data/tasks/maintainers.rb +15 -15
- data/tasks/rspec.rb +18 -15
- metadata +250 -67
- data/lib/chef/chef_fs/file_system/acl_dir.rb +0 -63
- data/lib/chef/chef_fs/file_system/acl_entry.rb +0 -58
- data/lib/chef/chef_fs/file_system/acls_dir.rb +0 -72
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_cookbook_dir.rb +0 -102
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_cookbook_entry.rb +0 -80
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_cookbooks_dir.rb +0 -82
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_entry.rb +0 -81
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb +0 -196
- data/lib/chef/chef_fs/file_system/chef_server_root_dir.rb +0 -165
- data/lib/chef/chef_fs/file_system/cookbook_dir.rb +0 -224
- data/lib/chef/chef_fs/file_system/cookbook_file.rb +0 -82
- data/lib/chef/chef_fs/file_system/cookbook_subdir.rb +0 -59
- data/lib/chef/chef_fs/file_system/cookbooks_acl_dir.rb +0 -41
- data/lib/chef/chef_fs/file_system/cookbooks_dir.rb +0 -156
- data/lib/chef/chef_fs/file_system/data_bag_dir.rb +0 -69
- data/lib/chef/chef_fs/file_system/data_bags_dir.rb +0 -71
- data/lib/chef/chef_fs/file_system/environments_dir.rb +0 -60
- data/lib/chef/chef_fs/file_system/file_system_entry.rb +0 -115
- data/lib/chef/chef_fs/file_system/memory_dir.rb +0 -51
- data/lib/chef/chef_fs/file_system/memory_file.rb +0 -17
- data/lib/chef/chef_fs/file_system/memory_root.rb +0 -21
- data/lib/chef/chef_fs/file_system/nodes_dir.rb +0 -55
- data/lib/chef/chef_fs/file_system/org_entry.rb +0 -34
- data/lib/chef/chef_fs/file_system/organization_invites_entry.rb +0 -59
- data/lib/chef/chef_fs/file_system/organization_members_entry.rb +0 -58
- data/lib/chef/chef_fs/file_system/rest_list_dir.rb +0 -110
- data/lib/chef/chef_fs/file_system/rest_list_entry.rb +0 -185
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
|
-
# Author:: John Keiser (<jkeiser@
|
3
|
-
# Copyright:: Copyright
|
2
|
+
# Author:: John Keiser (<jkeiser@chef.io>)
|
3
|
+
# Copyright:: Copyright 2013-2016, Chef Software, Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -15,44 +15,44 @@
|
|
15
15
|
# See the License for the specific language governing permissions and
|
16
16
|
# limitations under the License.
|
17
17
|
|
18
|
-
require
|
19
|
-
require
|
20
|
-
require
|
21
|
-
require
|
22
|
-
require
|
18
|
+
require "support/shared/integration/integration_helper"
|
19
|
+
require "chef/knife/upload"
|
20
|
+
require "chef/knife/diff"
|
21
|
+
require "chef/knife/raw"
|
22
|
+
require "chef/json_compat"
|
23
23
|
|
24
|
-
describe
|
24
|
+
describe "knife upload", :workstation do
|
25
25
|
include IntegrationSupport
|
26
26
|
include KnifeSupport
|
27
27
|
|
28
|
-
context
|
28
|
+
context "without versioned cookbooks" do
|
29
29
|
|
30
30
|
when_the_chef_server "has one of each thing" do
|
31
31
|
|
32
32
|
before do
|
33
|
-
client
|
34
|
-
cookbook
|
35
|
-
data_bag
|
36
|
-
environment
|
37
|
-
node
|
38
|
-
role
|
39
|
-
user
|
33
|
+
client "x", {}
|
34
|
+
cookbook "x", "1.0.0"
|
35
|
+
data_bag "x", { "y" => {} }
|
36
|
+
environment "x", {}
|
37
|
+
node "x", {}
|
38
|
+
role "x", {}
|
39
|
+
user "x", {}
|
40
40
|
end
|
41
41
|
|
42
|
-
when_the_repository
|
42
|
+
when_the_repository "has only top-level directories" do
|
43
43
|
before do
|
44
|
-
directory
|
45
|
-
directory
|
46
|
-
directory
|
47
|
-
directory
|
48
|
-
directory
|
49
|
-
directory
|
50
|
-
directory
|
51
|
-
end
|
52
|
-
|
53
|
-
it
|
54
|
-
knife(
|
55
|
-
knife(
|
44
|
+
directory "clients"
|
45
|
+
directory "cookbooks"
|
46
|
+
directory "data_bags"
|
47
|
+
directory "environments"
|
48
|
+
directory "nodes"
|
49
|
+
directory "roles"
|
50
|
+
directory "users"
|
51
|
+
end
|
52
|
+
|
53
|
+
it "knife upload does nothing" do
|
54
|
+
knife("upload /").should_succeed ""
|
55
|
+
knife("diff --name-status /").should_succeed <<EOM
|
56
56
|
D\t/clients/chef-validator.json
|
57
57
|
D\t/clients/chef-webui.json
|
58
58
|
D\t/clients/x.json
|
@@ -67,8 +67,8 @@ D\t/users/x.json
|
|
67
67
|
EOM
|
68
68
|
end
|
69
69
|
|
70
|
-
it
|
71
|
-
knife(
|
70
|
+
it "knife upload --purge deletes everything" do
|
71
|
+
knife("upload --purge /").should_succeed(<<EOM, :stderr => "WARNING: /environments/_default.json cannot be deleted (default environment cannot be modified).\n")
|
72
72
|
Deleted extra entry /clients/chef-validator.json (purge is on)
|
73
73
|
Deleted extra entry /clients/chef-webui.json (purge is on)
|
74
74
|
Deleted extra entry /clients/x.json (purge is on)
|
@@ -80,56 +80,56 @@ Deleted extra entry /roles/x.json (purge is on)
|
|
80
80
|
Deleted extra entry /users/admin.json (purge is on)
|
81
81
|
Deleted extra entry /users/x.json (purge is on)
|
82
82
|
EOM
|
83
|
-
|
83
|
+
knife("diff --name-status /").should_succeed <<EOM
|
84
84
|
D\t/environments/_default.json
|
85
85
|
EOM
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
|
-
when_the_repository
|
89
|
+
when_the_repository "has an identical copy of each thing" do
|
90
90
|
|
91
91
|
before do
|
92
|
-
file
|
93
|
-
file
|
94
|
-
file
|
95
|
-
file
|
96
|
-
file
|
97
|
-
file
|
98
|
-
file
|
99
|
-
file
|
100
|
-
file
|
101
|
-
file
|
102
|
-
file
|
92
|
+
file "clients/chef-validator.json", { "validator" => true, "public_key" => ChefZero::PUBLIC_KEY }
|
93
|
+
file "clients/chef-webui.json", { "admin" => true, "public_key" => ChefZero::PUBLIC_KEY }
|
94
|
+
file "clients/x.json", { "public_key" => ChefZero::PUBLIC_KEY }
|
95
|
+
file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0")
|
96
|
+
file "data_bags/x/y.json", {}
|
97
|
+
file "environments/_default.json", { "description" => "The default Chef environment" }
|
98
|
+
file "environments/x.json", {}
|
99
|
+
file "nodes/x.json", {}
|
100
|
+
file "roles/x.json", {}
|
101
|
+
file "users/admin.json", { "admin" => true, "public_key" => ChefZero::PUBLIC_KEY }
|
102
|
+
file "users/x.json", { "public_key" => ChefZero::PUBLIC_KEY }
|
103
103
|
end
|
104
104
|
|
105
|
-
it
|
106
|
-
knife(
|
107
|
-
knife(
|
105
|
+
it "knife upload makes no changes" do
|
106
|
+
knife("upload /cookbooks/x").should_succeed ""
|
107
|
+
knife("diff --name-status /").should_succeed ""
|
108
108
|
end
|
109
109
|
|
110
|
-
it
|
111
|
-
knife(
|
112
|
-
knife(
|
110
|
+
it "knife upload --purge makes no changes" do
|
111
|
+
knife("upload --purge /").should_succeed ""
|
112
|
+
knife("diff --name-status /").should_succeed ""
|
113
113
|
end
|
114
114
|
|
115
|
-
context
|
115
|
+
context "except the role file" do
|
116
116
|
before do
|
117
|
-
file
|
117
|
+
file "roles/x.json", { "description" => "blarghle" }
|
118
118
|
end
|
119
119
|
|
120
|
-
it
|
121
|
-
knife(
|
122
|
-
knife(
|
120
|
+
it "knife upload changes the role" do
|
121
|
+
knife("upload /").should_succeed "Updated /roles/x.json\n"
|
122
|
+
knife("diff --name-status /").should_succeed ""
|
123
123
|
end
|
124
|
-
it
|
125
|
-
knife(
|
126
|
-
knife(
|
124
|
+
it "knife upload --no-diff does not change the role" do
|
125
|
+
knife("upload --no-diff /").should_succeed ""
|
126
|
+
knife("diff --name-status /").should_succeed "M\t/roles/x.json\n"
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
130
|
-
context
|
130
|
+
context "except the role file is textually different, but not ACTUALLY different" do
|
131
131
|
before do
|
132
|
-
file
|
132
|
+
file "roles/x.json", <<EOM
|
133
133
|
{
|
134
134
|
"chef_type": "role",
|
135
135
|
"default_attributes": {
|
@@ -148,45 +148,45 @@ EOM
|
|
148
148
|
EOM
|
149
149
|
end
|
150
150
|
|
151
|
-
it
|
152
|
-
knife(
|
153
|
-
knife(
|
151
|
+
it "knife upload / does not change anything" do
|
152
|
+
knife("upload /").should_succeed ""
|
153
|
+
knife("diff --name-status /").should_succeed ""
|
154
154
|
end
|
155
155
|
end
|
156
156
|
|
157
|
-
context
|
157
|
+
context "when cookbook metadata has a self-dependency" do
|
158
158
|
before do
|
159
|
-
file
|
159
|
+
file "cookbooks/x/metadata.rb", "name 'x'; version '1.0.0'; depends 'x'"
|
160
160
|
end
|
161
161
|
|
162
162
|
it "should warn", :chef_lt_13_only do
|
163
|
-
knife(
|
163
|
+
knife("upload /cookbooks").should_succeed(
|
164
164
|
stdout: "Updated /cookbooks/x\n",
|
165
|
-
stderr: "WARN: Ignoring self-dependency in cookbook x, please remove it (in the future this will be fatal).\n"
|
165
|
+
stderr: "WARN: Ignoring self-dependency in cookbook x, please remove it (in the future this will be fatal).\n",
|
166
166
|
)
|
167
|
-
knife(
|
167
|
+
knife("diff --name-status /").should_succeed ""
|
168
168
|
end
|
169
169
|
it "should fail in Chef 13", :chef_gte_13_only do
|
170
|
-
knife(
|
170
|
+
knife("upload /cookbooks").should_fail ""
|
171
171
|
# FIXME: include the error message here
|
172
172
|
end
|
173
173
|
end
|
174
174
|
|
175
|
-
context
|
175
|
+
context "as well as one extra copy of each thing" do
|
176
176
|
before do
|
177
|
-
file
|
178
|
-
file
|
179
|
-
file
|
180
|
-
file
|
181
|
-
file
|
182
|
-
file
|
183
|
-
file
|
184
|
-
file
|
185
|
-
file
|
177
|
+
file "clients/y.json", { "public_key" => ChefZero::PUBLIC_KEY }
|
178
|
+
file "cookbooks/x/blah.rb", ""
|
179
|
+
file "cookbooks/y/metadata.rb", cb_metadata("y", "1.0.0")
|
180
|
+
file "data_bags/x/z.json", {}
|
181
|
+
file "data_bags/y/zz.json", {}
|
182
|
+
file "environments/y.json", {}
|
183
|
+
file "nodes/y.json", {}
|
184
|
+
file "roles/y.json", {}
|
185
|
+
file "users/y.json", { "public_key" => ChefZero::PUBLIC_KEY }
|
186
186
|
end
|
187
187
|
|
188
|
-
it
|
189
|
-
knife(
|
188
|
+
it "knife upload adds the new files" do
|
189
|
+
knife("upload /").should_succeed <<EOM
|
190
190
|
Created /clients/y.json
|
191
191
|
Updated /cookbooks/x
|
192
192
|
Created /cookbooks/y
|
@@ -198,11 +198,11 @@ Created /nodes/y.json
|
|
198
198
|
Created /roles/y.json
|
199
199
|
Created /users/y.json
|
200
200
|
EOM
|
201
|
-
knife(
|
201
|
+
knife("diff /").should_succeed ""
|
202
202
|
end
|
203
203
|
|
204
|
-
it
|
205
|
-
knife(
|
204
|
+
it "knife upload --no-diff adds the new files" do
|
205
|
+
knife("upload --no-diff /").should_succeed <<EOM
|
206
206
|
Created /clients/y.json
|
207
207
|
Updated /cookbooks/x
|
208
208
|
Created /cookbooks/y
|
@@ -214,15 +214,15 @@ Created /nodes/y.json
|
|
214
214
|
Created /roles/y.json
|
215
215
|
Created /users/y.json
|
216
216
|
EOM
|
217
|
-
knife(
|
217
|
+
knife("diff --name-status /").should_succeed ""
|
218
218
|
end
|
219
219
|
end
|
220
220
|
end
|
221
221
|
|
222
|
-
when_the_repository
|
223
|
-
it
|
224
|
-
knife(
|
225
|
-
knife(
|
222
|
+
when_the_repository "is empty" do
|
223
|
+
it "knife upload does nothing" do
|
224
|
+
knife("upload /").should_succeed ""
|
225
|
+
knife("diff --name-status /").should_succeed <<EOM
|
226
226
|
D\t/clients
|
227
227
|
D\t/cookbooks
|
228
228
|
D\t/data_bags
|
@@ -233,8 +233,8 @@ D\t/users
|
|
233
233
|
EOM
|
234
234
|
end
|
235
235
|
|
236
|
-
it
|
237
|
-
knife(
|
236
|
+
it "knife upload --purge deletes nothing" do
|
237
|
+
knife("upload --purge /").should_fail <<EOM
|
238
238
|
ERROR: /clients cannot be deleted.
|
239
239
|
ERROR: /cookbooks cannot be deleted.
|
240
240
|
ERROR: /data_bags cannot be deleted.
|
@@ -243,7 +243,7 @@ ERROR: /nodes cannot be deleted.
|
|
243
243
|
ERROR: /roles cannot be deleted.
|
244
244
|
ERROR: /users cannot be deleted.
|
245
245
|
EOM
|
246
|
-
knife(
|
246
|
+
knife("diff --name-status /").should_succeed <<EOM
|
247
247
|
D\t/clients
|
248
248
|
D\t/cookbooks
|
249
249
|
D\t/data_bags
|
@@ -254,178 +254,178 @@ D\t/users
|
|
254
254
|
EOM
|
255
255
|
end
|
256
256
|
|
257
|
-
context
|
257
|
+
context "when current directory is top level" do
|
258
258
|
before do
|
259
|
-
cwd
|
259
|
+
cwd "."
|
260
260
|
end
|
261
261
|
|
262
|
-
it
|
263
|
-
knife(
|
262
|
+
it "knife upload with no parameters reports an error" do
|
263
|
+
knife("upload").should_fail "FATAL: Must specify at least one argument. If you want to upload everything in this directory, type \"knife upload .\"\n", :stdout => /USAGE/
|
264
264
|
end
|
265
265
|
end
|
266
266
|
end
|
267
267
|
end
|
268
268
|
|
269
|
-
when_the_chef_server
|
270
|
-
when_the_repository
|
269
|
+
when_the_chef_server "is empty" do
|
270
|
+
when_the_repository "has a data bag item" do
|
271
271
|
|
272
272
|
before do
|
273
|
-
file
|
273
|
+
file "data_bags/x/y.json", { "foo" => "bar" }
|
274
274
|
end
|
275
275
|
|
276
|
-
it
|
277
|
-
knife(
|
276
|
+
it "knife upload of the data bag uploads only the values in the data bag item and no other" do
|
277
|
+
knife("upload /data_bags/x/y.json").should_succeed <<EOM
|
278
278
|
Created /data_bags/x
|
279
279
|
Created /data_bags/x/y.json
|
280
280
|
EOM
|
281
|
-
knife(
|
281
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
282
282
|
EOM
|
283
|
-
expect(Chef::JSONCompat.parse(knife(
|
283
|
+
expect(Chef::JSONCompat.parse(knife("raw /data/x/y").stdout, :create_additions => false).keys.sort).to eq([ "foo", "id" ])
|
284
284
|
end
|
285
285
|
|
286
|
-
it
|
287
|
-
knife(
|
286
|
+
it "knife upload /data_bags/x /data_bags/x/y.json uploads x once" do
|
287
|
+
knife("upload /data_bags/x /data_bags/x/y.json").should_succeed <<EOM
|
288
288
|
Created /data_bags/x
|
289
289
|
Created /data_bags/x/y.json
|
290
290
|
EOM
|
291
291
|
end
|
292
292
|
end
|
293
293
|
|
294
|
-
when_the_repository
|
294
|
+
when_the_repository "has a data bag item with keys chef_type and data_bag" do
|
295
295
|
|
296
296
|
before do
|
297
|
-
file
|
297
|
+
file "data_bags/x/y.json", { "chef_type" => "aaa", "data_bag" => "bbb" }
|
298
298
|
end
|
299
299
|
|
300
|
-
it
|
301
|
-
knife(
|
300
|
+
it "upload preserves chef_type and data_bag" do
|
301
|
+
knife("upload /data_bags/x/y.json").should_succeed <<EOM
|
302
302
|
Created /data_bags/x
|
303
303
|
Created /data_bags/x/y.json
|
304
304
|
EOM
|
305
|
-
knife(
|
306
|
-
result = Chef::JSONCompat.parse(knife(
|
307
|
-
expect(result.keys.sort).to eq([
|
308
|
-
expect(result[
|
309
|
-
expect(result[
|
305
|
+
knife("diff --name-status /data_bags").should_succeed ""
|
306
|
+
result = Chef::JSONCompat.parse(knife("raw /data/x/y").stdout, :create_additions => false)
|
307
|
+
expect(result.keys.sort).to eq([ "chef_type", "data_bag", "id" ])
|
308
|
+
expect(result["chef_type"]).to eq("aaa")
|
309
|
+
expect(result["data_bag"]).to eq("bbb")
|
310
310
|
end
|
311
311
|
end
|
312
312
|
|
313
313
|
# Test upload of an item when the other end doesn't even have the container
|
314
|
-
when_the_repository
|
314
|
+
when_the_repository "has two data bag items" do
|
315
315
|
before do
|
316
|
-
file
|
317
|
-
file
|
316
|
+
file "data_bags/x/y.json", {}
|
317
|
+
file "data_bags/x/z.json", {}
|
318
318
|
end
|
319
|
-
it
|
320
|
-
knife(
|
319
|
+
it "knife upload of one data bag item itself succeeds" do
|
320
|
+
knife("upload /data_bags/x/y.json").should_succeed <<EOM
|
321
321
|
Created /data_bags/x
|
322
322
|
Created /data_bags/x/y.json
|
323
323
|
EOM
|
324
|
-
knife(
|
324
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
325
325
|
A\t/data_bags/x/z.json
|
326
326
|
EOM
|
327
327
|
end
|
328
328
|
end
|
329
329
|
end
|
330
330
|
|
331
|
-
when_the_chef_server
|
331
|
+
when_the_chef_server "has three data bag items" do
|
332
332
|
|
333
333
|
before do
|
334
|
-
data_bag
|
334
|
+
data_bag "x", { "deleted" => {}, "modified" => {}, "unmodified" => {} }
|
335
335
|
end
|
336
336
|
|
337
|
-
when_the_repository
|
337
|
+
when_the_repository "has a modified, unmodified, added and deleted data bag item" do
|
338
338
|
before do
|
339
|
-
file
|
340
|
-
file
|
341
|
-
file
|
339
|
+
file "data_bags/x/added.json", {}
|
340
|
+
file "data_bags/x/modified.json", { "foo" => "bar" }
|
341
|
+
file "data_bags/x/unmodified.json", {}
|
342
342
|
end
|
343
343
|
|
344
|
-
it
|
345
|
-
knife(
|
344
|
+
it "knife upload of the modified file succeeds" do
|
345
|
+
knife("upload /data_bags/x/modified.json").should_succeed <<EOM
|
346
346
|
Updated /data_bags/x/modified.json
|
347
347
|
EOM
|
348
|
-
knife(
|
348
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
349
349
|
D\t/data_bags/x/deleted.json
|
350
350
|
A\t/data_bags/x/added.json
|
351
351
|
EOM
|
352
352
|
end
|
353
|
-
it
|
354
|
-
knife(
|
355
|
-
knife(
|
353
|
+
it "knife upload of the unmodified file does nothing" do
|
354
|
+
knife("upload /data_bags/x/unmodified.json").should_succeed ""
|
355
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
356
356
|
D\t/data_bags/x/deleted.json
|
357
357
|
M\t/data_bags/x/modified.json
|
358
358
|
A\t/data_bags/x/added.json
|
359
359
|
EOM
|
360
360
|
end
|
361
|
-
it
|
362
|
-
knife(
|
361
|
+
it "knife upload of the added file succeeds" do
|
362
|
+
knife("upload /data_bags/x/added.json").should_succeed <<EOM
|
363
363
|
Created /data_bags/x/added.json
|
364
364
|
EOM
|
365
|
-
knife(
|
365
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
366
366
|
D\t/data_bags/x/deleted.json
|
367
367
|
M\t/data_bags/x/modified.json
|
368
368
|
EOM
|
369
369
|
end
|
370
|
-
it
|
371
|
-
knife(
|
372
|
-
knife(
|
370
|
+
it "knife upload of the deleted file does nothing" do
|
371
|
+
knife("upload /data_bags/x/deleted.json").should_succeed ""
|
372
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
373
373
|
D\t/data_bags/x/deleted.json
|
374
374
|
M\t/data_bags/x/modified.json
|
375
375
|
A\t/data_bags/x/added.json
|
376
376
|
EOM
|
377
377
|
end
|
378
|
-
it
|
379
|
-
knife(
|
378
|
+
it "knife upload --purge of the deleted file deletes it" do
|
379
|
+
knife("upload --purge /data_bags/x/deleted.json").should_succeed <<EOM
|
380
380
|
Deleted extra entry /data_bags/x/deleted.json (purge is on)
|
381
381
|
EOM
|
382
|
-
knife(
|
382
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
383
383
|
M\t/data_bags/x/modified.json
|
384
384
|
A\t/data_bags/x/added.json
|
385
385
|
EOM
|
386
386
|
end
|
387
|
-
it
|
388
|
-
knife(
|
387
|
+
it "knife upload of the entire data bag uploads everything" do
|
388
|
+
knife("upload /data_bags/x").should_succeed <<EOM
|
389
389
|
Created /data_bags/x/added.json
|
390
390
|
Updated /data_bags/x/modified.json
|
391
391
|
EOM
|
392
|
-
knife(
|
392
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
393
393
|
D\t/data_bags/x/deleted.json
|
394
394
|
EOM
|
395
395
|
end
|
396
|
-
it
|
397
|
-
knife(
|
396
|
+
it "knife upload --purge of the entire data bag uploads everything" do
|
397
|
+
knife("upload --purge /data_bags/x").should_succeed <<EOM
|
398
398
|
Created /data_bags/x/added.json
|
399
399
|
Updated /data_bags/x/modified.json
|
400
400
|
Deleted extra entry /data_bags/x/deleted.json (purge is on)
|
401
401
|
EOM
|
402
|
-
knife(
|
402
|
+
knife("diff --name-status /data_bags").should_succeed ""
|
403
403
|
end
|
404
|
-
context
|
404
|
+
context "when cwd is the /data_bags directory" do
|
405
405
|
|
406
406
|
before do
|
407
|
-
cwd
|
407
|
+
cwd "data_bags"
|
408
408
|
end
|
409
409
|
|
410
|
-
it
|
411
|
-
knife(
|
410
|
+
it "knife upload fails" do
|
411
|
+
knife("upload").should_fail "FATAL: Must specify at least one argument. If you want to upload everything in this directory, type \"knife upload .\"\n", :stdout => /USAGE/
|
412
412
|
end
|
413
413
|
|
414
|
-
it
|
415
|
-
knife(
|
414
|
+
it "knife upload --purge . uploads everything" do
|
415
|
+
knife("upload --purge .").should_succeed <<EOM
|
416
416
|
Created x/added.json
|
417
417
|
Updated x/modified.json
|
418
418
|
Deleted extra entry x/deleted.json (purge is on)
|
419
419
|
EOM
|
420
|
-
knife(
|
420
|
+
knife("diff --name-status /data_bags").should_succeed ""
|
421
421
|
end
|
422
|
-
it
|
423
|
-
knife(
|
422
|
+
it "knife upload --purge * uploads everything" do
|
423
|
+
knife("upload --purge *").should_succeed <<EOM
|
424
424
|
Created x/added.json
|
425
425
|
Updated x/modified.json
|
426
426
|
Deleted extra entry x/deleted.json (purge is on)
|
427
427
|
EOM
|
428
|
-
knife(
|
428
|
+
knife("diff --name-status /data_bags").should_succeed ""
|
429
429
|
end
|
430
430
|
end
|
431
431
|
end
|
@@ -434,128 +434,128 @@ EOM
|
|
434
434
|
# Cookbook upload is a funny thing ... direct cookbook upload works, but
|
435
435
|
# upload of a file is designed not to work at present. Make sure that is the
|
436
436
|
# case.
|
437
|
-
when_the_chef_server
|
437
|
+
when_the_chef_server "has a cookbook" do
|
438
438
|
|
439
439
|
before do
|
440
|
-
cookbook
|
440
|
+
cookbook "x", "1.0.0", { "z.rb" => "" }
|
441
441
|
end
|
442
442
|
|
443
|
-
when_the_repository
|
443
|
+
when_the_repository "has a modified, extra and missing file for the cookbook" do
|
444
444
|
before do
|
445
|
-
file
|
446
|
-
file
|
445
|
+
file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0", "#modified")
|
446
|
+
file "cookbooks/x/y.rb", "hi"
|
447
447
|
end
|
448
448
|
|
449
|
-
it
|
450
|
-
knife(
|
451
|
-
knife(
|
452
|
-
knife(
|
449
|
+
it "knife upload of any individual file fails" do
|
450
|
+
knife("upload /cookbooks/x/metadata.rb").should_fail "ERROR: /cookbooks/x/metadata.rb cannot be updated.\n"
|
451
|
+
knife("upload /cookbooks/x/y.rb").should_fail "ERROR: /cookbooks/x cannot have a child created under it.\n"
|
452
|
+
knife("upload --purge /cookbooks/x/z.rb").should_fail "ERROR: /cookbooks/x/z.rb cannot be deleted.\n"
|
453
453
|
end
|
454
454
|
# TODO this is a bit of an inconsistency: if we didn't specify --purge,
|
455
455
|
# technically we shouldn't have deleted missing files. But ... cookbooks
|
456
456
|
# are a special case.
|
457
|
-
it
|
458
|
-
knife(
|
457
|
+
it "knife upload of the cookbook itself succeeds" do
|
458
|
+
knife("upload /cookbooks/x").should_succeed <<EOM
|
459
459
|
Updated /cookbooks/x
|
460
460
|
EOM
|
461
|
-
knife(
|
461
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
462
462
|
end
|
463
|
-
it
|
464
|
-
knife(
|
463
|
+
it "knife upload --purge of the cookbook itself succeeds" do
|
464
|
+
knife("upload /cookbooks/x").should_succeed <<EOM
|
465
465
|
Updated /cookbooks/x
|
466
466
|
EOM
|
467
|
-
knife(
|
467
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
468
468
|
end
|
469
469
|
end
|
470
|
-
when_the_repository
|
470
|
+
when_the_repository "has a missing file for the cookbook" do
|
471
471
|
|
472
472
|
before do
|
473
|
-
file
|
473
|
+
file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0")
|
474
474
|
end
|
475
475
|
|
476
|
-
it
|
477
|
-
knife(
|
476
|
+
it "knife upload of the cookbook succeeds" do
|
477
|
+
knife("upload /cookbooks/x").should_succeed <<EOM
|
478
478
|
Updated /cookbooks/x
|
479
479
|
EOM
|
480
|
-
knife(
|
480
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
481
481
|
end
|
482
482
|
end
|
483
|
-
when_the_repository
|
483
|
+
when_the_repository "has an extra file for the cookbook" do
|
484
484
|
|
485
485
|
before do
|
486
|
-
file
|
487
|
-
file
|
488
|
-
file
|
486
|
+
file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0")
|
487
|
+
file "cookbooks/x/z.rb", ""
|
488
|
+
file "cookbooks/x/blah.rb", ""
|
489
489
|
end
|
490
490
|
|
491
|
-
it
|
492
|
-
knife(
|
491
|
+
it "knife upload of the cookbook succeeds" do
|
492
|
+
knife("upload /cookbooks/x").should_succeed <<EOM
|
493
493
|
Updated /cookbooks/x
|
494
494
|
EOM
|
495
|
-
knife(
|
495
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
496
496
|
end
|
497
497
|
end
|
498
498
|
|
499
|
-
when_the_repository
|
499
|
+
when_the_repository "has a different file in the cookbook" do
|
500
500
|
before do
|
501
|
-
file
|
501
|
+
file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0")
|
502
502
|
end
|
503
503
|
|
504
|
-
it
|
505
|
-
knife(
|
504
|
+
it "knife upload --freeze freezes the cookbook" do
|
505
|
+
knife("upload --freeze /cookbooks/x").should_succeed <<EOM
|
506
506
|
Updated /cookbooks/x
|
507
507
|
EOM
|
508
508
|
# Modify a file and attempt to upload
|
509
|
-
file
|
510
|
-
knife(
|
509
|
+
file "cookbooks/x/metadata.rb", 'name "x"; version "1.0.0"#different'
|
510
|
+
knife("upload /cookbooks/x").should_fail "ERROR: /cookbooks failed to write: Cookbook x is frozen\n"
|
511
511
|
end
|
512
512
|
end
|
513
513
|
end
|
514
514
|
|
515
|
-
when_the_chef_server
|
515
|
+
when_the_chef_server "has a frozen cookbook" do
|
516
516
|
before do
|
517
|
-
cookbook
|
517
|
+
cookbook "frozencook", "1.0.0", {}, :frozen => true
|
518
518
|
end
|
519
519
|
|
520
|
-
when_the_repository
|
520
|
+
when_the_repository "has an update to said cookbook" do
|
521
521
|
|
522
522
|
before do
|
523
|
-
file
|
523
|
+
file "cookbooks/frozencook/metadata.rb", cb_metadata("frozencook", "1.0.0", "# This is different")
|
524
524
|
end
|
525
525
|
|
526
|
-
it
|
527
|
-
knife(
|
526
|
+
it "knife upload fails to upload the frozen cookbook" do
|
527
|
+
knife("upload /cookbooks/frozencook").should_fail "ERROR: /cookbooks failed to write: Cookbook frozencook is frozen\n"
|
528
528
|
end
|
529
|
-
it
|
530
|
-
knife(
|
529
|
+
it "knife upload --force uploads the frozen cookbook" do
|
530
|
+
knife("upload --force /cookbooks/frozencook").should_succeed <<EOM
|
531
531
|
Updated /cookbooks/frozencook
|
532
532
|
EOM
|
533
533
|
end
|
534
534
|
end
|
535
535
|
end
|
536
536
|
|
537
|
-
when_the_repository
|
537
|
+
when_the_repository "has a cookbook" do
|
538
538
|
before do
|
539
|
-
file
|
540
|
-
file
|
539
|
+
file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0")
|
540
|
+
file "cookbooks/x/onlyin1.0.0.rb", "old_text"
|
541
541
|
end
|
542
542
|
|
543
|
-
when_the_chef_server
|
543
|
+
when_the_chef_server "has a later version for the cookbook" do
|
544
544
|
before do
|
545
|
-
cookbook
|
546
|
-
cookbook
|
545
|
+
cookbook "x", "1.0.0", { "onlyin1.0.0.rb" => "" }
|
546
|
+
cookbook "x", "1.0.1", { "onlyin1.0.1.rb" => "hi" }
|
547
547
|
end
|
548
548
|
|
549
|
-
it
|
550
|
-
knife(
|
549
|
+
it "knife upload /cookbooks/x uploads the local version" do
|
550
|
+
knife("diff --name-status /cookbooks").should_succeed <<EOM
|
551
551
|
M\t/cookbooks/x/metadata.rb
|
552
552
|
D\t/cookbooks/x/onlyin1.0.1.rb
|
553
553
|
A\t/cookbooks/x/onlyin1.0.0.rb
|
554
554
|
EOM
|
555
|
-
knife(
|
555
|
+
knife("upload --purge /cookbooks/x").should_succeed <<EOM
|
556
556
|
Updated /cookbooks/x
|
557
557
|
EOM
|
558
|
-
knife(
|
558
|
+
knife("diff --name-status /cookbooks").should_succeed <<EOM
|
559
559
|
M\t/cookbooks/x/metadata.rb
|
560
560
|
D\t/cookbooks/x/onlyin1.0.1.rb
|
561
561
|
A\t/cookbooks/x/onlyin1.0.0.rb
|
@@ -563,35 +563,35 @@ EOM
|
|
563
563
|
end
|
564
564
|
end
|
565
565
|
|
566
|
-
when_the_chef_server
|
566
|
+
when_the_chef_server "has an earlier version for the cookbook" do
|
567
567
|
before do
|
568
|
-
cookbook
|
569
|
-
cookbook
|
568
|
+
cookbook "x", "1.0.0", { "onlyin1.0.0.rb" => "" }
|
569
|
+
cookbook "x", "0.9.9", { "onlyin0.9.9.rb" => "hi" }
|
570
570
|
end
|
571
571
|
|
572
|
-
it
|
573
|
-
knife(
|
572
|
+
it "knife upload /cookbooks/x uploads the local version" do
|
573
|
+
knife("upload --purge /cookbooks/x").should_succeed <<EOM
|
574
574
|
Updated /cookbooks/x
|
575
575
|
EOM
|
576
|
-
knife(
|
576
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
577
577
|
end
|
578
578
|
end
|
579
579
|
|
580
|
-
when_the_chef_server
|
580
|
+
when_the_chef_server "has a later version for the cookbook, and no current version" do
|
581
581
|
before do
|
582
|
-
cookbook
|
582
|
+
cookbook "x", "1.0.1", { "onlyin1.0.1.rb" => "hi" }
|
583
583
|
end
|
584
584
|
|
585
|
-
it
|
586
|
-
knife(
|
585
|
+
it "knife upload /cookbooks/x uploads the local version" do
|
586
|
+
knife("diff --name-status /cookbooks").should_succeed <<EOM
|
587
587
|
M\t/cookbooks/x/metadata.rb
|
588
588
|
D\t/cookbooks/x/onlyin1.0.1.rb
|
589
589
|
A\t/cookbooks/x/onlyin1.0.0.rb
|
590
590
|
EOM
|
591
|
-
knife(
|
591
|
+
knife("upload --purge /cookbooks/x").should_succeed <<EOM
|
592
592
|
Updated /cookbooks/x
|
593
593
|
EOM
|
594
|
-
knife(
|
594
|
+
knife("diff --name-status /cookbooks").should_succeed <<EOM
|
595
595
|
M\t/cookbooks/x/metadata.rb
|
596
596
|
D\t/cookbooks/x/onlyin1.0.1.rb
|
597
597
|
A\t/cookbooks/x/onlyin1.0.0.rb
|
@@ -599,31 +599,31 @@ EOM
|
|
599
599
|
end
|
600
600
|
end
|
601
601
|
|
602
|
-
when_the_chef_server
|
602
|
+
when_the_chef_server "has an earlier version for the cookbook, and no current version" do
|
603
603
|
before do
|
604
|
-
cookbook
|
604
|
+
cookbook "x", "0.9.9", { "onlyin0.9.9.rb" => "hi" }
|
605
605
|
end
|
606
606
|
|
607
|
-
it
|
608
|
-
knife(
|
607
|
+
it "knife upload /cookbooks/x uploads the new version" do
|
608
|
+
knife("upload --purge /cookbooks/x").should_succeed <<EOM
|
609
609
|
Updated /cookbooks/x
|
610
610
|
EOM
|
611
|
-
knife(
|
611
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
612
612
|
end
|
613
613
|
end
|
614
614
|
end
|
615
615
|
|
616
|
-
when_the_chef_server
|
616
|
+
when_the_chef_server "has an environment" do
|
617
617
|
before do
|
618
|
-
environment
|
618
|
+
environment "x", {}
|
619
619
|
end
|
620
620
|
|
621
|
-
when_the_repository
|
621
|
+
when_the_repository "has an environment with bad JSON" do
|
622
622
|
before do
|
623
|
-
file
|
623
|
+
file "environments/x.json", "{"
|
624
624
|
end
|
625
625
|
|
626
|
-
it
|
626
|
+
it "knife upload tries and fails" do
|
627
627
|
error1 = <<-EOH
|
628
628
|
WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error: premature EOF
|
629
629
|
{
|
@@ -640,75 +640,75 @@ WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error
|
|
640
640
|
(right here) ------^
|
641
641
|
|
642
642
|
EOH
|
643
|
-
knife(
|
644
|
-
knife(
|
643
|
+
knife("upload /environments/x.json").should_fail(error1)
|
644
|
+
knife("diff --name-status /environments/x.json").should_succeed("M\t/environments/x.json\n", :stderr => warn)
|
645
645
|
end
|
646
646
|
end
|
647
647
|
|
648
|
-
when_the_repository
|
648
|
+
when_the_repository "has the same environment with the wrong name in the file" do
|
649
649
|
before do
|
650
|
-
file
|
650
|
+
file "environments/x.json", { "name" => "y" }
|
651
651
|
end
|
652
|
-
it
|
653
|
-
knife(
|
654
|
-
knife(
|
652
|
+
it "knife upload fails" do
|
653
|
+
knife("upload /environments/x.json").should_fail "ERROR: /environments/x.json failed to write: Name must be 'x' (is 'y')\n"
|
654
|
+
knife("diff --name-status /environments/x.json").should_succeed "M\t/environments/x.json\n"
|
655
655
|
end
|
656
656
|
end
|
657
657
|
|
658
|
-
when_the_repository
|
658
|
+
when_the_repository "has the same environment with no name in the file" do
|
659
659
|
before do
|
660
|
-
file
|
660
|
+
file "environments/x.json", { "description" => "hi" }
|
661
661
|
end
|
662
|
-
it
|
663
|
-
knife(
|
664
|
-
knife(
|
662
|
+
it "knife upload succeeds" do
|
663
|
+
knife("upload /environments/x.json").should_succeed "Updated /environments/x.json\n"
|
664
|
+
knife("diff --name-status /environments/x.json").should_succeed ""
|
665
665
|
end
|
666
666
|
end
|
667
667
|
end
|
668
668
|
|
669
|
-
when_the_chef_server
|
669
|
+
when_the_chef_server "is empty" do
|
670
670
|
|
671
|
-
when_the_repository
|
671
|
+
when_the_repository "has an environment with the wrong name in the file" do
|
672
672
|
before do
|
673
|
-
file
|
673
|
+
file "environments/x.json", { "name" => "y" }
|
674
674
|
end
|
675
|
-
it
|
676
|
-
knife(
|
677
|
-
knife(
|
675
|
+
it "knife upload fails" do
|
676
|
+
knife("upload /environments/x.json").should_fail "ERROR: /environments failed to create_child: Error creating 'x.json': Name must be 'x' (is 'y')\n"
|
677
|
+
knife("diff --name-status /environments/x.json").should_succeed "A\t/environments/x.json\n"
|
678
678
|
end
|
679
679
|
end
|
680
680
|
|
681
|
-
when_the_repository
|
681
|
+
when_the_repository "has an environment with no name in the file" do
|
682
682
|
|
683
683
|
before do
|
684
|
-
file
|
684
|
+
file "environments/x.json", { "description" => "hi" }
|
685
685
|
end
|
686
|
-
it
|
687
|
-
knife(
|
688
|
-
knife(
|
686
|
+
it "knife upload succeeds" do
|
687
|
+
knife("upload /environments/x.json").should_succeed "Created /environments/x.json\n"
|
688
|
+
knife("diff --name-status /environments/x.json").should_succeed ""
|
689
689
|
end
|
690
690
|
end
|
691
691
|
|
692
|
-
when_the_repository
|
692
|
+
when_the_repository "has a data bag with no id in the file" do
|
693
693
|
before do
|
694
|
-
file
|
694
|
+
file "data_bags/bag/x.json", { "foo" => "bar" }
|
695
695
|
end
|
696
|
-
it
|
697
|
-
knife(
|
698
|
-
knife(
|
696
|
+
it "knife upload succeeds" do
|
697
|
+
knife("upload /data_bags/bag/x.json").should_succeed "Created /data_bags/bag\nCreated /data_bags/bag/x.json\n"
|
698
|
+
knife("diff --name-status /data_bags/bag/x.json").should_succeed ""
|
699
699
|
end
|
700
700
|
end
|
701
701
|
end
|
702
702
|
when_the_chef_server "is empty" do
|
703
|
-
when_the_repository
|
703
|
+
when_the_repository "has a cookbook with an invalid chef_version constraint in it" do
|
704
704
|
before do
|
705
|
-
file
|
705
|
+
file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0", "\nchef_version '~> 999.0'")
|
706
706
|
end
|
707
|
-
it
|
708
|
-
knife(
|
707
|
+
it "knife upload succeeds" do
|
708
|
+
knife("upload /cookbooks/x").should_succeed <<EOM
|
709
709
|
Created /cookbooks/x
|
710
710
|
EOM
|
711
|
-
knife(
|
711
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
712
712
|
end
|
713
713
|
end
|
714
714
|
end
|
@@ -718,29 +718,29 @@ EOM
|
|
718
718
|
when_the_chef_server "has one of each thing" do
|
719
719
|
|
720
720
|
before do
|
721
|
-
client
|
722
|
-
cookbook
|
723
|
-
data_bag
|
724
|
-
environment
|
725
|
-
node
|
726
|
-
role
|
727
|
-
user
|
721
|
+
client "x", {}
|
722
|
+
cookbook "x", "1.0.0"
|
723
|
+
data_bag "x", { "y" => {} }
|
724
|
+
environment "x", {}
|
725
|
+
node "x", {}
|
726
|
+
role "x", {}
|
727
|
+
user "x", {}
|
728
728
|
end
|
729
729
|
|
730
|
-
when_the_repository
|
730
|
+
when_the_repository "has only top-level directories" do
|
731
731
|
before do
|
732
|
-
directory
|
733
|
-
directory
|
734
|
-
directory
|
735
|
-
directory
|
736
|
-
directory
|
737
|
-
directory
|
738
|
-
directory
|
739
|
-
end
|
740
|
-
|
741
|
-
it
|
742
|
-
knife(
|
743
|
-
knife(
|
732
|
+
directory "clients"
|
733
|
+
directory "cookbooks"
|
734
|
+
directory "data_bags"
|
735
|
+
directory "environments"
|
736
|
+
directory "nodes"
|
737
|
+
directory "roles"
|
738
|
+
directory "users"
|
739
|
+
end
|
740
|
+
|
741
|
+
it "knife upload does nothing" do
|
742
|
+
knife("upload /").should_succeed ""
|
743
|
+
knife("diff --name-status /").should_succeed <<EOM
|
744
744
|
D\t/clients/chef-validator.json
|
745
745
|
D\t/clients/chef-webui.json
|
746
746
|
D\t/clients/x.json
|
@@ -755,8 +755,8 @@ D\t/users/x.json
|
|
755
755
|
EOM
|
756
756
|
end
|
757
757
|
|
758
|
-
it
|
759
|
-
knife(
|
758
|
+
it "knife upload --purge deletes everything" do
|
759
|
+
knife("upload --purge /").should_succeed(<<EOM, :stderr => "WARNING: /environments/_default.json cannot be deleted (default environment cannot be modified).\n")
|
760
760
|
Deleted extra entry /clients/chef-validator.json (purge is on)
|
761
761
|
Deleted extra entry /clients/chef-webui.json (purge is on)
|
762
762
|
Deleted extra entry /clients/x.json (purge is on)
|
@@ -768,52 +768,52 @@ Deleted extra entry /roles/x.json (purge is on)
|
|
768
768
|
Deleted extra entry /users/admin.json (purge is on)
|
769
769
|
Deleted extra entry /users/x.json (purge is on)
|
770
770
|
EOM
|
771
|
-
knife(
|
771
|
+
knife("diff --name-status /").should_succeed <<EOM
|
772
772
|
D\t/environments/_default.json
|
773
773
|
EOM
|
774
774
|
end
|
775
775
|
end
|
776
776
|
|
777
|
-
when_the_repository
|
777
|
+
when_the_repository "has an identical copy of each thing" do
|
778
778
|
before do
|
779
|
-
file
|
780
|
-
file
|
781
|
-
file
|
782
|
-
file
|
783
|
-
file
|
784
|
-
file
|
785
|
-
file
|
786
|
-
file
|
787
|
-
file
|
788
|
-
file
|
789
|
-
file
|
779
|
+
file "clients/chef-validator.json", { "validator" => true, "public_key" => ChefZero::PUBLIC_KEY }
|
780
|
+
file "clients/chef-webui.json", { "admin" => true, "public_key" => ChefZero::PUBLIC_KEY }
|
781
|
+
file "clients/x.json", { "public_key" => ChefZero::PUBLIC_KEY }
|
782
|
+
file "cookbooks/x-1.0.0/metadata.rb", cb_metadata("x", "1.0.0")
|
783
|
+
file "data_bags/x/y.json", {}
|
784
|
+
file "environments/_default.json", { "description" => "The default Chef environment" }
|
785
|
+
file "environments/x.json", {}
|
786
|
+
file "nodes/x.json", {}
|
787
|
+
file "roles/x.json", {}
|
788
|
+
file "users/admin.json", { "admin" => true, "public_key" => ChefZero::PUBLIC_KEY }
|
789
|
+
file "users/x.json", { "public_key" => ChefZero::PUBLIC_KEY }
|
790
790
|
end
|
791
791
|
|
792
|
-
it
|
793
|
-
knife(
|
794
|
-
knife(
|
792
|
+
it "knife upload makes no changes" do
|
793
|
+
knife("upload /cookbooks/x-1.0.0").should_succeed ""
|
794
|
+
knife("diff --name-status /").should_succeed ""
|
795
795
|
end
|
796
796
|
|
797
|
-
it
|
798
|
-
knife(
|
799
|
-
knife(
|
797
|
+
it "knife upload --purge makes no changes" do
|
798
|
+
knife("upload --purge /").should_succeed ""
|
799
|
+
knife("diff --name-status /").should_succeed ""
|
800
800
|
end
|
801
801
|
|
802
|
-
context
|
802
|
+
context "except the role file" do
|
803
803
|
before do
|
804
|
-
file
|
804
|
+
file "roles/x.json", { "description" => "blarghle" }
|
805
805
|
end
|
806
806
|
|
807
|
-
it
|
808
|
-
knife(
|
809
|
-
knife(
|
807
|
+
it "knife upload changes the role" do
|
808
|
+
knife("upload /").should_succeed "Updated /roles/x.json\n"
|
809
|
+
knife("diff --name-status /").should_succeed ""
|
810
810
|
end
|
811
811
|
end
|
812
812
|
|
813
|
-
context
|
813
|
+
context "except the role file is textually different, but not ACTUALLY different" do
|
814
814
|
|
815
815
|
before do
|
816
|
-
file
|
816
|
+
file "roles/x.json", <<EOM
|
817
817
|
{
|
818
818
|
"chef_type": "role",
|
819
819
|
"default_attributes": {
|
@@ -832,28 +832,28 @@ EOM
|
|
832
832
|
EOM
|
833
833
|
end
|
834
834
|
|
835
|
-
it
|
836
|
-
knife(
|
837
|
-
knife(
|
835
|
+
it "knife upload / does not change anything" do
|
836
|
+
knife("upload /").should_succeed ""
|
837
|
+
knife("diff --name-status /").should_succeed ""
|
838
838
|
end
|
839
839
|
end
|
840
840
|
|
841
|
-
context
|
841
|
+
context "as well as one extra copy of each thing" do
|
842
842
|
before do
|
843
|
-
file
|
844
|
-
file
|
845
|
-
file
|
846
|
-
file
|
847
|
-
file
|
848
|
-
file
|
849
|
-
file
|
850
|
-
file
|
851
|
-
file
|
852
|
-
file
|
843
|
+
file "clients/y.json", { "public_key" => ChefZero::PUBLIC_KEY }
|
844
|
+
file "cookbooks/x-1.0.0/blah.rb", ""
|
845
|
+
file "cookbooks/x-2.0.0/metadata.rb", cb_metadata("x", "2.0.0")
|
846
|
+
file "cookbooks/y-1.0.0/metadata.rb", cb_metadata("y", "1.0.0")
|
847
|
+
file "data_bags/x/z.json", {}
|
848
|
+
file "data_bags/y/zz.json", {}
|
849
|
+
file "environments/y.json", {}
|
850
|
+
file "nodes/y.json", {}
|
851
|
+
file "roles/y.json", {}
|
852
|
+
file "users/y.json", { "public_key" => ChefZero::PUBLIC_KEY }
|
853
853
|
end
|
854
854
|
|
855
|
-
it
|
856
|
-
knife(
|
855
|
+
it "knife upload adds the new files" do
|
856
|
+
knife("upload /").should_succeed <<EOM
|
857
857
|
Created /clients/y.json
|
858
858
|
Updated /cookbooks/x-1.0.0
|
859
859
|
Created /cookbooks/x-2.0.0
|
@@ -866,15 +866,15 @@ Created /nodes/y.json
|
|
866
866
|
Created /roles/y.json
|
867
867
|
Created /users/y.json
|
868
868
|
EOM
|
869
|
-
knife(
|
869
|
+
knife("diff --name-status /").should_succeed ""
|
870
870
|
end
|
871
871
|
end
|
872
872
|
end
|
873
873
|
|
874
|
-
when_the_repository
|
875
|
-
it
|
876
|
-
knife(
|
877
|
-
knife(
|
874
|
+
when_the_repository "is empty" do
|
875
|
+
it "knife upload does nothing" do
|
876
|
+
knife("upload /").should_succeed ""
|
877
|
+
knife("diff --name-status /").should_succeed <<EOM
|
878
878
|
D\t/clients
|
879
879
|
D\t/cookbooks
|
880
880
|
D\t/data_bags
|
@@ -885,8 +885,8 @@ D\t/users
|
|
885
885
|
EOM
|
886
886
|
end
|
887
887
|
|
888
|
-
it
|
889
|
-
knife(
|
888
|
+
it "knife upload --purge deletes nothing" do
|
889
|
+
knife("upload --purge /").should_fail <<EOM
|
890
890
|
ERROR: /clients cannot be deleted.
|
891
891
|
ERROR: /cookbooks cannot be deleted.
|
892
892
|
ERROR: /data_bags cannot be deleted.
|
@@ -895,7 +895,7 @@ ERROR: /nodes cannot be deleted.
|
|
895
895
|
ERROR: /roles cannot be deleted.
|
896
896
|
ERROR: /users cannot be deleted.
|
897
897
|
EOM
|
898
|
-
knife(
|
898
|
+
knife("diff --name-status /").should_succeed <<EOM
|
899
899
|
D\t/clients
|
900
900
|
D\t/cookbooks
|
901
901
|
D\t/data_bags
|
@@ -906,130 +906,130 @@ D\t/users
|
|
906
906
|
EOM
|
907
907
|
end
|
908
908
|
|
909
|
-
context
|
909
|
+
context "when current directory is top level" do
|
910
910
|
before do
|
911
|
-
cwd
|
911
|
+
cwd "."
|
912
912
|
end
|
913
|
-
it
|
914
|
-
knife(
|
913
|
+
it "knife upload with no parameters reports an error" do
|
914
|
+
knife("upload").should_fail "FATAL: Must specify at least one argument. If you want to upload everything in this directory, type \"knife upload .\"\n", :stdout => /USAGE/
|
915
915
|
end
|
916
916
|
end
|
917
917
|
end
|
918
918
|
end
|
919
919
|
|
920
920
|
# Test upload of an item when the other end doesn't even have the container
|
921
|
-
when_the_chef_server
|
922
|
-
when_the_repository
|
921
|
+
when_the_chef_server "is empty" do
|
922
|
+
when_the_repository "has two data bag items" do
|
923
923
|
before do
|
924
|
-
file
|
925
|
-
file
|
924
|
+
file "data_bags/x/y.json", {}
|
925
|
+
file "data_bags/x/z.json", {}
|
926
926
|
end
|
927
927
|
|
928
|
-
it
|
929
|
-
knife(
|
928
|
+
it "knife upload of one data bag item itself succeeds" do
|
929
|
+
knife("upload /data_bags/x/y.json").should_succeed <<EOM
|
930
930
|
Created /data_bags/x
|
931
931
|
Created /data_bags/x/y.json
|
932
932
|
EOM
|
933
|
-
knife(
|
933
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
934
934
|
A\t/data_bags/x/z.json
|
935
935
|
EOM
|
936
936
|
end
|
937
937
|
end
|
938
938
|
end
|
939
939
|
|
940
|
-
when_the_chef_server
|
940
|
+
when_the_chef_server "has three data bag items" do
|
941
941
|
before do
|
942
|
-
data_bag
|
942
|
+
data_bag "x", { "deleted" => {}, "modified" => {}, "unmodified" => {} }
|
943
943
|
end
|
944
|
-
when_the_repository
|
944
|
+
when_the_repository "has a modified, unmodified, added and deleted data bag item" do
|
945
945
|
before do
|
946
|
-
file
|
947
|
-
file
|
948
|
-
file
|
946
|
+
file "data_bags/x/added.json", {}
|
947
|
+
file "data_bags/x/modified.json", { "foo" => "bar" }
|
948
|
+
file "data_bags/x/unmodified.json", {}
|
949
949
|
end
|
950
950
|
|
951
|
-
it
|
952
|
-
knife(
|
951
|
+
it "knife upload of the modified file succeeds" do
|
952
|
+
knife("upload /data_bags/x/modified.json").should_succeed <<EOM
|
953
953
|
Updated /data_bags/x/modified.json
|
954
954
|
EOM
|
955
|
-
knife(
|
955
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
956
956
|
D\t/data_bags/x/deleted.json
|
957
957
|
A\t/data_bags/x/added.json
|
958
958
|
EOM
|
959
959
|
end
|
960
|
-
it
|
961
|
-
knife(
|
962
|
-
knife(
|
960
|
+
it "knife upload of the unmodified file does nothing" do
|
961
|
+
knife("upload /data_bags/x/unmodified.json").should_succeed ""
|
962
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
963
963
|
D\t/data_bags/x/deleted.json
|
964
964
|
M\t/data_bags/x/modified.json
|
965
965
|
A\t/data_bags/x/added.json
|
966
966
|
EOM
|
967
967
|
end
|
968
|
-
it
|
969
|
-
knife(
|
968
|
+
it "knife upload of the added file succeeds" do
|
969
|
+
knife("upload /data_bags/x/added.json").should_succeed <<EOM
|
970
970
|
Created /data_bags/x/added.json
|
971
971
|
EOM
|
972
|
-
knife(
|
972
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
973
973
|
D\t/data_bags/x/deleted.json
|
974
974
|
M\t/data_bags/x/modified.json
|
975
975
|
EOM
|
976
976
|
end
|
977
|
-
it
|
978
|
-
knife(
|
979
|
-
knife(
|
977
|
+
it "knife upload of the deleted file does nothing" do
|
978
|
+
knife("upload /data_bags/x/deleted.json").should_succeed ""
|
979
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
980
980
|
D\t/data_bags/x/deleted.json
|
981
981
|
M\t/data_bags/x/modified.json
|
982
982
|
A\t/data_bags/x/added.json
|
983
983
|
EOM
|
984
984
|
end
|
985
|
-
it
|
986
|
-
knife(
|
985
|
+
it "knife upload --purge of the deleted file deletes it" do
|
986
|
+
knife("upload --purge /data_bags/x/deleted.json").should_succeed <<EOM
|
987
987
|
Deleted extra entry /data_bags/x/deleted.json (purge is on)
|
988
988
|
EOM
|
989
|
-
knife(
|
989
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
990
990
|
M\t/data_bags/x/modified.json
|
991
991
|
A\t/data_bags/x/added.json
|
992
992
|
EOM
|
993
993
|
end
|
994
|
-
it
|
995
|
-
knife(
|
994
|
+
it "knife upload of the entire data bag uploads everything" do
|
995
|
+
knife("upload /data_bags/x").should_succeed <<EOM
|
996
996
|
Created /data_bags/x/added.json
|
997
997
|
Updated /data_bags/x/modified.json
|
998
998
|
EOM
|
999
|
-
knife(
|
999
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
1000
1000
|
D\t/data_bags/x/deleted.json
|
1001
1001
|
EOM
|
1002
1002
|
end
|
1003
|
-
it
|
1004
|
-
knife(
|
1003
|
+
it "knife upload --purge of the entire data bag uploads everything" do
|
1004
|
+
knife("upload --purge /data_bags/x").should_succeed <<EOM
|
1005
1005
|
Created /data_bags/x/added.json
|
1006
1006
|
Updated /data_bags/x/modified.json
|
1007
1007
|
Deleted extra entry /data_bags/x/deleted.json (purge is on)
|
1008
1008
|
EOM
|
1009
|
-
knife(
|
1009
|
+
knife("diff --name-status /data_bags").should_succeed ""
|
1010
1010
|
end
|
1011
|
-
context
|
1011
|
+
context "when cwd is the /data_bags directory" do
|
1012
1012
|
before do
|
1013
|
-
cwd
|
1013
|
+
cwd "data_bags"
|
1014
1014
|
end
|
1015
|
-
it
|
1016
|
-
knife(
|
1015
|
+
it "knife upload fails" do
|
1016
|
+
knife("upload").should_fail "FATAL: Must specify at least one argument. If you want to upload everything in this directory, type \"knife upload .\"\n", :stdout => /USAGE/
|
1017
1017
|
end
|
1018
|
-
it
|
1019
|
-
knife(
|
1018
|
+
it "knife upload --purge . uploads everything" do
|
1019
|
+
knife("upload --purge .").should_succeed <<EOM
|
1020
1020
|
Created x/added.json
|
1021
1021
|
Updated x/modified.json
|
1022
1022
|
Deleted extra entry x/deleted.json (purge is on)
|
1023
1023
|
EOM
|
1024
|
-
knife(
|
1024
|
+
knife("diff --name-status /data_bags").should_succeed ""
|
1025
1025
|
end
|
1026
|
-
it
|
1027
|
-
knife(
|
1026
|
+
it "knife upload --purge * uploads everything" do
|
1027
|
+
knife("upload --purge *").should_succeed <<EOM
|
1028
1028
|
Created x/added.json
|
1029
1029
|
Updated x/modified.json
|
1030
1030
|
Deleted extra entry x/deleted.json (purge is on)
|
1031
1031
|
EOM
|
1032
|
-
knife(
|
1032
|
+
knife("diff --name-status /data_bags").should_succeed ""
|
1033
1033
|
end
|
1034
1034
|
end
|
1035
1035
|
end
|
@@ -1038,270 +1038,275 @@ EOM
|
|
1038
1038
|
# Cookbook upload is a funny thing ... direct cookbook upload works, but
|
1039
1039
|
# upload of a file is designed not to work at present. Make sure that is the
|
1040
1040
|
# case.
|
1041
|
-
when_the_chef_server
|
1041
|
+
when_the_chef_server "has a cookbook" do
|
1042
1042
|
before do
|
1043
|
-
cookbook
|
1043
|
+
cookbook "x", "1.0.0", { "z.rb" => "" }
|
1044
1044
|
end
|
1045
1045
|
|
1046
|
-
when_the_repository
|
1046
|
+
when_the_repository "has a modified, extra and missing file for the cookbook" do
|
1047
1047
|
before do
|
1048
|
-
file
|
1049
|
-
file
|
1048
|
+
file "cookbooks/x-1.0.0/metadata.rb", cb_metadata("x", "1.0.0", '#modified')
|
1049
|
+
file "cookbooks/x-1.0.0/y.rb", "hi"
|
1050
1050
|
end
|
1051
1051
|
|
1052
|
-
it
|
1053
|
-
knife(
|
1054
|
-
knife(
|
1055
|
-
knife(
|
1052
|
+
it "knife upload of any individual file fails" do
|
1053
|
+
knife("upload /cookbooks/x-1.0.0/metadata.rb").should_fail "ERROR: /cookbooks/x-1.0.0/metadata.rb cannot be updated.\n"
|
1054
|
+
knife("upload /cookbooks/x-1.0.0/y.rb").should_fail "ERROR: /cookbooks/x-1.0.0 cannot have a child created under it.\n"
|
1055
|
+
knife("upload --purge /cookbooks/x-1.0.0/z.rb").should_fail "ERROR: /cookbooks/x-1.0.0/z.rb cannot be deleted.\n"
|
1056
1056
|
end
|
1057
1057
|
|
1058
1058
|
# TODO this is a bit of an inconsistency: if we didn't specify --purge,
|
1059
1059
|
# technically we shouldn't have deleted missing files. But ... cookbooks
|
1060
1060
|
# are a special case.
|
1061
|
-
it
|
1062
|
-
knife(
|
1061
|
+
it "knife upload of the cookbook itself succeeds" do
|
1062
|
+
knife("upload /cookbooks/x-1.0.0").should_succeed <<EOM
|
1063
1063
|
Updated /cookbooks/x-1.0.0
|
1064
1064
|
EOM
|
1065
|
-
knife(
|
1065
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
1066
1066
|
end
|
1067
1067
|
|
1068
|
-
it
|
1069
|
-
knife(
|
1068
|
+
it "knife upload --purge of the cookbook itself succeeds" do
|
1069
|
+
knife("upload /cookbooks/x-1.0.0").should_succeed <<EOM
|
1070
1070
|
Updated /cookbooks/x-1.0.0
|
1071
1071
|
EOM
|
1072
|
-
knife(
|
1072
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
1073
1073
|
end
|
1074
1074
|
end
|
1075
1075
|
|
1076
|
-
when_the_repository
|
1076
|
+
when_the_repository "has a missing file for the cookbook" do
|
1077
1077
|
before do
|
1078
|
-
file
|
1078
|
+
file "cookbooks/x-1.0.0/metadata.rb", cb_metadata("x", "1.0.0")
|
1079
1079
|
end
|
1080
1080
|
|
1081
|
-
it
|
1082
|
-
knife(
|
1081
|
+
it "knife upload of the cookbook succeeds" do
|
1082
|
+
knife("upload /cookbooks/x-1.0.0").should_succeed <<EOM
|
1083
1083
|
Updated /cookbooks/x-1.0.0
|
1084
1084
|
EOM
|
1085
|
-
knife(
|
1085
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
1086
1086
|
end
|
1087
1087
|
end
|
1088
1088
|
|
1089
|
-
when_the_repository
|
1089
|
+
when_the_repository "has an extra file for the cookbook" do
|
1090
1090
|
before do
|
1091
|
-
file
|
1092
|
-
file
|
1093
|
-
file
|
1091
|
+
file "cookbooks/x-1.0.0/metadata.rb", cb_metadata("x", "1.0.0")
|
1092
|
+
file "cookbooks/x-1.0.0/z.rb", ""
|
1093
|
+
file "cookbooks/x-1.0.0/blah.rb", ""
|
1094
1094
|
end
|
1095
1095
|
|
1096
|
-
it
|
1097
|
-
knife(
|
1096
|
+
it "knife upload of the cookbook succeeds" do
|
1097
|
+
knife("upload /cookbooks/x-1.0.0").should_succeed <<EOM
|
1098
1098
|
Updated /cookbooks/x-1.0.0
|
1099
1099
|
EOM
|
1100
|
-
knife(
|
1100
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
1101
1101
|
end
|
1102
1102
|
end
|
1103
1103
|
end
|
1104
1104
|
|
1105
|
-
when_the_repository
|
1105
|
+
when_the_repository "has a cookbook" do
|
1106
1106
|
before do
|
1107
|
-
file
|
1108
|
-
file
|
1107
|
+
file "cookbooks/x-1.0.0/metadata.rb", cb_metadata("x", "1.0.0")
|
1108
|
+
file "cookbooks/x-1.0.0/onlyin1.0.0.rb", "old_text"
|
1109
1109
|
end
|
1110
1110
|
|
1111
|
-
when_the_chef_server
|
1111
|
+
when_the_chef_server "has a later version for the cookbook" do
|
1112
1112
|
before do
|
1113
|
-
cookbook
|
1114
|
-
cookbook
|
1113
|
+
cookbook "x", "1.0.0", { "onlyin1.0.0.rb" => "" }
|
1114
|
+
cookbook "x", "1.0.1", { "onlyin1.0.1.rb" => "hi" }
|
1115
1115
|
end
|
1116
1116
|
|
1117
|
-
it
|
1118
|
-
knife(
|
1117
|
+
it "knife upload /cookbooks uploads the local version" do
|
1118
|
+
knife("diff --name-status /cookbooks").should_succeed <<EOM
|
1119
1119
|
M\t/cookbooks/x-1.0.0/onlyin1.0.0.rb
|
1120
1120
|
D\t/cookbooks/x-1.0.1
|
1121
1121
|
EOM
|
1122
|
-
knife(
|
1122
|
+
knife("upload --purge /cookbooks").should_succeed <<EOM
|
1123
1123
|
Updated /cookbooks/x-1.0.0
|
1124
1124
|
Deleted extra entry /cookbooks/x-1.0.1 (purge is on)
|
1125
1125
|
EOM
|
1126
|
-
knife(
|
1126
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
1127
1127
|
end
|
1128
1128
|
end
|
1129
1129
|
|
1130
|
-
when_the_chef_server
|
1130
|
+
when_the_chef_server "has an earlier version for the cookbook" do
|
1131
1131
|
before do
|
1132
|
-
cookbook
|
1133
|
-
cookbook
|
1132
|
+
cookbook "x", "1.0.0", { "onlyin1.0.0.rb" => "" }
|
1133
|
+
cookbook "x", "0.9.9", { "onlyin0.9.9.rb" => "hi" }
|
1134
1134
|
end
|
1135
|
-
it
|
1136
|
-
knife(
|
1135
|
+
it "knife upload /cookbooks uploads the local version" do
|
1136
|
+
knife("upload --purge /cookbooks").should_succeed <<EOM
|
1137
1137
|
Updated /cookbooks/x-1.0.0
|
1138
1138
|
Deleted extra entry /cookbooks/x-0.9.9 (purge is on)
|
1139
1139
|
EOM
|
1140
|
-
knife(
|
1140
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
1141
1141
|
end
|
1142
1142
|
end
|
1143
1143
|
|
1144
|
-
when_the_chef_server
|
1144
|
+
when_the_chef_server "has a later version for the cookbook, and no current version" do
|
1145
1145
|
before do
|
1146
|
-
cookbook
|
1146
|
+
cookbook "x", "1.0.1", { "onlyin1.0.1.rb" => "hi" }
|
1147
1147
|
end
|
1148
1148
|
|
1149
|
-
it
|
1150
|
-
knife(
|
1149
|
+
it "knife upload /cookbooks/x uploads the local version" do
|
1150
|
+
knife("diff --name-status /cookbooks").should_succeed <<EOM
|
1151
1151
|
D\t/cookbooks/x-1.0.1
|
1152
1152
|
A\t/cookbooks/x-1.0.0
|
1153
1153
|
EOM
|
1154
|
-
knife(
|
1154
|
+
knife("upload --purge /cookbooks").should_succeed <<EOM
|
1155
1155
|
Created /cookbooks/x-1.0.0
|
1156
1156
|
Deleted extra entry /cookbooks/x-1.0.1 (purge is on)
|
1157
1157
|
EOM
|
1158
|
-
knife(
|
1158
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
1159
1159
|
end
|
1160
1160
|
end
|
1161
1161
|
|
1162
|
-
when_the_chef_server
|
1162
|
+
when_the_chef_server "has an earlier version for the cookbook, and no current version" do
|
1163
1163
|
before do
|
1164
|
-
cookbook
|
1164
|
+
cookbook "x", "0.9.9", { "onlyin0.9.9.rb" => "hi" }
|
1165
1165
|
end
|
1166
1166
|
|
1167
|
-
it
|
1168
|
-
knife(
|
1167
|
+
it "knife upload /cookbooks/x uploads the new version" do
|
1168
|
+
knife("upload --purge /cookbooks").should_succeed <<EOM
|
1169
1169
|
Created /cookbooks/x-1.0.0
|
1170
1170
|
Deleted extra entry /cookbooks/x-0.9.9 (purge is on)
|
1171
1171
|
EOM
|
1172
|
-
knife(
|
1172
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
1173
1173
|
end
|
1174
1174
|
end
|
1175
1175
|
end
|
1176
1176
|
|
1177
|
-
when_the_chef_server
|
1177
|
+
when_the_chef_server "has an environment" do
|
1178
1178
|
before do
|
1179
|
-
environment
|
1179
|
+
environment "x", {}
|
1180
1180
|
end
|
1181
1181
|
|
1182
|
-
when_the_repository
|
1182
|
+
when_the_repository "has the same environment with the wrong name in the file" do
|
1183
1183
|
before do
|
1184
|
-
file
|
1184
|
+
file "environments/x.json", { "name" => "y" }
|
1185
1185
|
end
|
1186
|
-
it
|
1187
|
-
knife(
|
1188
|
-
knife(
|
1186
|
+
it "knife upload fails" do
|
1187
|
+
knife("upload /environments/x.json").should_fail "ERROR: /environments/x.json failed to write: Name must be 'x' (is 'y')\n"
|
1188
|
+
knife("diff --name-status /environments/x.json").should_succeed "M\t/environments/x.json\n"
|
1189
1189
|
end
|
1190
1190
|
end
|
1191
1191
|
|
1192
|
-
when_the_repository
|
1192
|
+
when_the_repository "has the same environment with no name in the file" do
|
1193
1193
|
before do
|
1194
|
-
file
|
1194
|
+
file "environments/x.json", { "description" => "hi" }
|
1195
1195
|
end
|
1196
|
-
it
|
1197
|
-
knife(
|
1198
|
-
knife(
|
1196
|
+
it "knife upload succeeds" do
|
1197
|
+
knife("upload /environments/x.json").should_succeed "Updated /environments/x.json\n"
|
1198
|
+
knife("diff --name-status /environments/x.json").should_succeed ""
|
1199
1199
|
end
|
1200
1200
|
end
|
1201
1201
|
end
|
1202
1202
|
|
1203
|
-
when_the_chef_server
|
1203
|
+
when_the_chef_server "is empty" do
|
1204
1204
|
|
1205
|
-
when_the_repository
|
1205
|
+
when_the_repository "has an environment with the wrong name in the file" do
|
1206
1206
|
before do
|
1207
|
-
file
|
1207
|
+
file "environments/x.json", { "name" => "y" }
|
1208
1208
|
end
|
1209
|
-
it
|
1210
|
-
knife(
|
1211
|
-
knife(
|
1209
|
+
it "knife upload fails" do
|
1210
|
+
knife("upload /environments/x.json").should_fail "ERROR: /environments failed to create_child: Error creating 'x.json': Name must be 'x' (is 'y')\n"
|
1211
|
+
knife("diff --name-status /environments/x.json").should_succeed "A\t/environments/x.json\n"
|
1212
1212
|
end
|
1213
1213
|
end
|
1214
1214
|
|
1215
|
-
when_the_repository
|
1215
|
+
when_the_repository "has an environment with no name in the file" do
|
1216
1216
|
before do
|
1217
|
-
file
|
1217
|
+
file "environments/x.json", { "description" => "hi" }
|
1218
1218
|
end
|
1219
|
-
it
|
1220
|
-
knife(
|
1221
|
-
knife(
|
1219
|
+
it "knife upload succeeds" do
|
1220
|
+
knife("upload /environments/x.json").should_succeed "Created /environments/x.json\n"
|
1221
|
+
knife("diff --name-status /environments/x.json").should_succeed ""
|
1222
1222
|
end
|
1223
1223
|
end
|
1224
1224
|
|
1225
|
-
when_the_repository
|
1225
|
+
when_the_repository "has a data bag with no id in the file" do
|
1226
1226
|
before do
|
1227
|
-
file
|
1227
|
+
file "data_bags/bag/x.json", { "foo" => "bar" }
|
1228
1228
|
end
|
1229
|
-
it
|
1230
|
-
knife(
|
1231
|
-
knife(
|
1229
|
+
it "knife upload succeeds" do
|
1230
|
+
knife("upload /data_bags/bag/x.json").should_succeed "Created /data_bags/bag\nCreated /data_bags/bag/x.json\n"
|
1231
|
+
knife("diff --name-status /data_bags/bag/x.json").should_succeed ""
|
1232
1232
|
end
|
1233
1233
|
end
|
1234
1234
|
end
|
1235
1235
|
|
1236
1236
|
when_the_chef_server "is empty" do
|
1237
|
-
when_the_repository
|
1237
|
+
when_the_repository "has a cookbook with an invalid chef_version constraint in it" do
|
1238
1238
|
before do
|
1239
|
-
file
|
1239
|
+
file "cookbooks/x-1.0.0/metadata.rb", cb_metadata("x", "1.0.0", "\nchef_version '~> 999.0'")
|
1240
1240
|
end
|
1241
|
-
it
|
1242
|
-
knife(
|
1241
|
+
it "knife upload succeeds" do
|
1242
|
+
knife("upload /cookbooks/x-1.0.0").should_succeed <<EOM
|
1243
1243
|
Created /cookbooks/x-1.0.0
|
1244
1244
|
EOM
|
1245
|
-
knife(
|
1245
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
1246
1246
|
end
|
1247
1247
|
end
|
1248
1248
|
end
|
1249
1249
|
end # with versioned cookbooks
|
1250
1250
|
|
1251
|
-
when_the_chef_server
|
1251
|
+
when_the_chef_server "has a user" do
|
1252
1252
|
before do
|
1253
|
-
user
|
1253
|
+
user "x", {}
|
1254
1254
|
end
|
1255
1255
|
|
1256
|
-
when_the_repository
|
1256
|
+
when_the_repository "has the same user with json_class in it" do
|
1257
1257
|
before do
|
1258
|
-
file
|
1258
|
+
file "users/x.json", { "admin" => true, "json_class" => "Chef::WebUIUser" }
|
1259
1259
|
end
|
1260
|
-
it
|
1261
|
-
knife(
|
1260
|
+
it "knife upload /users/x.json succeeds" do
|
1261
|
+
knife("upload /users/x.json").should_succeed "Updated /users/x.json\n"
|
1262
1262
|
end
|
1263
1263
|
end
|
1264
1264
|
end
|
1265
1265
|
|
1266
1266
|
when_the_chef_server "is in Enterprise mode", :osc_compat => false, :single_org => false do
|
1267
1267
|
before do
|
1268
|
-
user
|
1269
|
-
user
|
1270
|
-
user
|
1271
|
-
organization
|
1268
|
+
user "foo", {}
|
1269
|
+
user "bar", {}
|
1270
|
+
user "foobar", {}
|
1271
|
+
organization "foo", { "full_name" => "Something" }
|
1272
1272
|
end
|
1273
1273
|
|
1274
1274
|
before :each do
|
1275
|
-
Chef::Config.chef_server_url = URI.join(Chef::Config.chef_server_url,
|
1275
|
+
Chef::Config.chef_server_url = URI.join(Chef::Config.chef_server_url, "/organizations/foo")
|
1276
1276
|
end
|
1277
1277
|
|
1278
|
-
context
|
1279
|
-
group
|
1278
|
+
context "and has nothing but a single group named blah" do
|
1279
|
+
group "blah", {}
|
1280
1280
|
|
1281
|
-
when_the_repository
|
1281
|
+
when_the_repository "has at least one of each thing" do
|
1282
1282
|
|
1283
1283
|
before do
|
1284
1284
|
# TODO We have to upload acls for an existing group due to a lack of
|
1285
1285
|
# dependency detection during upload. Fix that!
|
1286
|
-
file
|
1287
|
-
file
|
1288
|
-
file
|
1289
|
-
file
|
1290
|
-
file
|
1291
|
-
file
|
1292
|
-
file
|
1293
|
-
file
|
1294
|
-
file
|
1295
|
-
file
|
1296
|
-
file
|
1297
|
-
file
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1286
|
+
file "acls/groups/blah.json", {}
|
1287
|
+
file "clients/x.json", { "public_key" => ChefZero::PUBLIC_KEY }
|
1288
|
+
file "containers/x.json", {}
|
1289
|
+
file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0")
|
1290
|
+
file "cookbook_artifacts/x-1x1/metadata.rb", cb_metadata("x", "1.0.0")
|
1291
|
+
file "data_bags/x/y.json", {}
|
1292
|
+
file "environments/x.json", {}
|
1293
|
+
file "groups/x.json", {}
|
1294
|
+
file "invitations.json", [ "foo" ]
|
1295
|
+
file "members.json", [ "bar" ]
|
1296
|
+
file "org.json", { "full_name" => "wootles" }
|
1297
|
+
file "nodes/x.json", {}
|
1298
|
+
file "policies/x-1.0.0.json", {}
|
1299
|
+
file "policies/blah-1.0.0.json", {}
|
1300
|
+
file "policy_groups/x.json", { "policies" => { "x" => { "revision_id" => "1.0.0" }, "blah" => { "revision_id" => "1.0.0" } } }
|
1301
|
+
file "roles/x.json", {}
|
1302
|
+
end
|
1303
|
+
|
1304
|
+
it "knife upload / uploads everything" do
|
1305
|
+
knife("upload /").should_succeed <<EOM
|
1302
1306
|
Updated /acls/groups/blah.json
|
1303
1307
|
Created /clients/x.json
|
1304
1308
|
Created /containers/x.json
|
1309
|
+
Created /cookbook_artifacts/x-1x1
|
1305
1310
|
Created /cookbooks/x
|
1306
1311
|
Created /data_bags/x
|
1307
1312
|
Created /data_bags/x/y.json
|
@@ -1311,105 +1316,211 @@ Updated /invitations.json
|
|
1311
1316
|
Updated /members.json
|
1312
1317
|
Created /nodes/x.json
|
1313
1318
|
Updated /org.json
|
1319
|
+
Created /policies/blah-1.0.0.json
|
1320
|
+
Created /policies/x-1.0.0.json
|
1321
|
+
Created /policy_groups/x.json
|
1314
1322
|
Created /roles/x.json
|
1315
1323
|
EOM
|
1316
|
-
expect(api.get(
|
1317
|
-
expect(api.get(
|
1324
|
+
expect(api.get("association_requests").map { |a| a["username"] }).to eq([ "foo" ])
|
1325
|
+
expect(api.get("users").map { |a| a["user"]["username"] }).to eq([ "bar" ])
|
1326
|
+
knife("diff --name-status --diff-filter=AMT /").should_succeed ""
|
1327
|
+
end
|
1328
|
+
|
1329
|
+
context "When the chef server has an identical copy of each thing" do
|
1330
|
+
before do
|
1331
|
+
file "invitations.json", [ "foo" ]
|
1332
|
+
file "members.json", [ "bar" ]
|
1333
|
+
file "org.json", { "full_name" => "Something" }
|
1334
|
+
|
1335
|
+
# acl_for %w(organizations foo groups blah)
|
1336
|
+
client "x", {}
|
1337
|
+
cookbook "x", "1.0.0"
|
1338
|
+
cookbook_artifact "x", "1x1", "metadata.rb" => cb_metadata("x", "1.0.0")
|
1339
|
+
container "x", {}
|
1340
|
+
data_bag "x", { "y" => {} }
|
1341
|
+
environment "x", {}
|
1342
|
+
group "x", {}
|
1343
|
+
org_invite "foo"
|
1344
|
+
org_member "bar"
|
1345
|
+
node "x", {}
|
1346
|
+
policy "x", "1.0.0", {}
|
1347
|
+
policy "blah", "1.0.0", {}
|
1348
|
+
policy_group "x", {
|
1349
|
+
"policies" => {
|
1350
|
+
"x" => { "revision_id" => "1.0.0" },
|
1351
|
+
"blah" => { "revision_id" => "1.0.0" },
|
1352
|
+
}
|
1353
|
+
}
|
1354
|
+
role "x", {}
|
1355
|
+
end
|
1356
|
+
|
1357
|
+
it "knife upload makes no changes" do
|
1358
|
+
knife("upload /").should_succeed <<EOM
|
1359
|
+
Updated /acls/groups/blah.json
|
1360
|
+
EOM
|
1361
|
+
end
|
1362
|
+
end
|
1363
|
+
|
1364
|
+
context "When the chef server has a slightly different copy of the policy revision" do
|
1365
|
+
before do
|
1366
|
+
policy "x", "1.0.0", { "run_list" => [ "blah" ] }
|
1367
|
+
end
|
1368
|
+
|
1369
|
+
it "should fail because policies are not updateable" do
|
1370
|
+
knife("upload /policies/x-1.0.0.json").should_fail <<EOM
|
1371
|
+
ERROR: /policies/x-1.0.0.json cannot be updated: policy revisions are immutable once uploaded. If you want to change the policy, create a new revision with your changes.
|
1372
|
+
EOM
|
1373
|
+
end
|
1374
|
+
end
|
1375
|
+
|
1376
|
+
context "When the chef server has a slightly different copy of the cookbook artifact" do
|
1377
|
+
before do
|
1378
|
+
cookbook_artifact "x", "1x1", { "recipes" => { "default.rb" => "" } }
|
1379
|
+
end
|
1380
|
+
|
1381
|
+
it "should fail because cookbook_artifacts cannot be updated" do
|
1382
|
+
knife("upload /cookbook_artifacts/x-1x1").should_fail <<EOM
|
1383
|
+
ERROR: /cookbook_artifacts/x-1x1 cannot be updated: cookbook artifacts are immutable once uploaded.
|
1384
|
+
EOM
|
1385
|
+
end
|
1386
|
+
end
|
1387
|
+
|
1388
|
+
context "When the chef server has a slightly different copy of each thing (except policy revisions)" do
|
1389
|
+
before do
|
1390
|
+
# acl_for %w(organizations foo groups blah)
|
1391
|
+
client "x", { "validator" => true }
|
1392
|
+
container "x", {}
|
1393
|
+
cookbook "x", "1.0.0", { "recipes" => { "default.rb" => "" } }
|
1394
|
+
cookbook_artifact "x", "1x1", { "metadata.rb" => cb_metadata("x", "1.0.0") }
|
1395
|
+
data_bag "x", { "y" => { "a" => "b" } }
|
1396
|
+
environment "x", { "description" => "foo" }
|
1397
|
+
group "x", { "groups" => [ "admin" ] }
|
1398
|
+
node "x", { "run_list" => [ "blah" ] }
|
1399
|
+
policy "x", "1.0.0", {}
|
1400
|
+
policy "x", "1.0.1", {}
|
1401
|
+
policy "y", "1.0.0", {}
|
1402
|
+
policy_group "x", {
|
1403
|
+
"policies" => {
|
1404
|
+
"x" => { "revision_id" => "1.0.1" },
|
1405
|
+
"y" => { "revision_id" => "1.0.0" },
|
1406
|
+
}
|
1407
|
+
}
|
1408
|
+
role "x", { "run_list" => [ "blah" ] }
|
1409
|
+
end
|
1410
|
+
|
1411
|
+
it "knife upload updates everything" do
|
1412
|
+
knife("upload /").should_succeed <<EOM
|
1413
|
+
Updated /acls/groups/blah.json
|
1414
|
+
Updated /clients/x.json
|
1415
|
+
Updated /cookbooks/x
|
1416
|
+
Updated /data_bags/x/y.json
|
1417
|
+
Updated /environments/x.json
|
1418
|
+
Updated /groups/x.json
|
1419
|
+
Updated /invitations.json
|
1420
|
+
Updated /members.json
|
1421
|
+
Updated /nodes/x.json
|
1422
|
+
Updated /org.json
|
1423
|
+
Created /policies/blah-1.0.0.json
|
1424
|
+
Updated /policy_groups/x.json
|
1425
|
+
Updated /roles/x.json
|
1426
|
+
EOM
|
1427
|
+
knife("diff --name-status --diff-filter=AMT /").should_succeed ""
|
1428
|
+
end
|
1318
1429
|
end
|
1319
1430
|
end
|
1320
1431
|
|
1321
|
-
when_the_repository
|
1432
|
+
when_the_repository "has an org.json that does not change full_name" do
|
1322
1433
|
before do
|
1323
|
-
file
|
1434
|
+
file "org.json", { "full_name" => "Something" }
|
1324
1435
|
end
|
1325
1436
|
|
1326
|
-
it
|
1327
|
-
knife(
|
1328
|
-
expect(api.get(
|
1437
|
+
it "knife upload / emits a warning for bar and adds foo and foobar" do
|
1438
|
+
knife("upload /").should_succeed ""
|
1439
|
+
expect(api.get("/")["full_name"]).to eq("Something")
|
1329
1440
|
end
|
1330
1441
|
end
|
1331
1442
|
|
1332
|
-
when_the_repository
|
1443
|
+
when_the_repository "has an org.json that changes full_name" do
|
1333
1444
|
before do
|
1334
|
-
file
|
1445
|
+
file "org.json", { "full_name" => "Something Else" }
|
1335
1446
|
end
|
1336
1447
|
|
1337
|
-
it
|
1338
|
-
knife(
|
1339
|
-
expect(api.get(
|
1448
|
+
it "knife upload / emits a warning for bar and adds foo and foobar" do
|
1449
|
+
knife("upload /").should_succeed "Updated /org.json\n"
|
1450
|
+
expect(api.get("/")["full_name"]).to eq("Something Else")
|
1340
1451
|
end
|
1341
1452
|
end
|
1342
1453
|
|
1343
|
-
context
|
1344
|
-
org_invite
|
1345
|
-
org_member
|
1454
|
+
context "and has invited foo and bar is already a member" do
|
1455
|
+
org_invite "foo"
|
1456
|
+
org_member "bar"
|
1346
1457
|
|
1347
|
-
when_the_repository
|
1458
|
+
when_the_repository "wants to invite foo, bar and foobar" do
|
1348
1459
|
before do
|
1349
|
-
file
|
1460
|
+
file "invitations.json", [ "foo", "bar", "foobar" ]
|
1350
1461
|
end
|
1351
1462
|
|
1352
|
-
it
|
1353
|
-
knife(
|
1354
|
-
expect(api.get(
|
1355
|
-
expect(api.get(
|
1463
|
+
it "knife upload / emits a warning for bar and invites foobar" do
|
1464
|
+
knife("upload /").should_succeed "Updated /invitations.json\n", :stderr => "WARN: Could not invite bar to organization foo: User bar is already in organization foo\n"
|
1465
|
+
expect(api.get("association_requests").map { |a| a["username"] }).to eq([ "foo", "foobar" ])
|
1466
|
+
expect(api.get("users").map { |a| a["user"]["username"] }).to eq([ "bar" ])
|
1356
1467
|
end
|
1357
1468
|
end
|
1358
1469
|
|
1359
|
-
when_the_repository
|
1470
|
+
when_the_repository "wants to make foo, bar and foobar members" do
|
1360
1471
|
before do
|
1361
|
-
file
|
1472
|
+
file "members.json", [ "foo", "bar", "foobar" ]
|
1362
1473
|
end
|
1363
1474
|
|
1364
|
-
it
|
1365
|
-
knife(
|
1366
|
-
expect(api.get(
|
1367
|
-
expect(api.get(
|
1475
|
+
it "knife upload / emits a warning for bar and adds foo and foobar" do
|
1476
|
+
knife("upload /").should_succeed "Updated /members.json\n"
|
1477
|
+
expect(api.get("association_requests").map { |a| a["username"] }).to eq([ ])
|
1478
|
+
expect(api.get("users").map { |a| a["user"]["username"] }).to eq([ "bar", "foo", "foobar" ])
|
1368
1479
|
end
|
1369
1480
|
end
|
1370
1481
|
|
1371
|
-
when_the_repository
|
1482
|
+
when_the_repository "wants to invite foo and have bar as a member" do
|
1372
1483
|
before do
|
1373
|
-
file
|
1374
|
-
file
|
1484
|
+
file "invitations.json", [ "foo" ]
|
1485
|
+
file "members.json", [ "bar" ]
|
1375
1486
|
end
|
1376
1487
|
|
1377
|
-
it
|
1378
|
-
knife(
|
1379
|
-
expect(api.get(
|
1380
|
-
expect(api.get(
|
1488
|
+
it "knife upload / does nothing" do
|
1489
|
+
knife("upload /").should_succeed ""
|
1490
|
+
expect(api.get("association_requests").map { |a| a["username"] }).to eq([ "foo" ])
|
1491
|
+
expect(api.get("users").map { |a| a["user"]["username"] }).to eq([ "bar" ])
|
1381
1492
|
end
|
1382
1493
|
end
|
1383
1494
|
end
|
1384
1495
|
|
1385
|
-
context
|
1386
|
-
org_invite
|
1496
|
+
context "and has invited bar and foo" do
|
1497
|
+
org_invite "bar", "foo"
|
1387
1498
|
|
1388
|
-
when_the_repository
|
1499
|
+
when_the_repository "wants to invite foo and bar (different order)" do
|
1389
1500
|
before do
|
1390
|
-
file
|
1501
|
+
file "invitations.json", [ "foo", "bar" ]
|
1391
1502
|
end
|
1392
1503
|
|
1393
|
-
it
|
1394
|
-
knife(
|
1395
|
-
expect(api.get(
|
1396
|
-
expect(api.get(
|
1504
|
+
it "knife upload / does nothing" do
|
1505
|
+
knife("upload /").should_succeed ""
|
1506
|
+
expect(api.get("association_requests").map { |a| a["username"] }).to eq([ "bar", "foo" ])
|
1507
|
+
expect(api.get("users").map { |a| a["user"]["username"] }).to eq([ ])
|
1397
1508
|
end
|
1398
1509
|
end
|
1399
1510
|
end
|
1400
1511
|
|
1401
|
-
context
|
1402
|
-
org_member
|
1512
|
+
context "and has already added bar and foo as members of the org" do
|
1513
|
+
org_member "bar", "foo"
|
1403
1514
|
|
1404
|
-
when_the_repository
|
1515
|
+
when_the_repository "wants to add foo and bar (different order)" do
|
1405
1516
|
before do
|
1406
|
-
file
|
1517
|
+
file "members.json", [ "foo", "bar" ]
|
1407
1518
|
end
|
1408
1519
|
|
1409
|
-
it
|
1410
|
-
knife(
|
1411
|
-
expect(api.get(
|
1412
|
-
expect(api.get(
|
1520
|
+
it "knife upload / does nothing" do
|
1521
|
+
knife("upload /").should_succeed ""
|
1522
|
+
expect(api.get("association_requests").map { |a| a["username"] }).to eq([ ])
|
1523
|
+
expect(api.get("users").map { |a| a["user"]["username"] }).to eq([ "bar", "foo" ])
|
1413
1524
|
end
|
1414
1525
|
end
|
1415
1526
|
end
|