chef 14.14.29-universal-mingw32 → 14.15.6-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 +1 -1
- data/README.md +18 -7
- data/Rakefile +7 -4
- data/chef.gemspec +1 -1
- data/lib/chef/knife/ssh.rb +6 -0
- data/lib/chef/provider/ifconfig.rb +14 -5
- data/lib/chef/provider/windows_task.rb +9 -5
- data/lib/chef/resource/kernel_module.rb +61 -0
- data/lib/chef/resource/windows_task.rb +4 -0
- data/lib/chef/version.rb +1 -1
- data/spec/data/cookbooks/openldap/metadata.rb +2 -2
- data/spec/data/metadata/quick_start/metadata.rb +2 -7
- data/spec/functional/audit/runner_spec.rb +1 -1
- data/spec/functional/dsl/reboot_pending_spec.rb +7 -25
- data/spec/functional/event_loggers/windows_eventlog_spec.rb +6 -4
- data/spec/functional/file_content_management/deploy_strategies_spec.rb +21 -21
- data/spec/functional/knife/exec_spec.rb +1 -1
- data/spec/functional/knife/ssh_spec.rb +3 -3
- data/spec/functional/mixin/user_context_spec.rb +3 -1
- data/spec/functional/rebooter_spec.rb +1 -1
- data/spec/functional/resource/aix_service_spec.rb +1 -1
- data/spec/functional/resource/aixinit_service_spec.rb +1 -1
- data/spec/functional/resource/apt_package_spec.rb +1 -1
- data/spec/functional/resource/chocolatey_package_spec.rb +2 -2
- data/spec/functional/resource/cookbook_file_spec.rb +1 -3
- data/spec/functional/resource/cron_spec.rb +4 -3
- data/spec/functional/resource/dpkg_package_spec.rb +4 -4
- data/spec/functional/resource/dsc_resource_spec.rb +2 -1
- data/spec/functional/resource/dsc_script_spec.rb +16 -20
- data/spec/functional/resource/execute_spec.rb +2 -2
- data/spec/functional/resource/git_spec.rb +6 -6
- data/spec/functional/resource/group_spec.rb +8 -6
- data/spec/functional/resource/ifconfig_spec.rb +3 -5
- data/spec/functional/resource/link_spec.rb +2 -2
- data/spec/functional/resource/mount_spec.rb +3 -7
- data/spec/functional/resource/powershell_script_spec.rb +9 -8
- data/spec/functional/resource/reboot_spec.rb +1 -1
- data/spec/functional/resource/remote_file_spec.rb +2 -2
- data/spec/functional/resource/template_spec.rb +1 -1
- data/spec/functional/resource/user/windows_spec.rb +2 -2
- data/spec/functional/resource/windows_certificate_spec.rb +3 -3
- data/spec/functional/resource/windows_service_spec.rb +3 -3
- data/spec/functional/resource/windows_task_spec.rb +51 -0
- data/spec/functional/run_lock_spec.rb +10 -3
- data/spec/functional/shell_spec.rb +1 -1
- data/spec/functional/util/powershell/cmdlet_spec.rb +1 -1
- data/spec/functional/version_spec.rb +1 -1
- data/spec/functional/win32/security_spec.rb +12 -7
- data/spec/functional/win32/service_manager_spec.rb +1 -1
- data/spec/functional/win32/version_info_spec.rb +4 -4
- data/spec/integration/client/client_spec.rb +114 -132
- data/spec/integration/client/exit_code_spec.rb +8 -8
- data/spec/integration/client/ipv6_spec.rb +5 -5
- data/spec/integration/knife/chef_fs_data_store_spec.rb +38 -38
- data/spec/integration/knife/chef_repo_path_spec.rb +42 -42
- data/spec/integration/knife/chef_repository_file_system_spec.rb +9 -9
- data/spec/integration/knife/chefignore_spec.rb +13 -13
- data/spec/integration/knife/client_bulk_delete_spec.rb +8 -8
- data/spec/integration/knife/client_create_spec.rb +1 -1
- data/spec/integration/knife/client_delete_spec.rb +4 -4
- data/spec/integration/knife/client_key_delete_spec.rb +1 -1
- data/spec/integration/knife/client_key_list_spec.rb +1 -1
- data/spec/integration/knife/client_list_spec.rb +1 -1
- data/spec/integration/knife/common_options_spec.rb +1 -1
- data/spec/integration/knife/config_get_spec.rb +1 -1
- data/spec/integration/knife/config_list_profiles_spec.rb +2 -1
- data/spec/integration/knife/cookbook_api_ipv6_spec.rb +3 -3
- data/spec/integration/knife/cookbook_bulk_delete_spec.rb +3 -3
- data/spec/integration/knife/cookbook_download_spec.rb +4 -4
- data/spec/integration/knife/cookbook_list_spec.rb +2 -2
- data/spec/integration/knife/cookbook_show_spec.rb +3 -3
- data/spec/integration/knife/cookbook_upload_spec.rb +6 -6
- data/spec/integration/knife/data_bag_delete_spec.rb +4 -4
- data/spec/integration/knife/data_bag_from_file_spec.rb +7 -7
- data/spec/integration/knife/data_bag_list_spec.rb +1 -1
- data/spec/integration/knife/delete_spec.rb +37 -37
- data/spec/integration/knife/deps_spec.rb +23 -23
- data/spec/integration/knife/diff_spec.rb +23 -23
- data/spec/integration/knife/download_spec.rb +79 -79
- data/spec/integration/knife/environment_compare_spec.rb +3 -3
- data/spec/integration/knife/environment_from_file_spec.rb +6 -6
- data/spec/integration/knife/environment_list_spec.rb +1 -1
- data/spec/integration/knife/environment_show_spec.rb +4 -4
- data/spec/integration/knife/list_spec.rb +25 -25
- data/spec/integration/knife/node_bulk_delete_spec.rb +2 -2
- data/spec/integration/knife/node_delete_spec.rb +2 -2
- data/spec/integration/knife/node_environment_set_spec.rb +1 -1
- data/spec/integration/knife/node_from_file_spec.rb +2 -2
- data/spec/integration/knife/node_list_spec.rb +1 -1
- data/spec/integration/knife/raw_spec.rb +12 -12
- data/spec/integration/knife/redirection_spec.rb +1 -1
- data/spec/integration/knife/role_bulk_delete_spec.rb +2 -2
- data/spec/integration/knife/role_delete_spec.rb +2 -2
- data/spec/integration/knife/role_from_file_spec.rb +5 -5
- data/spec/integration/knife/role_list_spec.rb +1 -1
- data/spec/integration/knife/role_show_spec.rb +1 -1
- data/spec/integration/knife/show_spec.rb +10 -10
- data/spec/integration/knife/upload_spec.rb +85 -85
- data/spec/integration/recipes/accumulator_spec.rb +4 -4
- data/spec/integration/recipes/lwrp_inline_resources_spec.rb +6 -6
- data/spec/integration/recipes/lwrp_spec.rb +6 -6
- data/spec/integration/recipes/notifies_spec.rb +45 -45
- data/spec/integration/recipes/notifying_block_spec.rb +4 -4
- data/spec/integration/recipes/provider_choice.rb +1 -2
- data/spec/integration/recipes/recipe_dsl_spec.rb +9 -9
- data/spec/integration/recipes/remote_directory.rb +2 -2
- data/spec/integration/recipes/resource_action_spec.rb +1 -1
- data/spec/integration/recipes/resource_converge_if_changed_spec.rb +19 -19
- data/spec/integration/solo/solo_spec.rb +29 -29
- data/spec/scripts/ssl-serve.rb +1 -1
- data/spec/spec_helper.rb +11 -14
- data/spec/stress/win32/security_spec.rb +1 -1
- data/spec/support/lib/chef/resource/zen_follower.rb +1 -1
- data/spec/support/lib/chef/resource/zen_master.rb +1 -1
- data/spec/support/mock/platform.rb +2 -2
- data/spec/support/platform_helpers.rb +12 -3
- data/spec/support/platforms/win32/spec_service.rb +6 -10
- data/spec/support/shared/context/client.rb +2 -1
- data/spec/support/shared/functional/execute_resource.rb +4 -4
- data/spec/support/shared/functional/file_resource.rb +1 -3
- data/spec/support/shared/functional/http.rb +20 -44
- data/spec/support/shared/functional/securable_resource.rb +4 -8
- data/spec/support/shared/functional/win32_service.rb +1 -1
- data/spec/support/shared/functional/windows_script.rb +2 -1
- data/spec/support/shared/integration/app_server_support.rb +3 -4
- data/spec/support/shared/integration/integration_helper.rb +1 -0
- data/spec/support/shared/integration/knife_support.rb +5 -5
- data/spec/support/shared/unit/application_dot_d.rb +10 -4
- data/spec/support/shared/unit/file_system_support.rb +3 -2
- data/spec/support/shared/unit/platform_introspector.rb +12 -12
- data/spec/support/shared/unit/provider/file.rb +1 -1
- data/spec/support/shared/unit/script_resource.rb +1 -1
- data/spec/support/shared/unit/windows_script_resource.rb +1 -1
- data/spec/tiny_server.rb +1 -1
- data/spec/unit/api_client/registration_spec.rb +1 -1
- data/spec/unit/api_client_spec.rb +5 -5
- data/spec/unit/api_client_v1_spec.rb +6 -6
- data/spec/unit/application/client_spec.rb +8 -8
- data/spec/unit/application/exit_code_spec.rb +3 -2
- data/spec/unit/application/knife_spec.rb +1 -2
- data/spec/unit/audit/audit_event_proxy_spec.rb +14 -7
- data/spec/unit/audit/audit_reporter_spec.rb +20 -11
- data/spec/unit/audit/control_group_data_spec.rb +17 -12
- data/spec/unit/chef_fs/config_spec.rb +3 -3
- data/spec/unit/chef_fs/file_system/repository/directory_spec.rb +1 -1
- data/spec/unit/chef_fs/parallelizer.rb +1 -1
- data/spec/unit/client_spec.rb +3 -3
- data/spec/unit/config_fetcher_spec.rb +1 -1
- data/spec/unit/cookbook/metadata_spec.rb +13 -13
- data/spec/unit/cookbook/synchronizer_spec.rb +6 -6
- data/spec/unit/cookbook_loader_spec.rb +17 -17
- data/spec/unit/cookbook_manifest_spec.rb +9 -9
- data/spec/unit/cookbook_site_streaming_uploader_spec.rb +1 -2
- data/spec/unit/cookbook_uploader_spec.rb +2 -2
- data/spec/unit/cookbook_version_file_specificity_spec.rb +9 -9
- data/spec/unit/cookbook_version_spec.rb +2 -2
- data/spec/unit/data_bag_item_spec.rb +7 -7
- data/spec/unit/data_bag_spec.rb +1 -1
- data/spec/unit/data_collector_spec.rb +23 -23
- data/spec/unit/decorator_spec.rb +2 -2
- data/spec/unit/deprecated_spec.rb +2 -2
- data/spec/unit/dsl/data_query_spec.rb +3 -2
- data/spec/unit/dsl/declare_resource_spec.rb +1 -1
- data/spec/unit/dsl/platform_introspection_spec.rb +2 -2
- data/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb +2 -1
- data/spec/unit/encrypted_data_bag_item_spec.rb +2 -1
- data/spec/unit/environment_spec.rb +13 -13
- data/spec/unit/event_dispatch/dsl_spec.rb +1 -1
- data/spec/unit/file_content_management/deploy/mv_unix_spec.rb +3 -3
- data/spec/unit/file_content_management/deploy/mv_windows_spec.rb +2 -2
- data/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb +3 -3
- data/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb +1 -1
- data/spec/unit/http/authenticator_spec.rb +4 -3
- data/spec/unit/http/json_input_spec.rb +1 -1
- data/spec/unit/http/socketless_chef_zero_client_spec.rb +15 -15
- data/spec/unit/key_spec.rb +8 -8
- data/spec/unit/knife/bootstrap_spec.rb +14 -10
- data/spec/unit/knife/client_bulk_delete_spec.rb +4 -4
- data/spec/unit/knife/configure_client_spec.rb +1 -1
- data/spec/unit/knife/configure_spec.rb +1 -1
- data/spec/unit/knife/cookbook_bulk_delete_spec.rb +1 -1
- data/spec/unit/knife/cookbook_delete_spec.rb +2 -2
- data/spec/unit/knife/cookbook_download_spec.rb +2 -2
- data/spec/unit/knife/cookbook_metadata_spec.rb +4 -4
- data/spec/unit/knife/cookbook_upload_spec.rb +7 -5
- data/spec/unit/knife/core/bootstrap_context_spec.rb +1 -1
- data/spec/unit/knife/core/cookbook_scm_repo_spec.rb +2 -2
- data/spec/unit/knife/core/gem_glob_loader_spec.rb +4 -4
- data/spec/unit/knife/core/hashed_command_loader_spec.rb +4 -2
- data/spec/unit/knife/core/node_editor_spec.rb +12 -12
- data/spec/unit/knife/core/ui_spec.rb +11 -11
- data/spec/unit/knife/data_bag_from_file_spec.rb +2 -1
- data/spec/unit/knife/data_bag_show_spec.rb +2 -1
- data/spec/unit/knife/key_create_spec.rb +1 -1
- data/spec/unit/knife/key_delete_spec.rb +3 -3
- data/spec/unit/knife/key_edit_spec.rb +4 -4
- data/spec/unit/knife/key_list_spec.rb +1 -1
- data/spec/unit/knife/key_show_spec.rb +3 -3
- data/spec/unit/knife/node_bulk_delete_spec.rb +3 -3
- data/spec/unit/knife/node_delete_spec.rb +2 -2
- data/spec/unit/knife/node_edit_spec.rb +1 -1
- data/spec/unit/knife/node_environment_set_spec.rb +1 -1
- data/spec/unit/knife/node_from_file_spec.rb +1 -1
- data/spec/unit/knife/node_policy_set_spec.rb +1 -1
- data/spec/unit/knife/node_run_list_add_spec.rb +1 -1
- data/spec/unit/knife/node_run_list_remove_spec.rb +1 -1
- data/spec/unit/knife/node_run_list_set_spec.rb +1 -1
- data/spec/unit/knife/node_show_spec.rb +1 -1
- data/spec/unit/knife/raw_spec.rb +2 -2
- data/spec/unit/knife/role_bulk_delete_spec.rb +2 -2
- data/spec/unit/knife/role_create_spec.rb +1 -1
- data/spec/unit/knife/role_delete_spec.rb +1 -1
- data/spec/unit/knife/role_edit_spec.rb +1 -1
- data/spec/unit/knife/role_env_run_list_add_spec.rb +1 -1
- data/spec/unit/knife/role_env_run_list_clear_spec.rb +1 -1
- data/spec/unit/knife/role_env_run_list_remove_spec.rb +1 -1
- data/spec/unit/knife/role_env_run_list_replace_spec.rb +1 -1
- data/spec/unit/knife/role_env_run_list_set_spec.rb +1 -1
- data/spec/unit/knife/role_from_file_spec.rb +1 -1
- data/spec/unit/knife/role_run_list_add_spec.rb +1 -1
- data/spec/unit/knife/role_run_list_clear_spec.rb +1 -1
- data/spec/unit/knife/role_run_list_remove_spec.rb +1 -1
- data/spec/unit/knife/role_run_list_replace_spec.rb +1 -1
- data/spec/unit/knife/role_run_list_set_spec.rb +1 -1
- data/spec/unit/knife/ssh_spec.rb +27 -17
- data/spec/unit/knife/ssl_check_spec.rb +4 -4
- data/spec/unit/knife/ssl_fetch_spec.rb +5 -5
- data/spec/unit/knife/status_spec.rb +3 -2
- data/spec/unit/knife/supermarket_download_spec.rb +4 -4
- data/spec/unit/knife/supermarket_install_spec.rb +5 -4
- data/spec/unit/knife/supermarket_share_spec.rb +1 -1
- data/spec/unit/knife_spec.rb +34 -33
- data/spec/unit/lwrp_spec.rb +19 -19
- data/spec/unit/mixin/homebrew_user_spec.rb +1 -1
- data/spec/unit/mixin/params_validate_spec.rb +10 -10
- data/spec/unit/mixin/properties_spec.rb +4 -4
- data/spec/unit/mixin/shell_out_spec.rb +27 -27
- data/spec/unit/mixin/template_spec.rb +4 -8
- data/spec/unit/mixin/unformatter_spec.rb +1 -2
- data/spec/unit/mixin/user_context_spec.rb +1 -2
- data/spec/unit/mixin/which.rb +2 -0
- data/spec/unit/mixin/windows_architecture_helper_spec.rb +3 -3
- data/spec/unit/node/attribute_spec.rb +79 -79
- data/spec/unit/node/immutable_collections_spec.rb +50 -50
- data/spec/unit/node_spec.rb +16 -16
- data/spec/unit/org_spec.rb +3 -3
- data/spec/unit/policy_builder/policyfile_spec.rb +2 -2
- data/spec/unit/property/state_spec.rb +26 -25
- data/spec/unit/property/validation_spec.rb +14 -13
- data/spec/unit/property_spec.rb +10 -9
- data/spec/unit/provider/apt_update_spec.rb +6 -6
- data/spec/unit/provider/cron_spec.rb +15 -15
- data/spec/unit/provider/dsc_resource_spec.rb +6 -3
- data/spec/unit/provider/dsc_script_spec.rb +1 -1
- data/spec/unit/provider/execute_spec.rb +5 -5
- data/spec/unit/provider/git_spec.rb +39 -39
- data/spec/unit/provider/group/dscl_spec.rb +3 -3
- data/spec/unit/provider/group/groupadd_spec.rb +1 -1
- data/spec/unit/provider/group_spec.rb +2 -3
- data/spec/unit/provider/ifconfig/aix_spec.rb +1 -1
- data/spec/unit/provider/ifconfig/debian_spec.rb +2 -2
- data/spec/unit/provider/ifconfig_spec.rb +45 -16
- data/spec/unit/provider/launchd_spec.rb +23 -15
- data/spec/unit/provider/link_spec.rb +22 -11
- data/spec/unit/provider/mount/aix_spec.rb +6 -6
- data/spec/unit/provider/mount/mount_spec.rb +31 -31
- data/spec/unit/provider/mount/solaris_spec.rb +11 -11
- data/spec/unit/provider/ohai_spec.rb +1 -1
- data/spec/unit/provider/osx_profile_spec.rb +5 -7
- data/spec/unit/provider/package/apt_spec.rb +5 -5
- data/spec/unit/provider/package/bff_spec.rb +1 -1
- data/spec/unit/provider/package/cab_spec.rb +1 -1
- data/spec/unit/provider/package/chocolatey_spec.rb +8 -8
- data/spec/unit/provider/package/freebsd/pkg_spec.rb +1 -1
- data/spec/unit/provider/package/ips_spec.rb +6 -6
- data/spec/unit/provider/package/macports_spec.rb +1 -1
- data/spec/unit/provider/package/msu_spec.rb +1 -1
- data/spec/unit/provider/package/openbsd_spec.rb +15 -11
- data/spec/unit/provider/package/pacman_spec.rb +3 -3
- data/spec/unit/provider/package/paludis_spec.rb +4 -4
- data/spec/unit/provider/package/portage_spec.rb +1 -1
- data/spec/unit/provider/package/powershell_spec.rb +1 -1
- data/spec/unit/provider/package/smartos_spec.rb +3 -3
- data/spec/unit/provider/package/solaris_spec.rb +1 -1
- data/spec/unit/provider/package/windows/exe_spec.rb +9 -9
- data/spec/unit/provider/package/windows/msi_spec.rb +7 -7
- data/spec/unit/provider/package/windows_spec.rb +2 -1
- data/spec/unit/provider/package/yum/yum_cache_spec.rb +1 -1
- data/spec/unit/provider/package/zypper_spec.rb +4 -4
- data/spec/unit/provider/package_spec.rb +1 -1
- data/spec/unit/provider/powershell_script_spec.rb +7 -7
- data/spec/unit/provider/registry_key_spec.rb +1 -1
- data/spec/unit/provider/remote_directory_spec.rb +6 -6
- data/spec/unit/provider/route_spec.rb +11 -11
- data/spec/unit/provider/service/arch_service_spec.rb +13 -13
- data/spec/unit/provider/service/debian_service_spec.rb +2 -1
- data/spec/unit/provider/service/freebsd_service_spec.rb +28 -24
- data/spec/unit/provider/service/gentoo_service_spec.rb +2 -2
- data/spec/unit/provider/service/init_service_spec.rb +11 -11
- data/spec/unit/provider/service/invokercd_service_spec.rb +11 -11
- data/spec/unit/provider/service/macosx_spec.rb +5 -5
- data/spec/unit/provider/service/openbsd_service_spec.rb +15 -11
- data/spec/unit/provider/service/simple_service_spec.rb +7 -7
- data/spec/unit/provider/service/upstart_service_spec.rb +14 -14
- data/spec/unit/provider/service/windows_spec.rb +53 -35
- data/spec/unit/provider/subversion_spec.rb +8 -4
- data/spec/unit/provider/systemd_unit_spec.rb +142 -142
- data/spec/unit/provider/template/content_spec.rb +29 -29
- data/spec/unit/provider/windows_task_spec.rb +1 -1
- data/spec/unit/provider_resolver_spec.rb +75 -75
- data/spec/unit/provider_spec.rb +2 -4
- data/spec/unit/recipe_spec.rb +4 -4
- data/spec/unit/resource/batch_spec.rb +1 -1
- data/spec/unit/resource/chef_gem_spec.rb +1 -1
- data/spec/unit/resource/chocolatey_config_spec.rb +1 -1
- data/spec/unit/resource/chocolatey_source_spec.rb +1 -1
- data/spec/unit/resource/directory_spec.rb +1 -1
- data/spec/unit/resource/dnf_package_spec.rb +1 -1
- data/spec/unit/resource/dsc_resource_spec.rb +1 -1
- data/spec/unit/resource/file/verification_spec.rb +1 -2
- data/spec/unit/resource/file_spec.rb +1 -1
- data/spec/unit/resource/group_spec.rb +1 -1
- data/spec/unit/resource/link_spec.rb +1 -1
- data/spec/unit/resource/osx_profile_spec.rb +2 -1
- data/spec/unit/resource/powershell_script_spec.rb +12 -7
- data/spec/unit/resource/registry_key_spec.rb +3 -3
- data/spec/unit/resource/rhsm_subscription_spec.rb +1 -1
- data/spec/unit/resource/service_spec.rb +1 -1
- data/spec/unit/resource/template_spec.rb +2 -2
- data/spec/unit/resource/windows_env_spec.rb +1 -1
- data/spec/unit/resource/windows_service_spec.rb +5 -5
- data/spec/unit/resource/windows_task_spec.rb +6 -2
- data/spec/unit/resource/yum_package_spec.rb +1 -1
- data/spec/unit/resource_collection/resource_list_spec.rb +1 -1
- data/spec/unit/resource_collection/resource_set_spec.rb +7 -7
- data/spec/unit/resource_collection/stepable_iterator_spec.rb +2 -2
- data/spec/unit/resource_collection_spec.rb +4 -4
- data/spec/unit/resource_definition_spec.rb +2 -2
- data/spec/unit/resource_inspector_spec.rb +1 -1
- data/spec/unit/resource_reporter_spec.rb +4 -4
- data/spec/unit/resource_spec.rb +22 -22
- data/spec/unit/role_spec.rb +3 -3
- data/spec/unit/run_context/cookbook_compiler_spec.rb +23 -23
- data/spec/unit/run_list/run_list_expansion_spec.rb +9 -6
- data/spec/unit/run_list_spec.rb +1 -1
- data/spec/unit/runner_spec.rb +3 -3
- data/spec/unit/search/query_spec.rb +3 -2
- data/spec/unit/shell/model_wrapper_spec.rb +1 -1
- data/spec/unit/shell/shell_session_spec.rb +8 -11
- data/spec/unit/shell_spec.rb +1 -2
- data/spec/unit/user_spec.rb +4 -4
- data/spec/unit/user_v1_spec.rb +3 -3
- data/spec/unit/util/backup_spec.rb +1 -1
- data/spec/unit/util/dsc/lcm_output_parser_spec.rb +13 -13
- data/spec/unit/util/dsc/local_configuration_manager_spec.rb +3 -3
- data/spec/unit/util/editor_spec.rb +1 -1
- data/spec/unit/util/powershell/ps_credential_spec.rb +3 -2
- data/spec/unit/util/threaded_job_queue_spec.rb +2 -2
- data/spec/unit/version_class_spec.rb +4 -4
- data/spec/unit/win32/registry_spec.rb +5 -5
- data/spec/unit/win32/security_spec.rb +2 -1
- data/tasks/announce.rb +4 -11
- metadata +10 -6
- data/tasks/maintainers.rb +0 -211
- data/tasks/templates/prerelease.md.erb +0 -35
@@ -25,7 +25,7 @@ describe Chef::Knife::RoleEdit do
|
|
25
25
|
@knife.config[:print_after] = nil
|
26
26
|
@knife.name_args = [ "adam" ]
|
27
27
|
allow(@knife.ui).to receive(:output).and_return(true)
|
28
|
-
@role = Chef::Role.new
|
28
|
+
@role = Chef::Role.new
|
29
29
|
allow(@role).to receive(:save)
|
30
30
|
allow(Chef::Role).to receive(:load).and_return(@role)
|
31
31
|
allow(@knife.ui).to receive(:edit_data).and_return(@role)
|
@@ -29,7 +29,7 @@ describe Chef::Knife::RoleEnvRunListAdd do
|
|
29
29
|
}
|
30
30
|
@knife.name_args = [ "will", "QA", "role[monkey]" ]
|
31
31
|
allow(@knife).to receive(:output).and_return(true)
|
32
|
-
@role = Chef::Role.new
|
32
|
+
@role = Chef::Role.new
|
33
33
|
allow(@role).to receive(:save).and_return(true)
|
34
34
|
allow(Chef::Role).to receive(:load).and_return(@role)
|
35
35
|
end
|
@@ -33,7 +33,7 @@ describe Chef::Knife::RoleEnvRunListClear do
|
|
33
33
|
@knife.name_args = %w{will QA}
|
34
34
|
allow(@knife).to receive(:output).and_return(true)
|
35
35
|
|
36
|
-
@role = Chef::Role.new
|
36
|
+
@role = Chef::Role.new
|
37
37
|
@role.name("will")
|
38
38
|
allow(@role).to receive(:save).and_return(true)
|
39
39
|
|
@@ -33,7 +33,7 @@ describe Chef::Knife::RoleEnvRunListRemove do
|
|
33
33
|
@knife.name_args = [ "will", "QA", "role[monkey]" ]
|
34
34
|
allow(@knife).to receive(:output).and_return(true)
|
35
35
|
|
36
|
-
@role = Chef::Role.new
|
36
|
+
@role = Chef::Role.new
|
37
37
|
@role.name("will")
|
38
38
|
allow(@role).to receive(:save).and_return(true)
|
39
39
|
|
@@ -33,7 +33,7 @@ describe Chef::Knife::RoleEnvRunListReplace do
|
|
33
33
|
@knife.name_args = [ "will", "QA", "role[dude]", "role[person]" ]
|
34
34
|
allow(@knife).to receive(:output).and_return(true)
|
35
35
|
|
36
|
-
@role = Chef::Role.new
|
36
|
+
@role = Chef::Role.new
|
37
37
|
@role.name("will")
|
38
38
|
allow(@role).to receive(:save).and_return(true)
|
39
39
|
|
@@ -33,7 +33,7 @@ describe Chef::Knife::RoleEnvRunListSet do
|
|
33
33
|
@knife.name_args = [ "will", "QA", "role[owen]", "role[mauntel]" ]
|
34
34
|
allow(@knife).to receive(:output).and_return(true)
|
35
35
|
|
36
|
-
@role = Chef::Role.new
|
36
|
+
@role = Chef::Role.new
|
37
37
|
@role.name("will")
|
38
38
|
allow(@role).to receive(:save).and_return(true)
|
39
39
|
|
@@ -30,7 +30,7 @@ describe Chef::Knife::RoleFromFile do
|
|
30
30
|
@knife.name_args = [ "adam.rb" ]
|
31
31
|
allow(@knife).to receive(:output).and_return(true)
|
32
32
|
allow(@knife).to receive(:confirm).and_return(true)
|
33
|
-
@role = Chef::Role.new
|
33
|
+
@role = Chef::Role.new
|
34
34
|
allow(@role).to receive(:save)
|
35
35
|
allow(@knife.loader).to receive(:load_from).and_return(@role)
|
36
36
|
@stdout = StringIO.new
|
@@ -29,7 +29,7 @@ describe Chef::Knife::RoleRunListAdd do
|
|
29
29
|
}
|
30
30
|
@knife.name_args = [ "will", "role[monkey]" ]
|
31
31
|
allow(@knife).to receive(:output).and_return(true)
|
32
|
-
@role = Chef::Role.new
|
32
|
+
@role = Chef::Role.new
|
33
33
|
allow(@role).to receive(:save).and_return(true)
|
34
34
|
allow(Chef::Role).to receive(:load).and_return(@role)
|
35
35
|
end
|
@@ -32,7 +32,7 @@ describe Chef::Knife::RoleRunListClear do
|
|
32
32
|
@knife.name_args = [ "will" ]
|
33
33
|
allow(@knife).to receive(:output).and_return(true)
|
34
34
|
|
35
|
-
@role = Chef::Role.new
|
35
|
+
@role = Chef::Role.new
|
36
36
|
@role.name("will")
|
37
37
|
allow(@role).to receive(:save).and_return(true)
|
38
38
|
|
@@ -32,7 +32,7 @@ describe Chef::Knife::RoleRunListRemove do
|
|
32
32
|
@knife.name_args = [ "will", "role[monkey]" ]
|
33
33
|
allow(@knife).to receive(:output).and_return(true)
|
34
34
|
|
35
|
-
@role = Chef::Role.new
|
35
|
+
@role = Chef::Role.new
|
36
36
|
@role.name("will")
|
37
37
|
allow(@role).to receive(:save).and_return(true)
|
38
38
|
|
@@ -32,7 +32,7 @@ describe Chef::Knife::RoleRunListReplace do
|
|
32
32
|
@knife.name_args = [ "will", "role[dude]", "role[person]" ]
|
33
33
|
allow(@knife).to receive(:output).and_return(true)
|
34
34
|
|
35
|
-
@role = Chef::Role.new
|
35
|
+
@role = Chef::Role.new
|
36
36
|
@role.name("will")
|
37
37
|
allow(@role).to receive(:save).and_return(true)
|
38
38
|
|
@@ -32,7 +32,7 @@ describe Chef::Knife::RoleRunListSet do
|
|
32
32
|
@knife.name_args = [ "will", "role[owen]", "role[mauntel]" ]
|
33
33
|
allow(@knife).to receive(:output).and_return(true)
|
34
34
|
|
35
|
-
@role = Chef::Role.new
|
35
|
+
@role = Chef::Role.new
|
36
36
|
@role.name("will")
|
37
37
|
allow(@role).to receive(:save).and_return(true)
|
38
38
|
|
data/spec/unit/knife/ssh_spec.rb
CHANGED
@@ -360,29 +360,39 @@ describe Chef::Knife::Ssh do
|
|
360
360
|
end
|
361
361
|
|
362
362
|
describe "#run" do
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
@knife.
|
363
|
+
|
364
|
+
it "should print usage and exit when a SEARCH QUERY is not provided" do
|
365
|
+
@knife.name_args = []
|
366
|
+
expect(@knife).to receive(:show_usage)
|
367
|
+
expect(@knife.ui).to receive(:fatal).with(/You must specify the SEARCH QUERY./)
|
368
|
+
expect { @knife.run }.to raise_error(SystemExit)
|
369
369
|
end
|
370
370
|
|
371
|
-
context "
|
372
|
-
|
371
|
+
context "exit" do
|
372
|
+
before do
|
373
|
+
@query = Chef::Search::Query.new
|
374
|
+
expect(@query).to receive(:search).and_yield(@node_foo)
|
375
|
+
allow(Chef::Search::Query).to receive(:new).and_return(@query)
|
376
|
+
allow(@knife).to receive(:ssh_command).and_return(exit_code)
|
377
|
+
@knife.name_args = ["*:*", "false"]
|
378
|
+
end
|
379
|
+
|
380
|
+
context "with an error" do
|
381
|
+
let(:exit_code) { 1 }
|
373
382
|
|
374
|
-
|
375
|
-
|
376
|
-
|
383
|
+
it "should exit with a non-zero exit code" do
|
384
|
+
expect(@knife).to receive(:exit).with(exit_code)
|
385
|
+
@knife.run
|
386
|
+
end
|
377
387
|
end
|
378
|
-
end
|
379
388
|
|
380
|
-
|
381
|
-
|
389
|
+
context "with no error" do
|
390
|
+
let(:exit_code) { 0 }
|
382
391
|
|
383
|
-
|
384
|
-
|
385
|
-
|
392
|
+
it "should not exit" do
|
393
|
+
expect(@knife).not_to receive(:exit)
|
394
|
+
@knife.run
|
395
|
+
end
|
386
396
|
end
|
387
397
|
end
|
388
398
|
end
|
@@ -69,10 +69,10 @@ describe Chef::Knife::SslCheck do
|
|
69
69
|
expect { ssl_check.run }.to raise_error(SystemExit)
|
70
70
|
expected_stdout = <<~E
|
71
71
|
USAGE: knife ssl check [URL] (options)
|
72
|
-
E
|
72
|
+
E
|
73
73
|
expected_stderr = <<~E
|
74
74
|
ERROR: Given URI: `foo.test' is invalid
|
75
|
-
E
|
75
|
+
E
|
76
76
|
expect(stdout_io.string).to eq(expected_stdout)
|
77
77
|
expect(stderr_io.string).to eq(expected_stderr)
|
78
78
|
end
|
@@ -85,10 +85,10 @@ E
|
|
85
85
|
expect { ssl_check.run }.to raise_error(SystemExit)
|
86
86
|
expected_stdout = <<~E
|
87
87
|
USAGE: knife ssl check [URL] (options)
|
88
|
-
E
|
88
|
+
E
|
89
89
|
expected_stderr = <<~E
|
90
90
|
ERROR: Given URI: `#{name_args[0]}' is invalid
|
91
|
-
E
|
91
|
+
E
|
92
92
|
expect(stdout_io.string).to eq(expected_stdout)
|
93
93
|
expect(stderr_io.string).to eq(expected_stderr)
|
94
94
|
end
|
@@ -70,10 +70,10 @@ describe Chef::Knife::SslFetch do
|
|
70
70
|
expect { ssl_fetch.run }.to raise_error(SystemExit)
|
71
71
|
expected_stdout = <<~E
|
72
72
|
USAGE: knife ssl fetch [URL] (options)
|
73
|
-
E
|
73
|
+
E
|
74
74
|
expected_stderr = <<~E
|
75
75
|
ERROR: Given URI: `foo.test' is invalid
|
76
|
-
E
|
76
|
+
E
|
77
77
|
expect(stdout_io.string).to eq(expected_stdout)
|
78
78
|
expect(stderr_io.string).to eq(expected_stderr)
|
79
79
|
end
|
@@ -86,10 +86,10 @@ E
|
|
86
86
|
expect { ssl_fetch.run }.to raise_error(SystemExit)
|
87
87
|
expected_stdout = <<~E
|
88
88
|
USAGE: knife ssl fetch [URL] (options)
|
89
|
-
E
|
89
|
+
E
|
90
90
|
expected_stderr = <<~E
|
91
91
|
ERROR: Given URI: `#{name_args[0]}' is invalid
|
92
|
-
E
|
92
|
+
E
|
93
93
|
expect(stdout_io.string).to eq(expected_stdout)
|
94
94
|
expect(stderr_io.string).to eq(expected_stderr)
|
95
95
|
end
|
@@ -190,7 +190,7 @@ E
|
|
190
190
|
expected_error_text = <<~ERROR_TEXT
|
191
191
|
ERROR: The service at the given URI (http://foo.example.com) does not accept SSL connections
|
192
192
|
ERROR: Perhaps you meant to connect to 'https://foo.example.com'?
|
193
|
-
ERROR_TEXT
|
193
|
+
ERROR_TEXT
|
194
194
|
|
195
195
|
run
|
196
196
|
expect(stderr).to include(expected_error_text)
|
@@ -30,7 +30,7 @@ describe Chef::Knife::Status do
|
|
30
30
|
@query = double("Chef::Search::Query")
|
31
31
|
allow(@query).to receive(:search).and_yield(node)
|
32
32
|
allow(Chef::Search::Query).to receive(:new).and_return(@query)
|
33
|
-
@knife
|
33
|
+
@knife = Chef::Knife::Status.new
|
34
34
|
@stdout = StringIO.new
|
35
35
|
allow(@knife.ui).to receive(:stdout).and_return(@stdout)
|
36
36
|
end
|
@@ -40,7 +40,8 @@ describe Chef::Knife::Status do
|
|
40
40
|
{ filter_result:
|
41
41
|
{ name: ["name"], ipaddress: ["ipaddress"], ohai_time: ["ohai_time"],
|
42
42
|
ec2: ["ec2"], run_list: ["run_list"], platform: ["platform"],
|
43
|
-
platform_version: ["platform_version"], chef_environment: ["chef_environment"] } }
|
43
|
+
platform_version: ["platform_version"], chef_environment: ["chef_environment"] } }
|
44
|
+
end
|
44
45
|
|
45
46
|
it "should default to searching for everything" do
|
46
47
|
expect(@query).to receive(:search).with(:node, "*:*", opts)
|
@@ -31,8 +31,8 @@ describe Chef::Knife::SupermarketDownload do
|
|
31
31
|
@cookbook_api_url = "https://supermarket.chef.io/api/v1/cookbooks"
|
32
32
|
@version = "1.0.2"
|
33
33
|
@version_us = @version.tr ".", "_"
|
34
|
-
@current_data = { "deprecated"
|
35
|
-
"latest_version"
|
34
|
+
@current_data = { "deprecated" => false,
|
35
|
+
"latest_version" => "#{@cookbook_api_url}/apache2/versions/#{@version_us}",
|
36
36
|
"replacement" => "other_apache2" }
|
37
37
|
|
38
38
|
allow(@knife.ui).to receive(:stderr).and_return(@stderr)
|
@@ -60,7 +60,7 @@ describe Chef::Knife::SupermarketDownload do
|
|
60
60
|
context "when" do
|
61
61
|
before do
|
62
62
|
@cookbook_data = { "version" => @version,
|
63
|
-
"file"
|
63
|
+
"file" => "http://example.com/apache2_#{@version_us}.tgz" }
|
64
64
|
@temp_file = double( path: "/tmp/apache2_#{@version_us}.tgz" )
|
65
65
|
@file = File.join(Dir.pwd, "apache2-#{@version}.tar.gz")
|
66
66
|
end
|
@@ -125,7 +125,7 @@ describe Chef::Knife::SupermarketDownload do
|
|
125
125
|
@version = "1.0.1"
|
126
126
|
@version_us = @version.tr ".", "_"
|
127
127
|
@cookbook_data = { "version" => @version,
|
128
|
-
"file"
|
128
|
+
"file" => "http://example.com/apache2_#{@version_us}.tgz" }
|
129
129
|
@temp_file = double(path: "/tmp/apache2_#{@version_us}.tgz")
|
130
130
|
@file = File.join(Dir.pwd, "apache2-#{@version}.tar.gz")
|
131
131
|
@knife.name_args << @version
|
@@ -23,12 +23,13 @@ describe Chef::Knife::SupermarketInstall do
|
|
23
23
|
let(:knife) { Chef::Knife::SupermarketInstall.new }
|
24
24
|
let(:stdout) { StringIO.new }
|
25
25
|
let(:stderr) { StringIO.new }
|
26
|
-
let(:downloader) {
|
26
|
+
let(:downloader) { {} }
|
27
27
|
let(:archive) { double(Mixlib::Archive, extract: true) }
|
28
28
|
let(:repo) do
|
29
29
|
double(sanity_check: true, reset_to_default_state: true,
|
30
30
|
prepare_to_import: true, finalize_updates_to: true,
|
31
|
-
merge_updates_from: true)
|
31
|
+
merge_updates_from: true)
|
32
|
+
end
|
32
33
|
let(:install_path) do
|
33
34
|
if Chef::Platform.windows?
|
34
35
|
"C:/tmp/chef"
|
@@ -81,7 +82,7 @@ describe Chef::Knife::SupermarketInstall do
|
|
81
82
|
end
|
82
83
|
|
83
84
|
it "raises an error if the second argument is not a version" do
|
84
|
-
knife.name_args =
|
85
|
+
knife.name_args = %w{getting-started 1pass}
|
85
86
|
expect(knife.ui).to receive(:error).with("Installing multiple cookbooks at once is not supported.")
|
86
87
|
expect { knife.run }.to raise_error(SystemExit)
|
87
88
|
end
|
@@ -93,7 +94,7 @@ describe Chef::Knife::SupermarketInstall do
|
|
93
94
|
end
|
94
95
|
|
95
96
|
it "raises an error if the second argument is a one-digit version" do
|
96
|
-
knife.name_args =
|
97
|
+
knife.name_args = %w{getting-started 1}
|
97
98
|
expect(knife.ui).to receive(:error).with("Installing multiple cookbooks at once is not supported.")
|
98
99
|
expect { knife.run }.to raise_error(SystemExit)
|
99
100
|
end
|
@@ -175,7 +175,7 @@ describe Chef::Knife::SupermarketShare do
|
|
175
175
|
response_text = Chef::JSONCompat.to_json({ uri: "https://supermarket.chef.io/cookbooks/cookbook_name" })
|
176
176
|
allow(@upload_response).to receive(:body).and_return(response_text)
|
177
177
|
allow(@upload_response).to receive(:code).and_return(201)
|
178
|
-
expect(Chef::CookbookSiteStreamingUploader).to receive(:post).with(/supermarket\.chef\.io/, anything
|
178
|
+
expect(Chef::CookbookSiteStreamingUploader).to receive(:post).with(/supermarket\.chef\.io/, anything, anything, anything)
|
179
179
|
@knife.run
|
180
180
|
end
|
181
181
|
|
data/spec/unit/knife_spec.rb
CHANGED
@@ -35,9 +35,9 @@ describe Chef::Knife do
|
|
35
35
|
|
36
36
|
let(:config_loader) do
|
37
37
|
instance_double("WorkstationConfigLoader",
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
load: nil, no_config_found?: false,
|
39
|
+
config_location: config_location,
|
40
|
+
chef_config_dir: "/etc/chef")
|
41
41
|
end
|
42
42
|
|
43
43
|
before(:each) do
|
@@ -55,7 +55,7 @@ describe Chef::Knife do
|
|
55
55
|
allow(knife.ui).to receive(:print)
|
56
56
|
allow(Chef::Log).to receive(:init)
|
57
57
|
allow(Chef::Log).to receive(:level)
|
58
|
-
|
58
|
+
%i{debug info warn error crit}.each do |level_sym|
|
59
59
|
allow(Chef::Log).to receive(level_sym)
|
60
60
|
end
|
61
61
|
allow(Chef::Knife).to receive(:puts)
|
@@ -166,7 +166,8 @@ describe Chef::Knife do
|
|
166
166
|
"X-Chef-Version" => Chef::VERSION,
|
167
167
|
"Host" => "api.opscode.piab",
|
168
168
|
"X-REMOTE-REQUEST-ID" => request_id,
|
169
|
-
}
|
169
|
+
}
|
170
|
+
end
|
170
171
|
|
171
172
|
let(:request_id) { "1234" }
|
172
173
|
|
@@ -205,7 +206,7 @@ describe Chef::Knife do
|
|
205
206
|
KnifeSpecs.send :remove_const, :TestYourself
|
206
207
|
end
|
207
208
|
Kernel.load(File.join(CHEF_SPEC_DATA, "knife_subcommand", "test_yourself.rb"))
|
208
|
-
Chef::Knife.subcommands.each { |name, klass| Chef::Knife.subcommands.delete(name) unless klass.
|
209
|
+
Chef::Knife.subcommands.each { |name, klass| Chef::Knife.subcommands.delete(name) unless klass.is_a?(Class) }
|
209
210
|
end
|
210
211
|
|
211
212
|
it "confirms that the headers include X-Remote-Request-Id" do
|
@@ -220,7 +221,7 @@ describe Chef::Knife do
|
|
220
221
|
KnifeSpecs.send :remove_const, :TestYourself
|
221
222
|
end
|
222
223
|
Kernel.load(File.join(CHEF_SPEC_DATA, "knife_subcommand", "test_yourself.rb"))
|
223
|
-
Chef::Knife.subcommands.each { |name, klass| Chef::Knife.subcommands.delete(name) unless klass.
|
224
|
+
Chef::Knife.subcommands.each { |name, klass| Chef::Knife.subcommands.delete(name) unless klass.is_a?(Class) }
|
224
225
|
end
|
225
226
|
|
226
227
|
it "merges the global knife CLI options" do
|
@@ -283,8 +284,8 @@ describe Chef::Knife do
|
|
283
284
|
describe "merging configuration options" do
|
284
285
|
before do
|
285
286
|
KnifeSpecs::TestYourself.option(:opt_with_default,
|
286
|
-
|
287
|
-
|
287
|
+
short: "-D VALUE",
|
288
|
+
default: "default-value")
|
288
289
|
end
|
289
290
|
|
290
291
|
it "sets the default log_location to STDERR for Chef::Log warnings" do
|
@@ -440,8 +441,8 @@ describe Chef::Knife do
|
|
440
441
|
allow(knife).to receive(:run).and_raise(Net::HTTPClientException.new("403 Forbidden", response))
|
441
442
|
allow(knife).to receive(:username).and_return("sadpanda")
|
442
443
|
knife.run_with_pretty_exceptions
|
443
|
-
expect(stderr.string).to match(
|
444
|
-
expect(stderr.string).to match(
|
444
|
+
expect(stderr.string).to match(/ERROR: You authenticated successfully to http.+ as sadpanda but you are not authorized for this action/)
|
445
|
+
expect(stderr.string).to match(/Response: y u no administrator/)
|
445
446
|
end
|
446
447
|
|
447
448
|
context "when proxy servers are set" do
|
@@ -460,9 +461,9 @@ describe Chef::Knife do
|
|
460
461
|
allow(knife).to receive(:run).and_raise(Net::HTTPClientException.new("403 Forbidden", response))
|
461
462
|
allow(knife).to receive(:username).and_return("sadpanda")
|
462
463
|
knife.run_with_pretty_exceptions
|
463
|
-
expect(stderr.string).to match(
|
464
|
-
expect(stderr.string).to match(
|
465
|
-
expect(stderr.string).to match(
|
464
|
+
expect(stderr.string).to match(/ERROR: You authenticated successfully to http.+ as sadpanda but you are not authorized for this action/)
|
465
|
+
expect(stderr.string).to match(/ERROR: There are proxy servers configured, your Chef server may need to be added to NO_PROXY./)
|
466
|
+
expect(stderr.string).to match(/Response: y u no administrator/)
|
466
467
|
end
|
467
468
|
end
|
468
469
|
|
@@ -472,8 +473,8 @@ describe Chef::Knife do
|
|
472
473
|
allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(error: "y u search wrong"))
|
473
474
|
allow(knife).to receive(:run).and_raise(Net::HTTPClientException.new("400 Bad Request", response))
|
474
475
|
knife.run_with_pretty_exceptions
|
475
|
-
expect(stderr.string).to match(
|
476
|
-
expect(stderr.string).to match(
|
476
|
+
expect(stderr.string).to match(/ERROR: The data in your request was invalid/)
|
477
|
+
expect(stderr.string).to match(/Response: y u search wrong/)
|
477
478
|
end
|
478
479
|
|
479
480
|
it "formats 404s nicely" do
|
@@ -482,8 +483,8 @@ describe Chef::Knife do
|
|
482
483
|
allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(error: "nothing to see here"))
|
483
484
|
allow(knife).to receive(:run).and_raise(Net::HTTPClientException.new("404 Not Found", response))
|
484
485
|
knife.run_with_pretty_exceptions
|
485
|
-
expect(stderr.string).to match(
|
486
|
-
expect(stderr.string).to match(
|
486
|
+
expect(stderr.string).to match(/ERROR: The object you are looking for could not be found/)
|
487
|
+
expect(stderr.string).to match(/Response: nothing to see here/)
|
487
488
|
end
|
488
489
|
|
489
490
|
it "formats 406s (non-supported API version error) nicely" do
|
@@ -508,8 +509,8 @@ describe Chef::Knife do
|
|
508
509
|
allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(error: "sad trombone"))
|
509
510
|
allow(knife).to receive(:run).and_raise(Net::HTTPFatalError.new("500 Internal Server Error", response))
|
510
511
|
knife.run_with_pretty_exceptions
|
511
|
-
expect(stderr.string).to match(
|
512
|
-
expect(stderr.string).to match(
|
512
|
+
expect(stderr.string).to match(/ERROR: internal server error/)
|
513
|
+
expect(stderr.string).to match(/Response: sad trombone/)
|
513
514
|
end
|
514
515
|
|
515
516
|
it "formats 502s nicely" do
|
@@ -518,8 +519,8 @@ describe Chef::Knife do
|
|
518
519
|
allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(error: "sadder trombone"))
|
519
520
|
allow(knife).to receive(:run).and_raise(Net::HTTPFatalError.new("502 Bad Gateway", response))
|
520
521
|
knife.run_with_pretty_exceptions
|
521
|
-
expect(stderr.string).to match(
|
522
|
-
expect(stderr.string).to match(
|
522
|
+
expect(stderr.string).to match(/ERROR: bad gateway/)
|
523
|
+
expect(stderr.string).to match(/Response: sadder trombone/)
|
523
524
|
end
|
524
525
|
|
525
526
|
it "formats 503s nicely" do
|
@@ -528,8 +529,8 @@ describe Chef::Knife do
|
|
528
529
|
allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(error: "saddest trombone"))
|
529
530
|
allow(knife).to receive(:run).and_raise(Net::HTTPFatalError.new("503 Service Unavailable", response))
|
530
531
|
knife.run_with_pretty_exceptions
|
531
|
-
expect(stderr.string).to match(
|
532
|
-
expect(stderr.string).to match(
|
532
|
+
expect(stderr.string).to match(/ERROR: Service temporarily unavailable/)
|
533
|
+
expect(stderr.string).to match(/Response: saddest trombone/)
|
533
534
|
end
|
534
535
|
|
535
536
|
it "formats other HTTP errors nicely" do
|
@@ -538,16 +539,16 @@ describe Chef::Knife do
|
|
538
539
|
allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(error: "nobugfixtillyoubuy"))
|
539
540
|
allow(knife).to receive(:run).and_raise(Net::HTTPClientException.new("402 Payment Required", response))
|
540
541
|
knife.run_with_pretty_exceptions
|
541
|
-
expect(stderr.string).to match(
|
542
|
-
expect(stderr.string).to match(
|
542
|
+
expect(stderr.string).to match(/ERROR: Payment Required/)
|
543
|
+
expect(stderr.string).to match(/Response: nobugfixtillyoubuy/)
|
543
544
|
end
|
544
545
|
|
545
546
|
it "formats NameError and NoMethodError nicely" do
|
546
547
|
allow(knife).to receive(:run).and_raise(NameError.new("Undefined constant FUUU"))
|
547
548
|
knife.run_with_pretty_exceptions
|
548
|
-
expect(stderr.string).to match(
|
549
|
-
expect(stderr.string).to match(
|
550
|
-
expect(stderr.string).to match(
|
549
|
+
expect(stderr.string).to match(/ERROR: knife encountered an unexpected error/)
|
550
|
+
expect(stderr.string).to match(/This may be a bug in the 'knife' knife command or plugin/)
|
551
|
+
expect(stderr.string).to match(/Exception: NameError: Undefined constant FUUU/)
|
551
552
|
end
|
552
553
|
|
553
554
|
it "formats missing private key errors nicely" do
|
@@ -555,7 +556,7 @@ describe Chef::Knife do
|
|
555
556
|
allow(knife).to receive(:api_key).and_return("/home/root/.chef/no-key-here.pem")
|
556
557
|
knife.run_with_pretty_exceptions
|
557
558
|
expect(stderr.string).to match(%r{ERROR: Your private key could not be loaded from /home/root/.chef/no-key-here.pem})
|
558
|
-
expect(stderr.string).to match(
|
559
|
+
expect(stderr.string).to match(/Check your configuration file and ensure that your private key is readable/)
|
559
560
|
end
|
560
561
|
|
561
562
|
it "formats connection refused errors nicely" do
|
@@ -564,8 +565,8 @@ describe Chef::Knife do
|
|
564
565
|
# Errno::ECONNREFUSED message differs by platform
|
565
566
|
# *nix = Errno::ECONNREFUSED: Connection refused
|
566
567
|
# win32: Errno::ECONNREFUSED: No connection could be made because the target machine actively refused it.
|
567
|
-
expect(stderr.string).to match(
|
568
|
-
expect(stderr.string).to match(
|
568
|
+
expect(stderr.string).to match(/ERROR: Network Error: .* - y u no shut up/)
|
569
|
+
expect(stderr.string).to match(/Check your knife configuration and network settings/)
|
569
570
|
end
|
570
571
|
|
571
572
|
it "formats SSL errors nicely and suggests to use `knife ssl check` and `knife ssl fetch`" do
|
@@ -579,7 +580,7 @@ describe Chef::Knife do
|
|
579
580
|
Use `knife ssl check` to troubleshoot your SSL configuration.
|
580
581
|
If your Chef Server uses a self-signed certificate, you can use
|
581
582
|
`knife ssl fetch` to make knife trust the server's certificates.
|
582
|
-
MSG
|
583
|
+
MSG
|
583
584
|
expect(stderr.string).to include(expected_message)
|
584
585
|
end
|
585
586
|
|