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
@@ -436,7 +436,8 @@ describe Chef::Provider::Package::Windows, :windows_only do
|
|
436
436
|
|
437
437
|
it "raises the checksum mismatch exception" do
|
438
438
|
expect { provider.send(:validate_content!) }.to raise_error(
|
439
|
-
Chef::Exceptions::ChecksumMismatch
|
439
|
+
Chef::Exceptions::ChecksumMismatch
|
440
|
+
)
|
440
441
|
end
|
441
442
|
end
|
442
443
|
end
|
@@ -60,7 +60,7 @@ describe Chef::Provider::Package::Yum::YumCache do
|
|
60
60
|
expect( yum_cache.version_available?("foo", "1.2.3", "x86_64") ).to be true
|
61
61
|
end
|
62
62
|
|
63
|
-
|
63
|
+
%i{refresh reload reload_installed reload_provides reset reset_installed}.each do |method|
|
64
64
|
it "restarts the python helper when #{method} is called" do
|
65
65
|
expect( python_helper ).to receive(:restart)
|
66
66
|
yum_cache.send(method)
|
@@ -232,7 +232,7 @@ describe Chef::Provider::Package::Zypper do
|
|
232
232
|
context "when package version is not explicitly specified" do
|
233
233
|
it "should run zypper remove with the package name" do
|
234
234
|
shell_out_expectation!(
|
235
|
-
|
235
|
+
"zypper", "--non-interactive", "remove", "emacs"
|
236
236
|
)
|
237
237
|
provider.remove_package(["emacs"], [nil])
|
238
238
|
end
|
@@ -248,14 +248,14 @@ describe Chef::Provider::Package::Zypper do
|
|
248
248
|
it "should run zypper remove without gpg checks" do
|
249
249
|
new_resource.gpg_check false
|
250
250
|
shell_out_expectation!(
|
251
|
-
|
251
|
+
"zypper", "--non-interactive", "--no-gpg-checks", "remove", "emacs=1.0"
|
252
252
|
)
|
253
253
|
provider.remove_package(["emacs"], ["1.0"])
|
254
254
|
end
|
255
255
|
it "should run zypper remove without gpg checks when the config is false" do
|
256
256
|
Chef::Config[:zypper_check_gpg] = false
|
257
257
|
shell_out_expectation!(
|
258
|
-
|
258
|
+
"zypper", "--non-interactive", "--no-gpg-checks", "remove", "emacs=1.0"
|
259
259
|
)
|
260
260
|
provider.remove_package(["emacs"], ["1.0"])
|
261
261
|
end
|
@@ -462,7 +462,7 @@ describe Chef::Provider::Package::Zypper do
|
|
462
462
|
describe "remove_package" do
|
463
463
|
it "should run zypper remove with the package name" do
|
464
464
|
shell_out_expectation!(
|
465
|
-
|
465
|
+
"zypper", "remove", "-y", "emacs"
|
466
466
|
)
|
467
467
|
provider.remove_package(["emacs"], ["1.0"])
|
468
468
|
end
|
@@ -956,7 +956,7 @@ describe "Chef::Provider::Package - Multi" do
|
|
956
956
|
Chef::Config[:treat_deprecation_warnings_as_errors] = false
|
957
957
|
end
|
958
958
|
|
959
|
-
|
959
|
+
%i{shell_out_with_timeout shell_out_with_timeout!}.each do |method|
|
960
960
|
stubbed_method = method == :shell_out_with_timeout! ? :shell_out_compacted! : :shell_out_compacted
|
961
961
|
[ %w{command arg1 arg2}, "command arg1 arg2" ].each do |command|
|
962
962
|
it "#{method} defaults to 900 seconds" do
|
@@ -22,9 +22,9 @@ describe Chef::Provider::PowershellScript, "action_run" do
|
|
22
22
|
let(:powershell_version) { nil }
|
23
23
|
let(:node) do
|
24
24
|
node = Chef::Node.new
|
25
|
-
node.default["kernel"] =
|
25
|
+
node.default["kernel"] = {}
|
26
26
|
node.default["kernel"][:machine] = :x86_64.to_s
|
27
|
-
|
27
|
+
unless powershell_version.nil?
|
28
28
|
node.default[:languages] = { powershell: { version: powershell_version } }
|
29
29
|
end
|
30
30
|
node
|
@@ -103,14 +103,14 @@ describe Chef::Provider::PowershellScript, "action_run" do
|
|
103
103
|
"3.6" => "Bypass",
|
104
104
|
"4.0" => "Bypass",
|
105
105
|
"5.0" => "Bypass" }.each do |version_policy|
|
106
|
-
let(:powershell_version) { version_policy[0].to_f }
|
107
|
-
context "when running PowerShell version #{version_policy[0]}" do
|
108
106
|
let(:powershell_version) { version_policy[0].to_f }
|
109
|
-
|
110
|
-
|
107
|
+
context "when running PowerShell version #{version_policy[0]}" do
|
108
|
+
let(:powershell_version) { version_policy[0].to_f }
|
109
|
+
it "sets the -ExecutionPolicy flag to '#{version_policy[1]}'" do
|
110
|
+
expect(execution_policy_flag.downcase).to eq(version_policy[1].downcase)
|
111
|
+
end
|
111
112
|
end
|
112
113
|
end
|
113
|
-
end
|
114
114
|
end
|
115
115
|
end
|
116
116
|
end
|
@@ -322,7 +322,7 @@ describe Chef::Provider::RegistryKey do
|
|
322
322
|
expect(@double_registry).to receive(:get_values).with(keyname).and_return(
|
323
323
|
[
|
324
324
|
{ name: "one", type: :string, data: "initial value" },
|
325
|
-
{ name: "two", type: :dword, data: 9001 }
|
325
|
+
{ name: "two", type: :dword, data: 9001 },
|
326
326
|
]
|
327
327
|
)
|
328
328
|
end
|
@@ -90,8 +90,8 @@ describe Chef::Provider::RemoteDirectory do
|
|
90
90
|
it "configures access control on files in the directory" do
|
91
91
|
@resource.cookbook "berlin_style_tasty_cupcakes"
|
92
92
|
cookbook_file = @provider.send(:cookbook_file_resource,
|
93
|
-
|
94
|
-
|
93
|
+
"/target/destination/path.txt",
|
94
|
+
"relative/source/path.txt")
|
95
95
|
expect(cookbook_file.cookbook_name).to eq("berlin_style_tasty_cupcakes")
|
96
96
|
expect(cookbook_file.source).to eq("remotedir_root/relative/source/path.txt")
|
97
97
|
expect(cookbook_file.mode).to eq("0640")
|
@@ -104,14 +104,14 @@ describe Chef::Provider::RemoteDirectory do
|
|
104
104
|
@resource.cookbook "gondola_rides"
|
105
105
|
@resource.sensitive true
|
106
106
|
cookbook_file = @provider.send(:cookbook_file_resource,
|
107
|
-
|
108
|
-
|
107
|
+
"/target/destination/path.txt",
|
108
|
+
"relative/source/path.txt")
|
109
109
|
expect(cookbook_file.sensitive).to eq(true)
|
110
110
|
|
111
111
|
@resource.sensitive false
|
112
112
|
cookbook_file = @provider.send(:cookbook_file_resource,
|
113
|
-
|
114
|
-
|
113
|
+
"/target/destination/path.txt",
|
114
|
+
"relative/source/path.txt")
|
115
115
|
expect(cookbook_file.sensitive).to eq(false)
|
116
116
|
end
|
117
117
|
end
|
@@ -125,7 +125,7 @@ describe Chef::Provider::Route do
|
|
125
125
|
@resource_add.action(:add)
|
126
126
|
@provider.run_action(:add)
|
127
127
|
expect(route_file.string.split("\n").size).to eq(1)
|
128
|
-
expect(route_file.string).to match(
|
128
|
+
expect(route_file.string).to match(%r{^192\.168\.1\.0/24 via 192\.168\.0\.1$})
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
@@ -150,12 +150,12 @@ describe Chef::Provider::Route do
|
|
150
150
|
describe Chef::Provider::Route, "generate_command for action_add" do
|
151
151
|
it "should include a netmask when a one is specified" do
|
152
152
|
@new_resource.netmask("255.255.0.0")
|
153
|
-
expect(@provider.generate_command(:add).join(" ")).to match(
|
153
|
+
expect(@provider.generate_command(:add).join(" ")).to match(%r{/\d{1,2}})
|
154
154
|
end
|
155
155
|
|
156
156
|
it "should not include a netmask when a one is specified" do
|
157
157
|
@new_resource.netmask(nil)
|
158
|
-
expect(@provider.generate_command(:add).join(" ")).not_to match(
|
158
|
+
expect(@provider.generate_command(:add).join(" ")).not_to match(%r{/\d{1,2}})
|
159
159
|
end
|
160
160
|
|
161
161
|
it "should include ' via $gateway ' when a gateway is specified" do
|
@@ -176,12 +176,12 @@ describe Chef::Provider::Route do
|
|
176
176
|
describe Chef::Provider::Route, "generate_command for action_delete" do
|
177
177
|
it "should include a netmask when a one is specified" do
|
178
178
|
@new_resource.netmask("255.255.0.0")
|
179
|
-
expect(@provider.generate_command(:delete).join(" ")).to match(
|
179
|
+
expect(@provider.generate_command(:delete).join(" ")).to match(%r{/\d{1,2}})
|
180
180
|
end
|
181
181
|
|
182
182
|
it "should not include a netmask when a one is specified" do
|
183
183
|
@new_resource.netmask(nil)
|
184
|
-
expect(@provider.generate_command(:delete).join(" ")).not_to match(
|
184
|
+
expect(@provider.generate_command(:delete).join(" ")).not_to match(%r{/\d{1,2}})
|
185
185
|
end
|
186
186
|
|
187
187
|
it "should include ' via $gateway ' when a gateway is specified" do
|
@@ -197,11 +197,11 @@ describe Chef::Provider::Route do
|
|
197
197
|
describe Chef::Provider::Route, "config_file_contents for action_add" do
|
198
198
|
it "should include a netmask when a one is specified" do
|
199
199
|
@new_resource.netmask("255.255.0.0")
|
200
|
-
expect(@provider.config_file_contents(:add, target: @new_resource.target, netmask: @new_resource.netmask)).to match(
|
200
|
+
expect(@provider.config_file_contents(:add, target: @new_resource.target, netmask: @new_resource.netmask)).to match(%r{/\d{1,2}.*\n$})
|
201
201
|
end
|
202
202
|
|
203
203
|
it "should not include a netmask when a one is specified" do
|
204
|
-
expect(@provider.config_file_contents(:add, target: @new_resource.target)).not_to match(
|
204
|
+
expect(@provider.config_file_contents(:add, target: @new_resource.target)).not_to match(%r{/\d{1,2}.*\n$})
|
205
205
|
end
|
206
206
|
|
207
207
|
it "should include ' via $gateway ' when a gateway is specified" do
|
@@ -261,10 +261,10 @@ describe Chef::Provider::Route do
|
|
261
261
|
@provider.action = :add
|
262
262
|
@provider.generate_config
|
263
263
|
expect(route_file.string.split("\n").size).to eq(4)
|
264
|
-
expect(route_file.string).to match(
|
265
|
-
expect(route_file.string).to match(
|
266
|
-
expect(route_file.string).to match(
|
267
|
-
expect(route_file.string).to match(
|
264
|
+
expect(route_file.string).to match(%r{^192\.168\.1\.0/24 via 192\.168\.0\.1$})
|
265
|
+
expect(route_file.string).to match(%r{^192\.168\.2\.0/24 via 192\.168\.0\.1$})
|
266
|
+
expect(route_file.string).to match(%r{^192\.168\.3\.0/24 via 192\.168\.0\.1$})
|
267
|
+
expect(route_file.string).to match(%r{^192\.168\.4\.0/24 via 192\.168\.0\.1$})
|
268
268
|
end
|
269
269
|
end
|
270
270
|
end
|
@@ -121,7 +121,7 @@ describe Chef::Provider::Service::Arch, "load_current_resource" do
|
|
121
121
|
aj 7842 5057 0 21:26 pts/2 00:00:06 vi init.rb
|
122
122
|
aj 7903 5016 0 21:26 pts/5 00:00:00 /bin/bash
|
123
123
|
aj 8119 6041 0 21:34 pts/3 00:00:03 vi init_service_spec.rb
|
124
|
-
DEFAULT_PS
|
124
|
+
DEFAULT_PS
|
125
125
|
@status = double("Status", exitstatus: 0, stdout: @stdout)
|
126
126
|
allow(@provider).to receive(:shell_out!).and_return(@status)
|
127
127
|
|
@@ -132,7 +132,7 @@ DEFAULT_PS
|
|
132
132
|
@stdout = StringIO.new(<<~RUNNING_PS)
|
133
133
|
aj 7842 5057 0 21:26 pts/2 00:00:06 chef
|
134
134
|
aj 7842 5057 0 21:26 pts/2 00:00:06 poos
|
135
|
-
RUNNING_PS
|
135
|
+
RUNNING_PS
|
136
136
|
allow(@status).to receive(:stdout).and_return(@stdout)
|
137
137
|
@provider.load_current_resource
|
138
138
|
expect(@provider.current_resource.running).to be_truthy
|
@@ -181,7 +181,7 @@ RUNNING_PS
|
|
181
181
|
it "should add chef to DAEMONS array" do
|
182
182
|
allow(::File).to receive(:read).with("/etc/rc.conf").and_return("DAEMONS=(network)")
|
183
183
|
expect(@provider).to receive(:update_daemons).with(%w{network chef})
|
184
|
-
@provider.enable_service
|
184
|
+
@provider.enable_service
|
185
185
|
end
|
186
186
|
end
|
187
187
|
|
@@ -202,7 +202,7 @@ RUNNING_PS
|
|
202
202
|
it "should remove chef from DAEMONS array" do
|
203
203
|
allow(::File).to receive(:read).with("/etc/rc.conf").and_return("DAEMONS=(network chef)")
|
204
204
|
expect(@provider).to receive(:update_daemons).with(["network", "!chef"])
|
205
|
-
@provider.disable_service
|
205
|
+
@provider.disable_service
|
206
206
|
end
|
207
207
|
end
|
208
208
|
|
@@ -223,12 +223,12 @@ RUNNING_PS
|
|
223
223
|
it "should call the start command if one is specified" do
|
224
224
|
@new_resource.start_command("/etc/rc.d/chef startyousillysally")
|
225
225
|
expect(@provider).to receive(:shell_out!).with("/etc/rc.d/chef startyousillysally", default_env: false)
|
226
|
-
@provider.start_service
|
226
|
+
@provider.start_service
|
227
227
|
end
|
228
228
|
|
229
229
|
it "should call '/etc/rc.d/service_name start' if no start command is specified" do
|
230
230
|
expect(@provider).to receive(:shell_out!).with("/etc/rc.d/#{@new_resource.service_name} start", default_env: false)
|
231
|
-
@provider.start_service
|
231
|
+
@provider.start_service
|
232
232
|
end
|
233
233
|
end
|
234
234
|
|
@@ -249,12 +249,12 @@ RUNNING_PS
|
|
249
249
|
it "should call the stop command if one is specified" do
|
250
250
|
@new_resource.stop_command("/etc/rc.d/chef itoldyoutostop")
|
251
251
|
expect(@provider).to receive(:shell_out!).with("/etc/rc.d/chef itoldyoutostop", default_env: false)
|
252
|
-
@provider.stop_service
|
252
|
+
@provider.stop_service
|
253
253
|
end
|
254
254
|
|
255
255
|
it "should call '/etc/rc.d/service_name stop' if no stop command is specified" do
|
256
256
|
expect(@provider).to receive(:shell_out!).with("/etc/rc.d/#{@new_resource.service_name} stop", default_env: false)
|
257
|
-
@provider.stop_service
|
257
|
+
@provider.stop_service
|
258
258
|
end
|
259
259
|
end
|
260
260
|
|
@@ -276,20 +276,20 @@ RUNNING_PS
|
|
276
276
|
it "should call 'restart' on the service_name if the resource supports it" do
|
277
277
|
@new_resource.supports({ restart: true })
|
278
278
|
expect(@provider).to receive(:shell_out!).with("/etc/rc.d/#{@new_resource.service_name} restart", default_env: false)
|
279
|
-
@provider.restart_service
|
279
|
+
@provider.restart_service
|
280
280
|
end
|
281
281
|
|
282
282
|
it "should call the restart_command if one has been specified" do
|
283
283
|
@new_resource.restart_command("/etc/rc.d/chef restartinafire")
|
284
284
|
expect(@provider).to receive(:shell_out!).with("/etc/rc.d/#{@new_resource.service_name} restartinafire", default_env: false)
|
285
|
-
@provider.restart_service
|
285
|
+
@provider.restart_service
|
286
286
|
end
|
287
287
|
|
288
288
|
it "should just call stop, then start when the resource doesn't support restart and no restart_command is specified" do
|
289
289
|
expect(@provider).to receive(:stop_service)
|
290
290
|
expect(@provider).to receive(:sleep).with(1)
|
291
291
|
expect(@provider).to receive(:start_service)
|
292
|
-
@provider.restart_service
|
292
|
+
@provider.restart_service
|
293
293
|
end
|
294
294
|
end
|
295
295
|
|
@@ -311,13 +311,13 @@ RUNNING_PS
|
|
311
311
|
it "should call 'reload' on the service if it supports it" do
|
312
312
|
@new_resource.supports({ reload: true })
|
313
313
|
expect(@provider).to receive(:shell_out!).with("/etc/rc.d/#{@new_resource.service_name} reload", default_env: false)
|
314
|
-
@provider.reload_service
|
314
|
+
@provider.reload_service
|
315
315
|
end
|
316
316
|
|
317
317
|
it "should should run the user specified reload command if one is specified and the service doesn't support reload" do
|
318
318
|
@new_resource.reload_command("/etc/rc.d/chef lollerpants")
|
319
319
|
expect(@provider).to receive(:shell_out!).with("/etc/rc.d/#{@new_resource.service_name} lollerpants", default_env: false)
|
320
|
-
@provider.reload_service
|
320
|
+
@provider.reload_service
|
321
321
|
end
|
322
322
|
end
|
323
323
|
end
|
@@ -142,7 +142,7 @@ describe Chef::Provider::Service::Freebsd do
|
|
142
142
|
413 ?? Ss 0:02.51 /usr/sbin/syslogd -s
|
143
143
|
539 ?? Is 0:00.14 /usr/sbin/sshd
|
144
144
|
545 ?? Ss 0:17.53 sendmail: accepting connections (sendmail)
|
145
|
-
PS_SAMPLE
|
145
|
+
PS_SAMPLE
|
146
146
|
end
|
147
147
|
let(:status) { double(stdout: stdout, exitstatus: 0) }
|
148
148
|
|
@@ -261,7 +261,8 @@ PS_SAMPLE
|
|
261
261
|
[
|
262
262
|
%Q{thing_#{new_resource.service_name}_enable="YES"},
|
263
263
|
%Q{#{new_resource.service_name}_enable="NO"},
|
264
|
-
]
|
264
|
+
]
|
265
|
+
end
|
265
266
|
it "sets enabled based on the exact match (false)" do
|
266
267
|
provider.determine_enabled_status!
|
267
268
|
expect(current_resource.enabled).to be false
|
@@ -273,7 +274,8 @@ PS_SAMPLE
|
|
273
274
|
[
|
274
275
|
%Q{#{new_resource.service_name}_thing_enable="YES"},
|
275
276
|
%Q{#{new_resource.service_name}_enable="NO"},
|
276
|
-
]
|
277
|
+
]
|
278
|
+
end
|
277
279
|
it "sets enabled based on the exact match (false)" do
|
278
280
|
provider.determine_enabled_status!
|
279
281
|
expect(current_resource.enabled).to be false
|
@@ -285,7 +287,8 @@ PS_SAMPLE
|
|
285
287
|
[
|
286
288
|
%Q{thing_#{new_resource.service_name}_enable="NO"},
|
287
289
|
%Q{#{new_resource.service_name}_enable="YES"},
|
288
|
-
]
|
290
|
+
]
|
291
|
+
end
|
289
292
|
it "sets enabled based on the exact match (true)" do
|
290
293
|
provider.determine_enabled_status!
|
291
294
|
expect(current_resource.enabled).to be true
|
@@ -297,7 +300,8 @@ PS_SAMPLE
|
|
297
300
|
[
|
298
301
|
%Q{#{new_resource.service_name}_thing_enable="NO"},
|
299
302
|
%Q{#{new_resource.service_name}_enable="YES"},
|
300
|
-
]
|
303
|
+
]
|
304
|
+
end
|
301
305
|
it "sets enabled based on the exact match (true)" do
|
302
306
|
provider.determine_enabled_status!
|
303
307
|
expect(current_resource.enabled).to be true
|
@@ -344,7 +348,7 @@ PS_SAMPLE
|
|
344
348
|
StringIO.new(<<~EOF)
|
345
349
|
name="#{new_resource.service_name}"
|
346
350
|
rcvar=`set_rcvar`
|
347
|
-
EOF
|
351
|
+
EOF
|
348
352
|
end
|
349
353
|
|
350
354
|
it "should not raise an exception if the rcscript have a name variable" do
|
@@ -365,7 +369,7 @@ EOF
|
|
365
369
|
let(:rcscript) do
|
366
370
|
StringIO.new <<~EOF
|
367
371
|
rcvar=`set_rcvar`
|
368
|
-
EOF
|
372
|
+
EOF
|
369
373
|
end
|
370
374
|
|
371
375
|
before do
|
@@ -380,7 +384,7 @@ EOF
|
|
380
384
|
#
|
381
385
|
# #{new_resource.service_name}_enable="YES"
|
382
386
|
# (default: "")
|
383
|
-
EOF
|
387
|
+
EOF
|
384
388
|
end
|
385
389
|
|
386
390
|
it "should get the service name from rcvar if the rcscript does not have a name variable" do
|
@@ -397,7 +401,7 @@ EOF
|
|
397
401
|
rcvar_stdout = <<~EOF
|
398
402
|
# service_with_noname
|
399
403
|
#
|
400
|
-
EOF
|
404
|
+
EOF
|
401
405
|
end
|
402
406
|
|
403
407
|
it "should return nil" do
|
@@ -445,12 +449,12 @@ EOF
|
|
445
449
|
it "should call the start command if one is specified" do
|
446
450
|
new_resource.start_command("/etc/rc.d/chef startyousillysally")
|
447
451
|
expect(provider).to receive(:shell_out!).with("/etc/rc.d/chef startyousillysally", default_env: false)
|
448
|
-
provider.start_service
|
452
|
+
provider.start_service
|
449
453
|
end
|
450
454
|
|
451
455
|
it "should call '/usr/local/etc/rc.d/service_name faststart' if no start command is specified" do
|
452
456
|
expect(provider).to receive(:shell_out!).with("/usr/local/etc/rc.d/#{new_resource.service_name} faststart", default_env: false)
|
453
|
-
provider.start_service
|
457
|
+
provider.start_service
|
454
458
|
end
|
455
459
|
end
|
456
460
|
|
@@ -458,12 +462,12 @@ EOF
|
|
458
462
|
it "should call the stop command if one is specified" do
|
459
463
|
new_resource.stop_command("/etc/init.d/chef itoldyoutostop")
|
460
464
|
expect(provider).to receive(:shell_out!).with("/etc/init.d/chef itoldyoutostop", default_env: false)
|
461
|
-
provider.stop_service
|
465
|
+
provider.stop_service
|
462
466
|
end
|
463
467
|
|
464
468
|
it "should call '/usr/local/etc/rc.d/service_name faststop' if no stop command is specified" do
|
465
469
|
expect(provider).to receive(:shell_out!).with("/usr/local/etc/rc.d/#{new_resource.service_name} faststop", default_env: false)
|
466
|
-
provider.stop_service
|
470
|
+
provider.stop_service
|
467
471
|
end
|
468
472
|
end
|
469
473
|
|
@@ -471,19 +475,19 @@ EOF
|
|
471
475
|
it "should call 'restart' on the service_name if the resource supports it" do
|
472
476
|
new_resource.supports({ restart: true })
|
473
477
|
expect(provider).to receive(:shell_out!).with("/usr/local/etc/rc.d/#{new_resource.service_name} fastrestart", default_env: false)
|
474
|
-
provider.restart_service
|
478
|
+
provider.restart_service
|
475
479
|
end
|
476
480
|
|
477
481
|
it "should call the restart_command if one has been specified" do
|
478
482
|
new_resource.restart_command("/etc/init.d/chef restartinafire")
|
479
483
|
expect(provider).to receive(:shell_out!).with("/etc/init.d/chef restartinafire", default_env: false)
|
480
|
-
provider.restart_service
|
484
|
+
provider.restart_service
|
481
485
|
end
|
482
486
|
|
483
487
|
it "otherwise it should call stop and start" do
|
484
488
|
expect(provider).to receive(:stop_service)
|
485
489
|
expect(provider).to receive(:start_service)
|
486
|
-
provider.restart_service
|
490
|
+
provider.restart_service
|
487
491
|
end
|
488
492
|
end
|
489
493
|
end
|
@@ -550,21 +554,21 @@ EOF
|
|
550
554
|
allow(current_resource).to receive(:enabled).and_return(false)
|
551
555
|
expect(provider).to receive(:read_rc_conf).and_return([ "foo", "#{new_resource.service_name}_enable=\"NO\"", "bar" ])
|
552
556
|
expect(provider).to receive(:write_rc_conf).with(["foo", "bar", "#{new_resource.service_name}_enable=\"YES\""])
|
553
|
-
provider.enable_service
|
557
|
+
provider.enable_service
|
554
558
|
end
|
555
559
|
|
556
560
|
it "should not partial match an already enabled service" do
|
557
561
|
allow(current_resource).to receive(:enabled).and_return(false)
|
558
562
|
expect(provider).to receive(:read_rc_conf).and_return([ "foo", "thing_#{new_resource.service_name}_enable=\"NO\"", "bar" ])
|
559
563
|
expect(provider).to receive(:write_rc_conf).with(["foo", "thing_#{new_resource.service_name}_enable=\"NO\"", "bar", "#{new_resource.service_name}_enable=\"YES\""])
|
560
|
-
provider.enable_service
|
564
|
+
provider.enable_service
|
561
565
|
end
|
562
566
|
|
563
567
|
it "should enable the service if it is not enabled and not already specified in the rc.conf file" do
|
564
568
|
allow(current_resource).to receive(:enabled).and_return(false)
|
565
569
|
expect(provider).to receive(:read_rc_conf).and_return(%w{foo bar})
|
566
570
|
expect(provider).to receive(:write_rc_conf).with(["foo", "bar", "#{new_resource.service_name}_enable=\"YES\""])
|
567
|
-
provider.enable_service
|
571
|
+
provider.enable_service
|
568
572
|
end
|
569
573
|
|
570
574
|
it "should not enable the service if it is already enabled" do
|
@@ -577,7 +581,7 @@ EOF
|
|
577
581
|
allow(current_resource).to receive(:enabled).and_return(false)
|
578
582
|
expect(provider).to receive(:read_rc_conf).and_return([ "foo", "bar", "\# #{new_resource.service_name}_enable=\"YES\"", "\# #{new_resource.service_name}_enable=\"NO\""])
|
579
583
|
expect(provider).to receive(:write_rc_conf).with(["foo", "bar", "#{new_resource.service_name}_enable=\"YES\""])
|
580
|
-
provider.enable_service
|
584
|
+
provider.enable_service
|
581
585
|
end
|
582
586
|
end
|
583
587
|
|
@@ -591,27 +595,27 @@ EOF
|
|
591
595
|
allow(current_resource).to receive(:enabled).and_return(true)
|
592
596
|
expect(provider).to receive(:read_rc_conf).and_return([ "foo", "#{new_resource.service_name}_enable=\"YES\"", "bar" ])
|
593
597
|
expect(provider).to receive(:write_rc_conf).with(["foo", "bar", "#{new_resource.service_name}_enable=\"NO\""])
|
594
|
-
provider.disable_service
|
598
|
+
provider.disable_service
|
595
599
|
end
|
596
600
|
|
597
601
|
it "should not disable an enabled service that partially matches" do
|
598
602
|
allow(current_resource).to receive(:enabled).and_return(true)
|
599
603
|
expect(provider).to receive(:read_rc_conf).and_return([ "foo", "thing_#{new_resource.service_name}_enable=\"YES\"", "bar" ])
|
600
604
|
expect(provider).to receive(:write_rc_conf).with(["foo", "thing_#{new_resource.service_name}_enable=\"YES\"", "bar", "#{new_resource.service_name}_enable=\"NO\""])
|
601
|
-
provider.disable_service
|
605
|
+
provider.disable_service
|
602
606
|
end
|
603
607
|
|
604
608
|
it "should not disable the service if it is already disabled" do
|
605
609
|
allow(current_resource).to receive(:enabled).and_return(false)
|
606
610
|
expect(provider).not_to receive(:write_rc_conf)
|
607
|
-
provider.disable_service
|
611
|
+
provider.disable_service
|
608
612
|
end
|
609
613
|
|
610
614
|
it "should remove commented out versions of it being disabled or enabled" do
|
611
615
|
allow(current_resource).to receive(:enabled).and_return(true)
|
612
616
|
expect(provider).to receive(:read_rc_conf).and_return([ "foo", "bar", "\# #{new_resource.service_name}_enable=\"YES\"", "\# #{new_resource.service_name}_enable=\"NO\""])
|
613
617
|
expect(provider).to receive(:write_rc_conf).with(["foo", "bar", "#{new_resource.service_name}_enable=\"NO\""])
|
614
|
-
provider.disable_service
|
618
|
+
provider.disable_service
|
615
619
|
end
|
616
620
|
end
|
617
621
|
end
|