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
@@ -41,8 +41,7 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
41
41
|
tag_id: 0,
|
42
42
|
dependencies: ["Winmgmt"],
|
43
43
|
service_start_name: "LocalSystem",
|
44
|
-
display_name: "Chef Client Service"
|
45
|
-
)
|
44
|
+
display_name: "Chef Client Service")
|
46
45
|
end
|
47
46
|
|
48
47
|
# Actual response from Win32::Service.services
|
@@ -73,8 +72,7 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
73
72
|
command: nil,
|
74
73
|
num_actions: 0,
|
75
74
|
actions: nil,
|
76
|
-
delayed_start: 1
|
77
|
-
)
|
75
|
+
delayed_start: 1)
|
78
76
|
end
|
79
77
|
|
80
78
|
let(:provider) do
|
@@ -98,7 +96,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
98
96
|
|
99
97
|
allow(Win32::Service).to receive(:start).with(any_args).and_return(Win32::Service)
|
100
98
|
allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
|
101
|
-
double("StatusStruct", current_state: "running")
|
99
|
+
double("StatusStruct", current_state: "running")
|
100
|
+
)
|
102
101
|
allow(Win32::Service).to receive(:config_info).with(new_resource.service_name)
|
103
102
|
.and_return(chef_service_config_info)
|
104
103
|
|
@@ -176,8 +175,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
176
175
|
tag_id: 0,
|
177
176
|
dependencies: %w{NSI Tdx Afd},
|
178
177
|
service_start_name: 'NT Authority\\LocalService',
|
179
|
-
display_name: "DHCP Client"
|
180
|
-
|
178
|
+
display_name: "DHCP Client")
|
179
|
+
)
|
181
180
|
end
|
182
181
|
|
183
182
|
context "startup_type is neither :automatic or :disabled" do
|
@@ -192,8 +191,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
192
191
|
tag_id: 0,
|
193
192
|
dependencies: %w{NSI Tdx Afd},
|
194
193
|
service_start_name: 'NT Authority\\LocalService',
|
195
|
-
display_name: "DHCP Client"
|
196
|
-
|
194
|
+
display_name: "DHCP Client")
|
195
|
+
)
|
197
196
|
end
|
198
197
|
|
199
198
|
it "does not set the current resources enabled" do
|
@@ -385,14 +384,14 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
385
384
|
# properties that are Strings
|
386
385
|
%i{binary_path_name load_order_group dependencies run_as_user
|
387
386
|
display_name description}.each do |attr|
|
388
|
-
|
389
|
-
|
390
|
-
|
387
|
+
it "configures service if #{attr} has changed" do
|
388
|
+
provider.current_resource.send("#{attr}=", "old value")
|
389
|
+
provider.new_resource.send("#{attr}=", "new value")
|
391
390
|
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
391
|
+
expect(Win32::Service).to receive(:configure)
|
392
|
+
provider.action_configure
|
393
|
+
end
|
394
|
+
end
|
396
395
|
|
397
396
|
# properties that are Integers
|
398
397
|
%i{service_type error_control}.each do |attr|
|
@@ -503,7 +502,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
503
502
|
before(:each) do
|
504
503
|
allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
|
505
504
|
double("StatusStruct", current_state: "stopped"),
|
506
|
-
double("StatusStruct", current_state: "running")
|
505
|
+
double("StatusStruct", current_state: "running")
|
506
|
+
)
|
507
507
|
end
|
508
508
|
|
509
509
|
context "run_as_user user is specified" do
|
@@ -553,7 +553,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
553
553
|
|
554
554
|
it "does nothing if the service is running" do
|
555
555
|
allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
|
556
|
-
double("StatusStruct", current_state: "running")
|
556
|
+
double("StatusStruct", current_state: "running")
|
557
|
+
)
|
557
558
|
provider.load_current_resource
|
558
559
|
expect(Win32::Service).not_to receive(:start).with(new_resource.service_name)
|
559
560
|
provider.start_service
|
@@ -562,7 +563,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
562
563
|
|
563
564
|
it "raises an error if the service is paused" do
|
564
565
|
allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
|
565
|
-
double("StatusStruct", current_state: "paused")
|
566
|
+
double("StatusStruct", current_state: "paused")
|
567
|
+
)
|
566
568
|
provider.load_current_resource
|
567
569
|
expect(Win32::Service).not_to receive(:start).with(new_resource.service_name)
|
568
570
|
expect { provider.start_service }.to raise_error( Chef::Exceptions::Service )
|
@@ -573,7 +575,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
573
575
|
allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
|
574
576
|
double("StatusStruct", current_state: "start pending"),
|
575
577
|
double("StatusStruct", current_state: "start pending"),
|
576
|
-
double("StatusStruct", current_state: "running")
|
578
|
+
double("StatusStruct", current_state: "running")
|
579
|
+
)
|
577
580
|
provider.load_current_resource
|
578
581
|
expect(Win32::Service).not_to receive(:start).with(new_resource.service_name)
|
579
582
|
provider.start_service
|
@@ -582,7 +585,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
582
585
|
|
583
586
|
it "fails if the service is in stop_pending" do
|
584
587
|
allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
|
585
|
-
double("StatusStruct", current_state: "stop pending")
|
588
|
+
double("StatusStruct", current_state: "stop pending")
|
589
|
+
)
|
586
590
|
provider.load_current_resource
|
587
591
|
expect(Win32::Service).not_to receive(:start).with(new_resource.service_name)
|
588
592
|
expect { provider.start_service }.to raise_error( Chef::Exceptions::Service )
|
@@ -623,7 +627,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
623
627
|
before(:each) do
|
624
628
|
allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
|
625
629
|
double("StatusStruct", current_state: "running"),
|
626
|
-
double("StatusStruct", current_state: "stopped")
|
630
|
+
double("StatusStruct", current_state: "stopped")
|
631
|
+
)
|
627
632
|
end
|
628
633
|
|
629
634
|
it "calls the stop command if one is specified" do
|
@@ -648,7 +653,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
648
653
|
|
649
654
|
it "does nothing if the service is stopped" do
|
650
655
|
allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
|
651
|
-
double("StatusStruct", current_state: "stopped")
|
656
|
+
double("StatusStruct", current_state: "stopped")
|
657
|
+
)
|
652
658
|
provider.load_current_resource
|
653
659
|
expect(Win32::Service).not_to receive(:stop).with(new_resource.service_name)
|
654
660
|
provider.stop_service
|
@@ -657,7 +663,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
657
663
|
|
658
664
|
it "raises an error if the service is paused" do
|
659
665
|
allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
|
660
|
-
double("StatusStruct", current_state: "paused")
|
666
|
+
double("StatusStruct", current_state: "paused")
|
667
|
+
)
|
661
668
|
provider.load_current_resource
|
662
669
|
expect(Win32::Service).not_to receive(:start).with(new_resource.service_name)
|
663
670
|
expect { provider.stop_service }.to raise_error( Chef::Exceptions::Service )
|
@@ -668,7 +675,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
668
675
|
allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
|
669
676
|
double("StatusStruct", current_state: "stop pending"),
|
670
677
|
double("StatusStruct", current_state: "stop pending"),
|
671
|
-
double("StatusStruct", current_state: "stopped")
|
678
|
+
double("StatusStruct", current_state: "stopped")
|
679
|
+
)
|
672
680
|
provider.load_current_resource
|
673
681
|
expect(Win32::Service).not_to receive(:stop).with(new_resource.service_name)
|
674
682
|
provider.stop_service
|
@@ -677,7 +685,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
677
685
|
|
678
686
|
it "fails if the service is in start_pending" do
|
679
687
|
allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
|
680
|
-
double("StatusStruct", current_state: "start pending")
|
688
|
+
double("StatusStruct", current_state: "start pending")
|
689
|
+
)
|
681
690
|
provider.load_current_resource
|
682
691
|
expect(Win32::Service).not_to receive(:stop).with(new_resource.service_name)
|
683
692
|
expect { provider.stop_service }.to raise_error( Chef::Exceptions::Service )
|
@@ -686,7 +695,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
686
695
|
|
687
696
|
it "passes custom timeout to the stop command if provided" do
|
688
697
|
allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
|
689
|
-
double("StatusStruct", current_state: "running")
|
698
|
+
double("StatusStruct", current_state: "running")
|
699
|
+
)
|
690
700
|
new_resource.timeout 1
|
691
701
|
expect(Win32::Service).to receive(:stop).with(new_resource.service_name)
|
692
702
|
Timeout.timeout(2) do
|
@@ -711,7 +721,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
711
721
|
double("StatusStruct", current_state: "running"),
|
712
722
|
double("StatusStruct", current_state: "stopped"),
|
713
723
|
double("StatusStruct", current_state: "stopped"),
|
714
|
-
double("StatusStruct", current_state: "running")
|
724
|
+
double("StatusStruct", current_state: "running")
|
725
|
+
)
|
715
726
|
expect(Win32::Service).to receive(:stop).with(new_resource.service_name)
|
716
727
|
expect(Win32::Service).to receive(:start).with(new_resource.service_name)
|
717
728
|
provider.restart_service
|
@@ -722,7 +733,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
722
733
|
allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
|
723
734
|
double("StatusStruct", current_state: "stopped"),
|
724
735
|
double("StatusStruct", current_state: "stopped"),
|
725
|
-
double("StatusStruct", current_state: "running")
|
736
|
+
double("StatusStruct", current_state: "running")
|
737
|
+
)
|
726
738
|
expect(Win32::Service).to receive(:start).with(new_resource.service_name)
|
727
739
|
provider.restart_service
|
728
740
|
expect(new_resource.updated_by_last_action?).to be_truthy
|
@@ -741,7 +753,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
741
753
|
describe Chef::Provider::Service::Windows, "enable_service" do
|
742
754
|
before(:each) do
|
743
755
|
allow(Win32::Service).to receive(:config_info).with(new_resource.service_name).and_return(
|
744
|
-
double("ConfigStruct", start_type: "disabled")
|
756
|
+
double("ConfigStruct", start_type: "disabled")
|
757
|
+
)
|
745
758
|
end
|
746
759
|
|
747
760
|
it "enables service" do
|
@@ -761,14 +774,16 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
761
774
|
describe Chef::Provider::Service::Windows, "action_enable" do
|
762
775
|
it "does nothing if the service is enabled" do
|
763
776
|
allow(Win32::Service).to receive(:config_info).with(new_resource.service_name).and_return(
|
764
|
-
double("ConfigStruct", start_type: "auto start")
|
777
|
+
double("ConfigStruct", start_type: "auto start")
|
778
|
+
)
|
765
779
|
expect(provider).not_to receive(:enable_service)
|
766
780
|
provider.action_enable
|
767
781
|
end
|
768
782
|
|
769
783
|
it "enables the service if it is not set to automatic start" do
|
770
784
|
allow(Win32::Service).to receive(:config_info).with(new_resource.service_name).and_return(
|
771
|
-
double("ConfigStruct", start_type: "disabled")
|
785
|
+
double("ConfigStruct", start_type: "disabled")
|
786
|
+
)
|
772
787
|
expect(provider).to receive(:enable_service)
|
773
788
|
provider.action_enable
|
774
789
|
end
|
@@ -777,14 +792,16 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
777
792
|
describe Chef::Provider::Service::Windows, "action_disable" do
|
778
793
|
it "does nothing if the service is disabled" do
|
779
794
|
allow(Win32::Service).to receive(:config_info).with(new_resource.service_name).and_return(
|
780
|
-
double("ConfigStruct", start_type: "disabled")
|
795
|
+
double("ConfigStruct", start_type: "disabled")
|
796
|
+
)
|
781
797
|
expect(provider).not_to receive(:disable_service)
|
782
798
|
provider.action_disable
|
783
799
|
end
|
784
800
|
|
785
801
|
it "disables the service if it is not set to disabled" do
|
786
802
|
allow(Win32::Service).to receive(:config_info).with(new_resource.service_name).and_return(
|
787
|
-
double("ConfigStruct", start_type: "auto start")
|
803
|
+
double("ConfigStruct", start_type: "auto start")
|
804
|
+
)
|
788
805
|
expect(provider).to receive(:disable_service)
|
789
806
|
provider.action_disable
|
790
807
|
end
|
@@ -793,7 +810,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
|
|
793
810
|
describe Chef::Provider::Service::Windows, "disable_service" do
|
794
811
|
before(:each) do
|
795
812
|
allow(Win32::Service).to receive(:config_info).with(new_resource.service_name).and_return(
|
796
|
-
double("ConfigStruct", start_type: "auto start")
|
813
|
+
double("ConfigStruct", start_type: "auto start")
|
814
|
+
)
|
797
815
|
end
|
798
816
|
|
799
817
|
it "disables service" do
|
@@ -277,7 +277,8 @@ describe Chef::Provider::Subversion do
|
|
277
277
|
allow(ChefConfig).to receive(:windows?) { false }
|
278
278
|
expect(@provider).to receive(:svn_binary).and_return("svn")
|
279
279
|
expect(@provider.export_command).to eql(
|
280
|
-
"svn export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
|
280
|
+
"svn export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
|
281
|
+
)
|
281
282
|
end
|
282
283
|
|
283
284
|
it "selects an svn binary with an exe extension on windows" do
|
@@ -285,21 +286,24 @@ describe Chef::Provider::Subversion do
|
|
285
286
|
allow(ChefConfig).to receive(:windows?) { true }
|
286
287
|
expect(@provider).to receive(:svn_binary).and_return("svn.exe")
|
287
288
|
expect(@provider.export_command).to eql(
|
288
|
-
"svn.exe export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
|
289
|
+
"svn.exe export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
|
290
|
+
)
|
289
291
|
end
|
290
292
|
|
291
293
|
it "uses a custom svn binary as part of the svn command" do
|
292
294
|
@resource.svn_binary "teapot"
|
293
295
|
expect(@provider).to receive(:svn_binary).and_return("teapot")
|
294
296
|
expect(@provider.export_command).to eql(
|
295
|
-
"teapot export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
|
297
|
+
"teapot export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
|
298
|
+
)
|
296
299
|
end
|
297
300
|
|
298
301
|
it "wraps custom svn binary with quotes if it contains whitespace" do
|
299
302
|
@resource.svn_binary "c:/program files (x86)/subversion/svn.exe"
|
300
303
|
expect(@provider).to receive(:svn_binary).and_return("c:/program files (x86)/subversion/svn.exe")
|
301
304
|
expect(@provider.export_command).to eql(
|
302
|
-
'"c:/program files (x86)/subversion/svn.exe" export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir'
|
305
|
+
'"c:/program files (x86)/subversion/svn.exe" export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir'
|
306
|
+
)
|
303
307
|
end
|
304
308
|
|
305
309
|
end
|
@@ -83,8 +83,8 @@ describe Chef::Provider::SystemdUnit do
|
|
83
83
|
before(:each) do
|
84
84
|
allow(Etc).to receive(:getpwnam).and_return(OpenStruct.new(uid: 1000))
|
85
85
|
allow(Chef::Resource::SystemdUnit).to receive(:new)
|
86
|
-
|
87
|
-
|
86
|
+
.with(unit_name)
|
87
|
+
.and_return(current_resource)
|
88
88
|
end
|
89
89
|
|
90
90
|
describe "define_resource_requirements" do
|
@@ -121,8 +121,8 @@ describe Chef::Provider::SystemdUnit do
|
|
121
121
|
|
122
122
|
it "should create a current resource with the name of the new resource" do
|
123
123
|
expect(Chef::Resource::SystemdUnit).to receive(:new)
|
124
|
-
|
125
|
-
|
124
|
+
.with(unit_name)
|
125
|
+
.and_return(current_resource)
|
126
126
|
provider.load_current_resource
|
127
127
|
end
|
128
128
|
|
@@ -196,26 +196,26 @@ describe Chef::Provider::SystemdUnit do
|
|
196
196
|
|
197
197
|
it "loads the system unit content if the file exists and user is not set" do
|
198
198
|
allow(File).to receive(:exist?)
|
199
|
-
|
200
|
-
|
199
|
+
.with(unit_path_system)
|
200
|
+
.and_return(true)
|
201
201
|
allow(File).to receive(:read)
|
202
|
-
|
203
|
-
|
202
|
+
.with(unit_path_system)
|
203
|
+
.and_return(unit_content_string)
|
204
204
|
|
205
205
|
expect(File).to receive(:exist?)
|
206
|
-
|
206
|
+
.with(unit_path_system)
|
207
207
|
expect(File).to receive(:read)
|
208
|
-
|
208
|
+
.with(unit_path_system)
|
209
209
|
provider.load_current_resource
|
210
210
|
expect(current_resource.content).to eq(unit_content_string)
|
211
211
|
end
|
212
212
|
|
213
213
|
it "does not load the system unit content if the unit file is not present and the user is not set" do
|
214
214
|
allow(File).to receive(:exist?)
|
215
|
-
|
216
|
-
|
215
|
+
.with(unit_path_system)
|
216
|
+
.and_return(false)
|
217
217
|
expect(File).to_not receive(:read)
|
218
|
-
|
218
|
+
.with(unit_path_system)
|
219
219
|
provider.load_current_resource
|
220
220
|
expect(current_resource.content).to eq(nil)
|
221
221
|
end
|
@@ -223,15 +223,15 @@ describe Chef::Provider::SystemdUnit do
|
|
223
223
|
it "loads the user unit content if the file exists and user is set" do
|
224
224
|
new_resource.user("joe")
|
225
225
|
allow(File).to receive(:exist?)
|
226
|
-
|
227
|
-
|
226
|
+
.with(unit_path_user)
|
227
|
+
.and_return(true)
|
228
228
|
allow(File).to receive(:read)
|
229
|
-
|
230
|
-
|
229
|
+
.with(unit_path_user)
|
230
|
+
.and_return(unit_content_string)
|
231
231
|
expect(File).to receive(:exist?)
|
232
|
-
|
232
|
+
.with(unit_path_user)
|
233
233
|
expect(File).to receive(:read)
|
234
|
-
|
234
|
+
.with(unit_path_user)
|
235
235
|
provider.load_current_resource
|
236
236
|
expect(current_resource.content).to eq(unit_content_string)
|
237
237
|
end
|
@@ -239,10 +239,10 @@ describe Chef::Provider::SystemdUnit do
|
|
239
239
|
it "does not load the user unit if the file does not exist and user is set" do
|
240
240
|
new_resource.user("joe")
|
241
241
|
allow(File).to receive(:exist?)
|
242
|
-
|
243
|
-
|
242
|
+
.with(unit_path_user)
|
243
|
+
.and_return(false)
|
244
244
|
expect(File).to_not receive(:read)
|
245
|
-
|
245
|
+
.with(unit_path_user)
|
246
246
|
provider.load_current_resource
|
247
247
|
expect(current_resource.content).to eq(nil)
|
248
248
|
end
|
@@ -253,27 +253,27 @@ describe Chef::Provider::SystemdUnit do
|
|
253
253
|
before(:each) do
|
254
254
|
provider.current_resource = current_resource
|
255
255
|
allow(provider).to receive(:which)
|
256
|
-
|
257
|
-
|
256
|
+
.with("systemctl")
|
257
|
+
.and_return(systemctl_path)
|
258
258
|
end
|
259
259
|
|
260
260
|
describe "creates/deletes/presets/reverts the unit" do
|
261
261
|
it "creates the unit file when it does not exist" do
|
262
262
|
allow(provider).to receive(:manage_unit_file)
|
263
|
-
|
264
|
-
|
263
|
+
.with(:create)
|
264
|
+
.and_return(true)
|
265
265
|
allow(provider).to receive(:daemon_reload)
|
266
|
-
|
266
|
+
.and_return(true)
|
267
267
|
expect(provider).to receive(:manage_unit_file).with(:create)
|
268
268
|
provider.action_create
|
269
269
|
end
|
270
270
|
|
271
271
|
it "creates the file when the unit content is different" do
|
272
272
|
allow(provider).to receive(:manage_unit_file)
|
273
|
-
|
274
|
-
|
273
|
+
.with(:create)
|
274
|
+
.and_return(true)
|
275
275
|
allow(provider).to receive(:daemon_reload)
|
276
|
-
|
276
|
+
.and_return(true)
|
277
277
|
expect(provider).to receive(:manage_unit_file).with(:create)
|
278
278
|
provider.action_create
|
279
279
|
end
|
@@ -282,7 +282,7 @@ describe Chef::Provider::SystemdUnit do
|
|
282
282
|
current_resource.content(unit_content_string)
|
283
283
|
allow(provider).to receive(:manage_unit_file).with(:create)
|
284
284
|
allow(provider).to receive(:daemon_reload)
|
285
|
-
|
285
|
+
.and_return(true)
|
286
286
|
expect(provider).to_not receive(:manage_unit_file)
|
287
287
|
provider.action_create
|
288
288
|
end
|
@@ -294,20 +294,20 @@ describe Chef::Provider::SystemdUnit do
|
|
294
294
|
expect(new_resource.triggers_reload).to eq true
|
295
295
|
allow(provider).to receive(:shell_out_compacted!)
|
296
296
|
expect(provider).to receive(:shell_out_compacted!)
|
297
|
-
|
297
|
+
.with(systemctl_path, "--user", "daemon-reload", **user_cmd_opts, default_env: false)
|
298
298
|
provider.action_create
|
299
299
|
end
|
300
300
|
|
301
301
|
it "triggers a daemon-reload when deleting a unit with triggers_reload" do
|
302
302
|
new_resource.user("joe")
|
303
303
|
allow(File).to receive(:exist?)
|
304
|
-
|
305
|
-
|
304
|
+
.with(unit_path_user)
|
305
|
+
.and_return(true)
|
306
306
|
allow(provider).to receive(:manage_unit_file).with(:delete)
|
307
307
|
expect(new_resource.triggers_reload).to eq true
|
308
308
|
allow(provider).to receive(:shell_out_compacted!)
|
309
309
|
expect(provider).to receive(:shell_out_compacted!)
|
310
|
-
|
310
|
+
.with(systemctl_path, "--user", "daemon-reload", **user_cmd_opts, default_env: false)
|
311
311
|
provider.action_delete
|
312
312
|
end
|
313
313
|
|
@@ -317,7 +317,7 @@ describe Chef::Provider::SystemdUnit do
|
|
317
317
|
allow(provider).to receive(:manage_unit_file).with(:create)
|
318
318
|
allow(provider).to receive(:shell_out_compacted!)
|
319
319
|
expect(provider).to_not receive(:shell_out_compacted!)
|
320
|
-
|
320
|
+
.with(systemctl_path, "--user", "daemon-reload", **user_cmd_opts, default_env: false)
|
321
321
|
provider.action_create
|
322
322
|
end
|
323
323
|
|
@@ -325,23 +325,23 @@ describe Chef::Provider::SystemdUnit do
|
|
325
325
|
new_resource.user("joe")
|
326
326
|
new_resource.triggers_reload(false)
|
327
327
|
allow(File).to receive(:exist?)
|
328
|
-
|
329
|
-
|
328
|
+
.with(unit_path_user)
|
329
|
+
.and_return(true)
|
330
330
|
allow(provider).to receive(:manage_unit_file).with(:delete)
|
331
331
|
allow(provider).to receive(:shell_out_compacted!)
|
332
332
|
expect(provider).to_not receive(:shell_out_compacted!)
|
333
|
-
|
333
|
+
.with(systemctl_path, "--user", "daemon-reload", **user_cmd_opts, default_env: false)
|
334
334
|
provider.action_delete
|
335
335
|
end
|
336
336
|
|
337
337
|
it "deletes the file when it exists" do
|
338
338
|
new_resource.user("joe")
|
339
339
|
allow(File).to receive(:exist?)
|
340
|
-
|
341
|
-
|
340
|
+
.with(unit_path_user)
|
341
|
+
.and_return(true)
|
342
342
|
allow(provider).to receive(:manage_unit_file)
|
343
|
-
|
344
|
-
|
343
|
+
.with(:delete)
|
344
|
+
.and_return(true)
|
345
345
|
allow(provider).to receive(:daemon_reload)
|
346
346
|
expect(provider).to receive(:manage_unit_file).with(:delete)
|
347
347
|
provider.action_delete
|
@@ -350,8 +350,8 @@ describe Chef::Provider::SystemdUnit do
|
|
350
350
|
it "does not delete the file when it is absent" do
|
351
351
|
new_resource.user("joe")
|
352
352
|
allow(File).to receive(:exist?)
|
353
|
-
|
354
|
-
|
353
|
+
.with(unit_path_user)
|
354
|
+
.and_return(false)
|
355
355
|
allow(provider).to receive(:manage_unit_file).with(:delete)
|
356
356
|
expect(provider).to_not receive(:manage_unit_file)
|
357
357
|
provider.action_delete
|
@@ -360,16 +360,16 @@ describe Chef::Provider::SystemdUnit do
|
|
360
360
|
it "presets the unit" do
|
361
361
|
new_resource.user("joe")
|
362
362
|
expect(provider).to receive(:shell_out_compacted!)
|
363
|
-
|
364
|
-
|
363
|
+
.with(systemctl_path, "--user", "preset", unit_name, **user_cmd_opts)
|
364
|
+
.and_return(shell_out_success)
|
365
365
|
provider.action_preset
|
366
366
|
end
|
367
367
|
|
368
368
|
it "reverts the unit" do
|
369
369
|
new_resource.user("joe")
|
370
370
|
expect(provider).to receive(:shell_out_compacted!)
|
371
|
-
|
372
|
-
|
371
|
+
.with(systemctl_path, "--user", "revert", unit_name, **user_cmd_opts)
|
372
|
+
.and_return(shell_out_success)
|
373
373
|
provider.action_revert
|
374
374
|
end
|
375
375
|
end
|
@@ -380,19 +380,19 @@ describe Chef::Provider::SystemdUnit do
|
|
380
380
|
expect(new_resource.triggers_reload).to eq true
|
381
381
|
allow(provider).to receive(:shell_out_compacted!)
|
382
382
|
expect(provider).to receive(:shell_out_compacted!)
|
383
|
-
|
383
|
+
.with(systemctl_path, "--system", "daemon-reload", default_env: false)
|
384
384
|
provider.action_create
|
385
385
|
end
|
386
386
|
|
387
387
|
it "triggers a daemon-reload when deleting a unit with triggers_reload" do
|
388
388
|
allow(File).to receive(:exist?)
|
389
|
-
|
390
|
-
|
389
|
+
.with(unit_path_system)
|
390
|
+
.and_return(true)
|
391
391
|
allow(provider).to receive(:manage_unit_file).with(:delete)
|
392
392
|
expect(new_resource.triggers_reload).to eq true
|
393
393
|
allow(provider).to receive(:shell_out_compacted!)
|
394
394
|
expect(provider).to receive(:shell_out_compacted!)
|
395
|
-
|
395
|
+
.with(systemctl_path, "--system", "daemon-reload", default_env: false)
|
396
396
|
provider.action_delete
|
397
397
|
end
|
398
398
|
|
@@ -401,27 +401,27 @@ describe Chef::Provider::SystemdUnit do
|
|
401
401
|
allow(provider).to receive(:manage_unit_file).with(:create)
|
402
402
|
allow(provider).to receive(:shell_out_compacted!)
|
403
403
|
expect(provider).to_not receive(:shell_out_compacted!)
|
404
|
-
|
404
|
+
.with(systemctl_path, "--system", "daemon-reload", default_env: false)
|
405
405
|
provider.action_create
|
406
406
|
end
|
407
407
|
|
408
408
|
it "does not trigger a daemon-reload when deleting a unit without triggers_reload" do
|
409
409
|
new_resource.triggers_reload(false)
|
410
410
|
allow(File).to receive(:exist?)
|
411
|
-
|
412
|
-
|
411
|
+
.with(unit_path_system)
|
412
|
+
.and_return(true)
|
413
413
|
allow(provider).to receive(:manage_unit_file).with(:delete)
|
414
414
|
allow(provider).to receive(:shell_out_compacted!)
|
415
415
|
expect(provider).to_not receive(:shell_out_compacted!)
|
416
|
-
|
416
|
+
.with(systemctl_path, "--system", "daemon-reload", default_env: false)
|
417
417
|
provider.action_delete
|
418
418
|
end
|
419
419
|
it "deletes the file when it exists" do
|
420
420
|
allow(File).to receive(:exist?)
|
421
|
-
|
422
|
-
|
421
|
+
.with(unit_path_system)
|
422
|
+
.and_return(true)
|
423
423
|
allow(provider).to receive(:manage_unit_file)
|
424
|
-
|
424
|
+
.with(:delete)
|
425
425
|
allow(provider).to receive(:daemon_reload)
|
426
426
|
expect(provider).to receive(:manage_unit_file).with(:delete)
|
427
427
|
provider.action_delete
|
@@ -429,8 +429,8 @@ describe Chef::Provider::SystemdUnit do
|
|
429
429
|
|
430
430
|
it "does not delete the file when it is absent" do
|
431
431
|
allow(File).to receive(:exist?)
|
432
|
-
|
433
|
-
|
432
|
+
.with(unit_path_system)
|
433
|
+
.and_return(false)
|
434
434
|
allow(provider).to receive(:manage_unit_file).with(:delete)
|
435
435
|
allow(provider).to receive(:daemon_reload)
|
436
436
|
expect(provider).to_not receive(:manage_unit_file)
|
@@ -439,15 +439,15 @@ describe Chef::Provider::SystemdUnit do
|
|
439
439
|
|
440
440
|
it "presets the unit" do
|
441
441
|
expect(provider).to receive(:shell_out_compacted!)
|
442
|
-
|
443
|
-
|
442
|
+
.with(systemctl_path, "--system", "preset", unit_name)
|
443
|
+
.and_return(shell_out_success)
|
444
444
|
provider.action_preset
|
445
445
|
end
|
446
446
|
|
447
447
|
it "reverts the unit" do
|
448
448
|
expect(provider).to receive(:shell_out_compacted!)
|
449
|
-
|
450
|
-
|
449
|
+
.with(systemctl_path, "--system", "revert", unit_name)
|
450
|
+
.and_return(shell_out_success)
|
451
451
|
provider.action_revert
|
452
452
|
end
|
453
453
|
end
|
@@ -458,8 +458,8 @@ describe Chef::Provider::SystemdUnit do
|
|
458
458
|
it "reenables the unit" do
|
459
459
|
current_resource.user(user_name)
|
460
460
|
expect(provider).to receive(:shell_out_compacted!)
|
461
|
-
|
462
|
-
|
461
|
+
.with(systemctl_path, "--user", "reenable", unit_name, **user_cmd_opts)
|
462
|
+
.and_return(shell_out_success)
|
463
463
|
provider.action_reenable
|
464
464
|
end
|
465
465
|
|
@@ -467,8 +467,8 @@ describe Chef::Provider::SystemdUnit do
|
|
467
467
|
current_resource.user(user_name)
|
468
468
|
current_resource.enabled(false)
|
469
469
|
expect(provider).to receive(:shell_out_compacted!)
|
470
|
-
|
471
|
-
|
470
|
+
.with(systemctl_path, "--user", "enable", unit_name, **user_cmd_opts)
|
471
|
+
.and_return(shell_out_success)
|
472
472
|
provider.action_enable
|
473
473
|
end
|
474
474
|
|
@@ -490,8 +490,8 @@ describe Chef::Provider::SystemdUnit do
|
|
490
490
|
current_resource.user(user_name)
|
491
491
|
current_resource.enabled(true)
|
492
492
|
expect(provider).to receive(:shell_out_compacted!)
|
493
|
-
|
494
|
-
|
493
|
+
.with(systemctl_path, "--user", "disable", unit_name, **user_cmd_opts)
|
494
|
+
.and_return(shell_out_success)
|
495
495
|
provider.action_disable
|
496
496
|
end
|
497
497
|
|
@@ -513,16 +513,16 @@ describe Chef::Provider::SystemdUnit do
|
|
513
513
|
context "when no user is specified" do
|
514
514
|
it "reenables the unit" do
|
515
515
|
expect(provider).to receive(:shell_out_compacted!)
|
516
|
-
|
517
|
-
|
516
|
+
.with(systemctl_path, "--system", "reenable", unit_name)
|
517
|
+
.and_return(shell_out_success)
|
518
518
|
provider.action_reenable
|
519
519
|
end
|
520
520
|
|
521
521
|
it "enables the unit when it is disabled" do
|
522
522
|
current_resource.enabled(false)
|
523
523
|
expect(provider).to receive(:shell_out_compacted!)
|
524
|
-
|
525
|
-
|
524
|
+
.with(systemctl_path, "--system", "enable", unit_name)
|
525
|
+
.and_return(shell_out_success)
|
526
526
|
provider.action_enable
|
527
527
|
end
|
528
528
|
|
@@ -541,8 +541,8 @@ describe Chef::Provider::SystemdUnit do
|
|
541
541
|
it "disables the unit when it is enabled" do
|
542
542
|
current_resource.enabled(true)
|
543
543
|
expect(provider).to receive(:shell_out_compacted!)
|
544
|
-
|
545
|
-
|
544
|
+
.with(systemctl_path, "--system", "disable", unit_name)
|
545
|
+
.and_return(shell_out_success)
|
546
546
|
provider.action_disable
|
547
547
|
end
|
548
548
|
|
@@ -567,8 +567,8 @@ describe Chef::Provider::SystemdUnit do
|
|
567
567
|
current_resource.user(user_name)
|
568
568
|
current_resource.masked(false)
|
569
569
|
expect(provider).to receive(:shell_out_compacted!)
|
570
|
-
|
571
|
-
|
570
|
+
.with(systemctl_path, "--user", "mask", unit_name, **user_cmd_opts)
|
571
|
+
.and_return(shell_out_success)
|
572
572
|
provider.action_mask
|
573
573
|
end
|
574
574
|
|
@@ -583,8 +583,8 @@ describe Chef::Provider::SystemdUnit do
|
|
583
583
|
current_resource.user(user_name)
|
584
584
|
current_resource.masked(true)
|
585
585
|
expect(provider).to receive(:shell_out_compacted!)
|
586
|
-
|
587
|
-
|
586
|
+
.with(systemctl_path, "--user", "unmask", unit_name, **user_cmd_opts)
|
587
|
+
.and_return(shell_out_success)
|
588
588
|
provider.action_unmask
|
589
589
|
end
|
590
590
|
|
@@ -600,8 +600,8 @@ describe Chef::Provider::SystemdUnit do
|
|
600
600
|
it "masks the unit when it is unmasked" do
|
601
601
|
current_resource.masked(false)
|
602
602
|
expect(provider).to receive(:shell_out_compacted!)
|
603
|
-
|
604
|
-
|
603
|
+
.with(systemctl_path, "--system", "mask", unit_name)
|
604
|
+
.and_return(shell_out_success)
|
605
605
|
provider.action_mask
|
606
606
|
end
|
607
607
|
|
@@ -614,8 +614,8 @@ describe Chef::Provider::SystemdUnit do
|
|
614
614
|
it "unmasks the unit when it is masked" do
|
615
615
|
current_resource.masked(true)
|
616
616
|
expect(provider).to receive(:shell_out_compacted!)
|
617
|
-
|
618
|
-
|
617
|
+
.with(systemctl_path, "--system", "unmask", unit_name)
|
618
|
+
.and_return(shell_out_success)
|
619
619
|
provider.action_unmask
|
620
620
|
end
|
621
621
|
|
@@ -633,8 +633,8 @@ describe Chef::Provider::SystemdUnit do
|
|
633
633
|
current_resource.user(user_name)
|
634
634
|
current_resource.active(false)
|
635
635
|
expect(provider).to receive(:shell_out_compacted!)
|
636
|
-
|
637
|
-
|
636
|
+
.with(systemctl_path, "--user", "start", unit_name, **user_cmd_opts, default_env: false)
|
637
|
+
.and_return(shell_out_success)
|
638
638
|
provider.action_start
|
639
639
|
end
|
640
640
|
|
@@ -649,8 +649,8 @@ describe Chef::Provider::SystemdUnit do
|
|
649
649
|
current_resource.user(user_name)
|
650
650
|
current_resource.active(true)
|
651
651
|
expect(provider).to receive(:shell_out_compacted!)
|
652
|
-
|
653
|
-
|
652
|
+
.with(systemctl_path, "--user", "stop", unit_name, **user_cmd_opts, default_env: false)
|
653
|
+
.and_return(shell_out_success)
|
654
654
|
provider.action_stop
|
655
655
|
end
|
656
656
|
|
@@ -666,8 +666,8 @@ describe Chef::Provider::SystemdUnit do
|
|
666
666
|
it "starts the unit when it is inactive" do
|
667
667
|
current_resource.active(false)
|
668
668
|
expect(provider).to receive(:shell_out_compacted!)
|
669
|
-
|
670
|
-
|
669
|
+
.with(systemctl_path, "--system", "start", unit_name, default_env: false)
|
670
|
+
.and_return(shell_out_success)
|
671
671
|
provider.action_start
|
672
672
|
end
|
673
673
|
|
@@ -680,8 +680,8 @@ describe Chef::Provider::SystemdUnit do
|
|
680
680
|
it "stops the unit when it is active" do
|
681
681
|
current_resource.active(true)
|
682
682
|
expect(provider).to receive(:shell_out_compacted!)
|
683
|
-
|
684
|
-
|
683
|
+
.with(systemctl_path, "--system", "stop", unit_name, default_env: false)
|
684
|
+
.and_return(shell_out_success)
|
685
685
|
provider.action_stop
|
686
686
|
end
|
687
687
|
|
@@ -698,8 +698,8 @@ describe Chef::Provider::SystemdUnit do
|
|
698
698
|
it "restarts the unit" do
|
699
699
|
current_resource.user(user_name)
|
700
700
|
expect(provider).to receive(:shell_out_compacted!)
|
701
|
-
|
702
|
-
|
701
|
+
.with(systemctl_path, "--user", "restart", unit_name, **user_cmd_opts, default_env: false)
|
702
|
+
.and_return(shell_out_success)
|
703
703
|
provider.action_restart
|
704
704
|
end
|
705
705
|
|
@@ -707,8 +707,8 @@ describe Chef::Provider::SystemdUnit do
|
|
707
707
|
current_resource.user(user_name)
|
708
708
|
current_resource.active(true)
|
709
709
|
expect(provider).to receive(:shell_out_compacted!)
|
710
|
-
|
711
|
-
|
710
|
+
.with(systemctl_path, "--user", "reload", unit_name, **user_cmd_opts, default_env: false)
|
711
|
+
.and_return(shell_out_success)
|
712
712
|
provider.action_reload
|
713
713
|
end
|
714
714
|
|
@@ -723,16 +723,16 @@ describe Chef::Provider::SystemdUnit do
|
|
723
723
|
context "when no user is specified" do
|
724
724
|
it "restarts the unit" do
|
725
725
|
expect(provider).to receive(:shell_out_compacted!)
|
726
|
-
|
727
|
-
|
726
|
+
.with(systemctl_path, "--system", "restart", unit_name, default_env: false)
|
727
|
+
.and_return(shell_out_success)
|
728
728
|
provider.action_restart
|
729
729
|
end
|
730
730
|
|
731
731
|
it "reloads the unit if active" do
|
732
732
|
current_resource.active(true)
|
733
733
|
expect(provider).to receive(:shell_out_compacted!)
|
734
|
-
|
735
|
-
|
734
|
+
.with(systemctl_path, "--system", "reload", unit_name, default_env: false)
|
735
|
+
.and_return(shell_out_success)
|
736
736
|
provider.action_reload
|
737
737
|
end
|
738
738
|
|
@@ -749,8 +749,8 @@ describe Chef::Provider::SystemdUnit do
|
|
749
749
|
it "try-restarts the unit" do
|
750
750
|
current_resource.user(user_name)
|
751
751
|
expect(provider).to receive(:shell_out_compacted!)
|
752
|
-
|
753
|
-
|
752
|
+
.with(systemctl_path, "--user", "try-restart", unit_name, **user_cmd_opts, default_env: false)
|
753
|
+
.and_return(shell_out_success)
|
754
754
|
provider.action_try_restart
|
755
755
|
end
|
756
756
|
end
|
@@ -758,8 +758,8 @@ describe Chef::Provider::SystemdUnit do
|
|
758
758
|
context "when no user is specified" do
|
759
759
|
it "try-restarts the unit" do
|
760
760
|
expect(provider).to receive(:shell_out_compacted!)
|
761
|
-
|
762
|
-
|
761
|
+
.with(systemctl_path, "--system", "try-restart", unit_name, default_env: false)
|
762
|
+
.and_return(shell_out_success)
|
763
763
|
provider.action_try_restart
|
764
764
|
end
|
765
765
|
end
|
@@ -770,8 +770,8 @@ describe Chef::Provider::SystemdUnit do
|
|
770
770
|
it "reload-or-restarts the unit" do
|
771
771
|
current_resource.user(user_name)
|
772
772
|
expect(provider).to receive(:shell_out_compacted!)
|
773
|
-
|
774
|
-
|
773
|
+
.with(systemctl_path, "--user", "reload-or-restart", unit_name, **user_cmd_opts, default_env: false)
|
774
|
+
.and_return(shell_out_success)
|
775
775
|
provider.action_reload_or_restart
|
776
776
|
end
|
777
777
|
end
|
@@ -779,8 +779,8 @@ describe Chef::Provider::SystemdUnit do
|
|
779
779
|
context "when no user is specified" do
|
780
780
|
it "reload-or-restarts the unit" do
|
781
781
|
expect(provider).to receive(:shell_out_compacted!)
|
782
|
-
|
783
|
-
|
782
|
+
.with(systemctl_path, "--system", "reload-or-restart", unit_name, default_env: false)
|
783
|
+
.and_return(shell_out_success)
|
784
784
|
provider.action_reload_or_restart
|
785
785
|
end
|
786
786
|
end
|
@@ -791,8 +791,8 @@ describe Chef::Provider::SystemdUnit do
|
|
791
791
|
it "reload-or-try-restarts the unit" do
|
792
792
|
current_resource.user(user_name)
|
793
793
|
expect(provider).to receive(:shell_out_compacted!)
|
794
|
-
|
795
|
-
|
794
|
+
.with(systemctl_path, "--user", "reload-or-try-restart", unit_name, **user_cmd_opts, default_env: false)
|
795
|
+
.and_return(shell_out_success)
|
796
796
|
provider.action_reload_or_try_restart
|
797
797
|
end
|
798
798
|
end
|
@@ -800,8 +800,8 @@ describe Chef::Provider::SystemdUnit do
|
|
800
800
|
context "when no user is specified" do
|
801
801
|
it "reload-or-try-restarts the unit" do
|
802
802
|
expect(provider).to receive(:shell_out_compacted!)
|
803
|
-
|
804
|
-
|
803
|
+
.with(systemctl_path, "--system", "reload-or-try-restart", unit_name, default_env: false)
|
804
|
+
.and_return(shell_out_success)
|
805
805
|
provider.action_reload_or_try_restart
|
806
806
|
end
|
807
807
|
end
|
@@ -817,16 +817,16 @@ describe Chef::Provider::SystemdUnit do
|
|
817
817
|
it "returns true when unit is active" do
|
818
818
|
current_resource.user(user_name)
|
819
819
|
expect(provider).to receive(:shell_out_compacted)
|
820
|
-
|
821
|
-
|
820
|
+
.with(systemctl_path, "--user", "is-active", unit_name, user_cmd_opts)
|
821
|
+
.and_return(shell_out_success)
|
822
822
|
expect(provider.active?).to be true
|
823
823
|
end
|
824
824
|
|
825
825
|
it "returns false when unit is inactive" do
|
826
826
|
current_resource.user(user_name)
|
827
827
|
expect(provider).to receive(:shell_out_compacted)
|
828
|
-
|
829
|
-
|
828
|
+
.with(systemctl_path, "--user", "is-active", unit_name, user_cmd_opts)
|
829
|
+
.and_return(shell_out_failure)
|
830
830
|
expect(provider.active?).to be false
|
831
831
|
end
|
832
832
|
end
|
@@ -834,15 +834,15 @@ describe Chef::Provider::SystemdUnit do
|
|
834
834
|
context "when no user is specified" do
|
835
835
|
it "returns true when unit is active" do
|
836
836
|
expect(provider).to receive(:shell_out_compacted)
|
837
|
-
|
838
|
-
|
837
|
+
.with(systemctl_path, "--system", "is-active", unit_name)
|
838
|
+
.and_return(shell_out_success)
|
839
839
|
expect(provider.active?).to be true
|
840
840
|
end
|
841
841
|
|
842
842
|
it "returns false when unit is not active" do
|
843
843
|
expect(provider).to receive(:shell_out_compacted)
|
844
|
-
|
845
|
-
|
844
|
+
.with(systemctl_path, "--system", "is-active", unit_name)
|
845
|
+
.and_return(shell_out_failure)
|
846
846
|
expect(provider.active?).to be false
|
847
847
|
end
|
848
848
|
end
|
@@ -858,8 +858,8 @@ describe Chef::Provider::SystemdUnit do
|
|
858
858
|
it "returns true when unit is enabled" do
|
859
859
|
current_resource.user(user_name)
|
860
860
|
expect(provider).to receive(:shell_out_compacted)
|
861
|
-
|
862
|
-
|
861
|
+
.with(systemctl_path, "--user", "is-enabled", unit_name, user_cmd_opts)
|
862
|
+
.and_return(shell_out_success)
|
863
863
|
expect(provider.enabled?).to be true
|
864
864
|
end
|
865
865
|
|
@@ -875,8 +875,8 @@ describe Chef::Provider::SystemdUnit do
|
|
875
875
|
context "when no user is specified" do
|
876
876
|
it "returns true when unit is enabled" do
|
877
877
|
expect(provider).to receive(:shell_out_compacted)
|
878
|
-
|
879
|
-
|
878
|
+
.with(systemctl_path, "--system", "is-enabled", unit_name)
|
879
|
+
.and_return(shell_out_success)
|
880
880
|
expect(provider.enabled?).to be true
|
881
881
|
end
|
882
882
|
|
@@ -899,16 +899,16 @@ describe Chef::Provider::SystemdUnit do
|
|
899
899
|
it "returns true when the unit is masked" do
|
900
900
|
current_resource.user(user_name)
|
901
901
|
expect(provider).to receive(:shell_out_compacted)
|
902
|
-
|
903
|
-
|
902
|
+
.with(systemctl_path, "--user", "status", unit_name, user_cmd_opts)
|
903
|
+
.and_return(shell_out_masked)
|
904
904
|
expect(provider.masked?).to be true
|
905
905
|
end
|
906
906
|
|
907
907
|
it "returns false when the unit is not masked" do
|
908
908
|
current_resource.user(user_name)
|
909
909
|
expect(provider).to receive(:shell_out_compacted)
|
910
|
-
|
911
|
-
|
910
|
+
.with(systemctl_path, "--user", "status", unit_name, user_cmd_opts)
|
911
|
+
.and_return(shell_out_static)
|
912
912
|
expect(provider.masked?).to be false
|
913
913
|
end
|
914
914
|
end
|
@@ -916,15 +916,15 @@ describe Chef::Provider::SystemdUnit do
|
|
916
916
|
context "when no user is specified" do
|
917
917
|
it "returns true when the unit is masked" do
|
918
918
|
expect(provider).to receive(:shell_out_compacted)
|
919
|
-
|
920
|
-
|
919
|
+
.with(systemctl_path, "--system", "status", unit_name)
|
920
|
+
.and_return(shell_out_masked)
|
921
921
|
expect(provider.masked?).to be true
|
922
922
|
end
|
923
923
|
|
924
924
|
it "returns false when the unit is not masked" do
|
925
925
|
expect(provider).to receive(:shell_out_compacted)
|
926
|
-
|
927
|
-
|
926
|
+
.with(systemctl_path, "--system", "status", unit_name)
|
927
|
+
.and_return(shell_out_static)
|
928
928
|
expect(provider.masked?).to be false
|
929
929
|
end
|
930
930
|
end
|
@@ -940,16 +940,16 @@ describe Chef::Provider::SystemdUnit do
|
|
940
940
|
it "returns true when the unit is static" do
|
941
941
|
current_resource.user(user_name)
|
942
942
|
expect(provider).to receive(:shell_out_compacted)
|
943
|
-
|
944
|
-
|
943
|
+
.with(systemctl_path, "--user", "is-enabled", unit_name, user_cmd_opts)
|
944
|
+
.and_return(shell_out_static)
|
945
945
|
expect(provider.static?).to be true
|
946
946
|
end
|
947
947
|
|
948
948
|
it "returns false when the unit is not static" do
|
949
949
|
current_resource.user(user_name)
|
950
950
|
expect(provider).to receive(:shell_out_compacted)
|
951
|
-
|
952
|
-
|
951
|
+
.with(systemctl_path, "--user", "is-enabled", unit_name, user_cmd_opts)
|
952
|
+
.and_return(shell_out_masked)
|
953
953
|
expect(provider.static?).to be false
|
954
954
|
end
|
955
955
|
end
|
@@ -957,15 +957,15 @@ describe Chef::Provider::SystemdUnit do
|
|
957
957
|
context "when no user is specified" do
|
958
958
|
it "returns true when the unit is static" do
|
959
959
|
expect(provider).to receive(:shell_out_compacted)
|
960
|
-
|
961
|
-
|
960
|
+
.with(systemctl_path, "--system", "is-enabled", unit_name)
|
961
|
+
.and_return(shell_out_static)
|
962
962
|
expect(provider.static?).to be true
|
963
963
|
end
|
964
964
|
|
965
965
|
it "returns false when the unit is not static" do
|
966
966
|
expect(provider).to receive(:shell_out_compacted)
|
967
|
-
|
968
|
-
|
967
|
+
.with(systemctl_path, "--system", "is-enabled", unit_name)
|
968
|
+
.and_return(shell_out_masked)
|
969
969
|
expect(provider.static?).to be false
|
970
970
|
end
|
971
971
|
end
|