chef 16.11.7-universal-mingw32 → 17.2.29-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 +9 -21
- data/README.md +1 -1
- data/Rakefile +13 -2
- data/chef-universal-mingw32.gemspec +1 -1
- data/chef.gemspec +11 -24
- data/distro/ruby_bin_folder/AMD64/Chef.PowerShell.Wrapper.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/Chef.PowerShell.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/Newtonsoft.Json.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdb +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.NETCore.App.deps.json +153 -149
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Diagnostics.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Management.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Utility.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.ConsoleHost.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.CoreCLR.Eventing.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.MarkdownRender.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Security.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Management.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Runtime.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Newtonsoft.Json.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.Messages.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Common.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Management.Automation.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Pkcs.dll +0 -0
- data/distro/ruby_bin_folder/x86/Chef.PowerShell.dll +0 -0
- data/distro/ruby_bin_folder/x86/Chef.Powershell.Wrapper.dll +0 -0
- data/distro/ruby_bin_folder/x86/Newtonsoft.Json.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdb +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.NETCore.App.deps.json +153 -149
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Diagnostics.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Management.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Utility.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.ConsoleHost.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.CoreCLR.Eventing.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.MarkdownRender.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Security.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Management.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Runtime.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Newtonsoft.Json.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.Messages.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Common.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Management.Automation.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Pkcs.dll +0 -0
- data/lib/chef/action_collection.rb +6 -26
- data/lib/chef/application.rb +1 -1
- data/lib/chef/application/base.rb +16 -1
- data/lib/chef/applications.rb +0 -1
- data/lib/chef/chef_fs/command_line.rb +5 -2
- data/lib/chef/chef_fs/file_pattern.rb +2 -2
- data/lib/chef/chef_fs/file_system.rb +9 -10
- data/lib/chef/client.rb +8 -2
- data/lib/chef/compliance/default_attributes.rb +5 -4
- data/lib/chef/compliance/fetcher/automate.rb +0 -7
- data/lib/chef/compliance/reporter/automate.rb +17 -7
- data/lib/chef/compliance/reporter/chef_server_automate.rb +11 -6
- data/lib/chef/compliance/reporter/cli.rb +77 -0
- data/lib/chef/compliance/reporter/compliance_enforcer.rb +4 -0
- data/lib/chef/compliance/reporter/json_file.rb +8 -1
- data/lib/chef/compliance/runner.rb +65 -27
- data/lib/chef/cookbook/cookbook_version_loader.rb +3 -3
- data/lib/chef/cookbook/gem_installer.rb +5 -1
- data/lib/chef/cookbook/synchronizer.rb +3 -5
- data/lib/chef/cookbook_loader.rb +2 -4
- data/lib/chef/cookbook_uploader.rb +0 -1
- data/lib/chef/cookbook_version.rb +26 -4
- data/lib/chef/data_bag.rb +2 -1
- data/lib/chef/data_bag_item.rb +13 -3
- data/lib/chef/data_collector.rb +0 -1
- data/lib/chef/data_collector/run_end_message.rb +1 -1
- data/lib/chef/delayed_evaluator.rb +4 -0
- data/lib/chef/deprecated.rb +8 -0
- data/lib/chef/dsl/chef_vault.rb +6 -6
- data/lib/chef/dsl/declare_resource.rb +5 -10
- data/lib/chef/dsl/reboot_pending.rb +1 -2
- data/lib/chef/event_dispatch/base.rb +2 -1
- data/lib/chef/exceptions.rb +3 -0
- data/lib/chef/formatters/doc.rb +2 -1
- data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +20 -22
- data/lib/chef/group.rb +75 -0
- data/lib/chef/handler.rb +46 -8
- data/lib/chef/handler/slow_report.rb +66 -0
- data/lib/chef/mixin/get_source_from_package.rb +1 -1
- data/lib/chef/node.rb +21 -20
- data/lib/chef/node/attribute.rb +6 -4
- data/lib/chef/node/immutable_collections.rb +13 -0
- data/lib/chef/node/mixin/deep_merge_cache.rb +11 -7
- data/lib/chef/org.rb +3 -2
- data/lib/chef/property.rb +18 -0
- data/lib/chef/provider.rb +1 -1
- data/lib/chef/provider/cron.rb +1 -1
- data/lib/chef/provider/directory.rb +6 -6
- data/lib/chef/provider/execute.rb +2 -1
- data/lib/chef/provider/file.rb +2 -2
- data/lib/chef/provider/git.rb +5 -7
- data/lib/chef/provider/group/groupadd.rb +3 -3
- data/lib/chef/provider/group/groupmod.rb +3 -3
- data/lib/chef/provider/group/pw.rb +3 -3
- data/lib/chef/provider/ifconfig.rb +2 -2
- data/lib/chef/provider/link.rb +3 -3
- data/lib/chef/provider/mount.rb +12 -7
- data/lib/chef/provider/mount/aix.rb +3 -3
- data/lib/chef/provider/mount/mount.rb +5 -5
- data/lib/chef/provider/mount/windows.rb +1 -1
- data/lib/chef/provider/package.rb +17 -21
- data/lib/chef/provider/package/apt.rb +27 -1
- data/lib/chef/provider/package/deb.rb +3 -3
- data/lib/chef/provider/package/dnf/dnf_helper.py +12 -11
- data/lib/chef/provider/package/dnf/python_helper.rb +9 -8
- data/lib/chef/provider/package/portage.rb +2 -2
- data/lib/chef/provider/package/rubygems.rb +11 -17
- data/lib/chef/provider/package/windows.rb +2 -4
- data/lib/chef/provider/package/yum.rb +1 -4
- data/lib/chef/provider/package/yum/python_helper.rb +15 -10
- data/lib/chef/provider/package/yum/yum_helper.py +47 -63
- data/lib/chef/provider/registry_key.rb +1 -1
- data/lib/chef/provider/route.rb +2 -2
- data/lib/chef/provider/service.rb +6 -6
- data/lib/chef/provider/service/aixinit.rb +1 -1
- data/lib/chef/provider/service/debian.rb +1 -1
- data/lib/chef/provider/service/freebsd.rb +15 -21
- data/lib/chef/provider/service/macosx.rb +7 -7
- data/lib/chef/provider/service/systemd.rb +43 -14
- data/lib/chef/provider/service/upstart.rb +2 -13
- data/lib/chef/provider/service/windows.rb +12 -12
- data/lib/chef/provider/subversion.rb +10 -12
- data/lib/chef/provider/support/zypper_repo.erb +4 -2
- data/lib/chef/provider/systemd_unit.rb +36 -10
- data/lib/chef/provider/template/content.rb +3 -7
- data/lib/chef/provider/user.rb +2 -2
- data/lib/chef/provider/user/dscl.rb +1 -1
- data/lib/chef/provider/user/mac.rb +17 -20
- data/lib/chef/provider/user/pw.rb +1 -1
- data/lib/chef/provider/user/windows.rb +1 -1
- data/lib/chef/provider/windows_script.rb +1 -1
- data/lib/chef/provider/zypper_repository.rb +28 -32
- data/lib/chef/providers.rb +0 -1
- data/lib/chef/resource.rb +6 -7
- data/lib/chef/resource/alternatives.rb +6 -6
- data/lib/chef/resource/apt_package.rb +1 -1
- data/lib/chef/resource/apt_preference.rb +2 -2
- data/lib/chef/resource/apt_repository.rb +6 -6
- data/lib/chef/resource/apt_update.rb +5 -4
- data/lib/chef/resource/archive_file.rb +2 -3
- data/lib/chef/resource/breakpoint.rb +1 -1
- data/lib/chef/resource/build_essential.rb +2 -6
- data/lib/chef/resource/chef_client_config.rb +3 -3
- data/lib/chef/resource/chef_client_cron.rb +4 -4
- data/lib/chef/resource/chef_client_launchd.rb +6 -6
- data/lib/chef/resource/chef_client_scheduled_task.rb +15 -15
- data/lib/chef/resource/chef_client_systemd_timer.rb +4 -4
- data/lib/chef/resource/chef_handler.rb +3 -7
- data/lib/chef/resource/chef_sleep.rb +1 -1
- data/lib/chef/resource/chef_vault_secret.rb +3 -8
- data/lib/chef/resource/chocolatey_config.rb +2 -6
- data/lib/chef/resource/chocolatey_feature.rb +2 -6
- data/lib/chef/resource/chocolatey_source.rb +4 -10
- data/lib/chef/resource/cron/_cron_shared.rb +2 -2
- data/lib/chef/resource/cron/cron_d.rb +4 -6
- data/lib/chef/resource/cron_access.rb +2 -4
- data/lib/chef/resource/dmg_package.rb +6 -10
- data/lib/chef/resource/dpkg_package.rb +1 -1
- data/lib/chef/resource/execute.rb +8 -3
- data/lib/chef/resource/file.rb +1 -1
- data/lib/chef/resource/group.rb +6 -6
- data/lib/chef/resource/homebrew_cask.rb +17 -10
- data/lib/chef/resource/homebrew_package.rb +1 -1
- data/lib/chef/resource/homebrew_tap.rb +4 -7
- data/lib/chef/resource/homebrew_update.rb +2 -2
- data/lib/chef/resource/hostname.rb +68 -22
- data/lib/chef/resource/http_request.rb +1 -1
- data/lib/chef/resource/inspec_waiver_file_entry.rb +156 -0
- data/lib/chef/resource/kernel_module.rb +6 -17
- data/lib/chef/resource/locale.rb +2 -3
- data/lib/chef/resource/lwrp_base.rb +19 -0
- data/lib/chef/resource/macos_userdefaults.rb +10 -14
- data/lib/chef/resource/mdadm.rb +53 -7
- data/lib/chef/resource/mount.rb +2 -1
- data/lib/chef/resource/ohai_hint.rb +2 -6
- data/lib/chef/resource/openbsd_package.rb +17 -0
- data/lib/chef/resource/openssl_dhparam.rb +1 -2
- data/lib/chef/resource/openssl_ec_private_key.rb +3 -5
- data/lib/chef/resource/openssl_ec_public_key.rb +1 -3
- data/lib/chef/resource/openssl_rsa_private_key.rb +2 -4
- data/lib/chef/resource/openssl_rsa_public_key.rb +1 -3
- data/lib/chef/resource/openssl_x509_certificate.rb +3 -6
- data/lib/chef/resource/openssl_x509_crl.rb +1 -3
- data/lib/chef/resource/openssl_x509_request.rb +1 -3
- data/lib/chef/resource/osx_profile.rb +3 -3
- data/lib/chef/resource/plist.rb +8 -8
- data/lib/chef/resource/powershell_package_source.rb +2 -4
- data/lib/chef/resource/powershell_script.rb +1 -1
- data/lib/chef/resource/reboot.rb +38 -9
- data/lib/chef/resource/remote_directory.rb +2 -2
- data/lib/chef/resource/remote_file.rb +3 -3
- data/lib/chef/resource/rhsm_errata.rb +16 -3
- data/lib/chef/resource/rhsm_errata_level.rb +11 -6
- data/lib/chef/resource/rhsm_register.rb +12 -6
- data/lib/chef/resource/rhsm_repo.rb +17 -6
- data/lib/chef/resource/rhsm_subscription.rb +2 -6
- data/lib/chef/resource/scm/git.rb +1 -1
- data/lib/chef/resource/ssh_known_hosts_entry.rb +4 -7
- data/lib/chef/resource/sudo.rb +8 -12
- data/lib/chef/resource/swap_file.rb +2 -6
- data/lib/chef/resource/sysctl.rb +2 -6
- data/lib/chef/resource/systemd_unit.rb +2 -2
- data/lib/chef/resource/template.rb +1 -1
- data/lib/chef/resource/timezone.rb +1 -3
- data/lib/chef/resource/user/mac_user.rb +1 -1
- data/lib/chef/resource/user_ulimit.rb +2 -2
- data/lib/chef/resource/windows_ad_join.rb +2 -6
- data/lib/chef/resource/windows_audit_policy.rb +2 -2
- data/lib/chef/resource/windows_auto_run.rb +2 -5
- data/lib/chef/resource/windows_certificate.rb +207 -73
- data/lib/chef/resource/windows_dfs_folder.rb +2 -6
- data/lib/chef/resource/windows_dfs_namespace.rb +2 -6
- data/lib/chef/resource/windows_dfs_server.rb +1 -3
- data/lib/chef/resource/windows_dns_record.rb +2 -6
- data/lib/chef/resource/windows_dns_zone.rb +2 -6
- data/lib/chef/resource/windows_env.rb +6 -5
- data/lib/chef/resource/windows_feature.rb +3 -9
- data/lib/chef/resource/windows_feature_dism.rb +3 -9
- data/lib/chef/resource/windows_feature_powershell.rb +3 -3
- data/lib/chef/resource/windows_firewall_profile.rb +4 -4
- data/lib/chef/resource/windows_firewall_rule.rb +20 -9
- data/lib/chef/resource/windows_font.rb +3 -5
- data/lib/chef/resource/windows_pagefile.rb +104 -69
- data/lib/chef/resource/windows_path.rb +4 -4
- data/lib/chef/resource/windows_printer.rb +8 -23
- data/lib/chef/resource/windows_printer_port.rb +49 -66
- data/lib/chef/resource/windows_security_policy.rb +56 -40
- data/lib/chef/resource/windows_share.rb +14 -21
- data/lib/chef/resource/windows_shortcut.rb +4 -6
- data/lib/chef/resource/windows_task.rb +19 -7
- data/lib/chef/resource/windows_uac.rb +3 -5
- data/lib/chef/resource/windows_user_privilege.rb +4 -4
- data/lib/chef/resource/windows_workgroup.rb +3 -4
- data/lib/chef/resource/yum_package.rb +10 -10
- data/lib/chef/resource/zypper_package.rb +4 -4
- data/lib/chef/resource/zypper_repository.rb +28 -8
- data/lib/chef/resource_builder.rb +8 -2
- data/lib/chef/resource_reporter.rb +0 -1
- data/lib/chef/resources.rb +1 -1
- data/lib/chef/run_lock.rb +1 -1
- data/lib/chef/runner.rb +1 -1
- data/lib/chef/shell/ext.rb +3 -3
- data/lib/chef/user.rb +0 -1
- data/lib/chef/user_v1.rb +3 -4
- data/lib/chef/util/dsc/configuration_generator.rb +1 -0
- data/lib/chef/util/dsc/local_configuration_manager.rb +1 -1
- data/lib/chef/version.rb +1 -1
- data/lib/chef/win32/api.rb +9 -2
- data/lib/chef/win32/registry.rb +4 -2
- data/spec/data/cookbooks/openldap/libraries/openldap.rb +1 -1
- data/spec/data/lwrp/resources/bar.rb +2 -0
- data/spec/data/lwrp/resources/buck_passer.rb +1 -0
- data/spec/data/lwrp/resources/buck_passer_2.rb +1 -0
- data/spec/data/lwrp/resources/embedded_resource_accesses_providers_scope.rb +1 -0
- data/spec/data/lwrp/resources/foo.rb +2 -0
- data/spec/data/lwrp/resources/inline_compiler.rb +1 -0
- data/spec/data/lwrp/resources/monkey_name_printer.rb +1 -0
- data/spec/data/lwrp/resources/paint_drying_watcher.rb +1 -0
- data/spec/data/lwrp/resources/thumb_twiddler.rb +1 -0
- data/spec/data/lwrp/resources_with_default_attributes/nodeattr.rb +2 -0
- data/spec/data/lwrp_const_scoping/resources/conflict.rb +1 -0
- data/spec/data/lwrp_override/resources/foo.rb +1 -0
- data/spec/data/rubygems.org/nonexistent_gem-info +1 -0
- data/spec/data/rubygems.org/sexp_processor-info +49 -0
- data/spec/data/run_context/cookbooks/circular-dep1/resources/resource.rb +1 -0
- data/spec/data/run_context/cookbooks/circular-dep2/resources/resource.rb +1 -0
- data/spec/data/run_context/cookbooks/dependency1/resources/resource.rb +1 -0
- data/spec/data/run_context/cookbooks/dependency2/resources/resource.rb +1 -0
- data/spec/data/run_context/cookbooks/no-default-attr/resources/resource.rb +1 -0
- data/spec/data/run_context/cookbooks/test-with-circular-deps/resources/resource.rb +2 -0
- data/spec/data/run_context/cookbooks/test-with-deps/resources/resource.rb +1 -0
- data/spec/data/run_context/cookbooks/test/resources/resource.rb +2 -0
- data/spec/functional/dsl/registry_helper_spec.rb +1 -1
- data/spec/functional/resource/aixinit_service_spec.rb +7 -7
- data/spec/functional/resource/apt_package_spec.rb +1 -1
- data/spec/functional/resource/chocolatey_package_spec.rb +13 -0
- data/spec/functional/resource/cron_spec.rb +1 -1
- data/spec/functional/resource/dnf_package_spec.rb +857 -534
- data/spec/functional/resource/group_spec.rb +1 -1
- data/spec/functional/resource/link_spec.rb +1 -1
- data/spec/functional/resource/registry_spec.rb +8 -8
- data/spec/functional/resource/remote_file_spec.rb +1 -1
- data/spec/functional/resource/user/mac_user_spec.rb +2 -2
- data/spec/functional/resource/windows_certificate_spec.rb +92 -35
- data/spec/functional/resource/windows_env_spec.rb +2 -2
- data/spec/functional/resource/windows_hostname_spec.rb +91 -0
- data/spec/functional/resource/windows_pagefile_spec.rb +98 -0
- data/spec/functional/resource/yum_package_spec.rb +495 -428
- data/spec/functional/version_spec.rb +1 -1
- data/spec/functional/win32/registry_spec.rb +1 -1
- data/spec/integration/client/client_spec.rb +5 -22
- data/spec/integration/client/exit_code_spec.rb +1 -1
- data/spec/integration/client/ipv6_spec.rb +1 -1
- data/spec/integration/compliance/compliance_spec.rb +1 -1
- data/spec/integration/ohai/ohai_spec.rb +7 -6
- data/spec/integration/recipes/accumulator_spec.rb +13 -1
- data/spec/integration/recipes/lwrp_inline_resources_spec.rb +5 -1
- data/spec/integration/recipes/lwrp_spec.rb +3 -1
- data/spec/integration/recipes/notifies_spec.rb +15 -1
- data/spec/integration/recipes/notifying_block_spec.rb +2 -1
- data/spec/integration/recipes/recipe_dsl_spec.rb +9 -9
- data/spec/integration/recipes/unified_mode_spec.rb +71 -1
- data/spec/integration/recipes/use_partial_spec.rb +4 -1
- data/spec/spec_helper.rb +14 -13
- data/spec/support/chef_helpers.rb +1 -17
- data/spec/support/lib/chef/resource/with_state.rb +0 -1
- data/spec/support/lib/chef/resource/zen_follower.rb +0 -1
- data/spec/support/lib/chef/resource/zen_master.rb +0 -1
- data/spec/support/matchers/leak.rb +7 -9
- data/spec/support/platform_helpers.rb +5 -8
- data/spec/support/shared/functional/execute_resource.rb +1 -1
- data/spec/support/shared/integration/integration_helper.rb +0 -1
- data/spec/support/shared/unit/provider/file.rb +15 -1
- data/spec/support/shared/unit/script_resource.rb +2 -2
- data/spec/unit/application/solo_spec.rb +2 -2
- data/spec/unit/chef_fs/diff_spec.rb +1 -1
- data/spec/unit/chef_fs/file_system/repository/directory_spec.rb +1 -1
- data/spec/unit/chef_fs/file_system_spec.rb +1 -1
- data/spec/unit/compliance/fetcher/automate_spec.rb +0 -16
- data/spec/unit/compliance/reporter/automate_spec.rb +26 -2
- data/spec/unit/compliance/reporter/chef_server_automate_spec.rb +20 -0
- data/spec/unit/compliance/reporter/compliance_enforcer_spec.rb +1 -0
- data/spec/unit/compliance/runner_spec.rb +31 -5
- data/spec/unit/cookbook_version_spec.rb +52 -0
- data/spec/unit/data_bag_item_spec.rb +3 -8
- data/spec/unit/data_bag_spec.rb +1 -1
- data/spec/unit/data_collector_spec.rb +47 -1
- data/spec/unit/dsl/reboot_pending_spec.rb +2 -2
- data/spec/unit/dsl/registry_helper_spec.rb +1 -1
- data/spec/unit/handler_spec.rb +8 -2
- data/spec/unit/lwrp_spec.rb +1 -1
- data/spec/unit/mixin/params_validate_spec.rb +4 -3
- data/spec/unit/node/attribute_spec.rb +1 -1
- data/spec/unit/node_spec.rb +78 -0
- data/spec/unit/org_group_spec.rb +45 -0
- data/spec/unit/property_spec.rb +23 -22
- data/spec/unit/provider/cron_spec.rb +1 -1
- data/spec/unit/provider/group/gpasswd_spec.rb +2 -2
- data/spec/unit/provider/group/groupmod_spec.rb +2 -2
- data/spec/unit/provider/group/pw_spec.rb +2 -2
- data/spec/unit/provider/group_spec.rb +1 -1
- data/spec/unit/provider/link_spec.rb +1 -1
- data/spec/unit/provider/mount/mount_spec.rb +51 -0
- data/spec/unit/provider/package/apt_spec.rb +84 -18
- data/spec/unit/provider/package/deb_spec.rb +3 -3
- data/spec/unit/provider/package/dnf/python_helper_spec.rb +1 -0
- data/spec/unit/provider/package/rubygems_spec.rb +21 -33
- data/spec/unit/provider/package/yum/python_helper_spec.rb +1 -0
- data/spec/unit/provider/service/arch_service_spec.rb +1 -0
- data/spec/unit/provider/service/debian_service_spec.rb +1 -0
- data/spec/unit/provider/service/macosx_spec.rb +5 -5
- data/spec/unit/provider/service/systemd_service_spec.rb +138 -23
- data/spec/unit/provider/service/upstart_service_spec.rb +0 -29
- data/spec/unit/provider/service/windows_spec.rb +2 -2
- data/spec/unit/provider/subversion_spec.rb +2 -2
- data/spec/unit/provider/systemd_unit_spec.rb +79 -60
- data/spec/unit/provider/zypper_repository_spec.rb +5 -12
- data/spec/unit/provider_spec.rb +0 -8
- data/spec/unit/resource/inspec_waiver_file_entry_spec.rb +80 -0
- data/spec/unit/resource/powershell_script_spec.rb +2 -2
- data/spec/unit/resource/windows_firewall_rule_spec.rb +12 -7
- data/spec/unit/resource/windows_pagefile_spec.rb +4 -9
- data/spec/unit/resource/windows_task_spec.rb +1 -1
- data/spec/unit/resource/zypper_repository_spec.rb +1 -1
- data/spec/unit/user_spec.rb +1 -1
- data/spec/unit/user_v1_spec.rb +6 -4
- data/tasks/rspec.rb +9 -6
- metadata +26 -528
- data/bin/knife +0 -24
- data/lib/chef/application/knife.rb +0 -234
- data/lib/chef/application/windows_service.rb +0 -338
- data/lib/chef/application/windows_service_manager.rb +0 -205
- data/lib/chef/chef_fs/knife.rb +0 -160
- data/lib/chef/chef_fs/parallelizer.rb +0 -102
- data/lib/chef/chef_fs/parallelizer/flatten_enumerable.rb +0 -35
- data/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb +0 -278
- data/lib/chef/cookbook_site_streaming_uploader.rb +0 -244
- data/lib/chef/knife.rb +0 -665
- data/lib/chef/knife/acl_add.rb +0 -57
- data/lib/chef/knife/acl_base.rb +0 -183
- data/lib/chef/knife/acl_bulk_add.rb +0 -78
- data/lib/chef/knife/acl_bulk_remove.rb +0 -83
- data/lib/chef/knife/acl_remove.rb +0 -62
- data/lib/chef/knife/acl_show.rb +0 -56
- data/lib/chef/knife/bootstrap.rb +0 -1192
- data/lib/chef/knife/bootstrap/chef_vault_handler.rb +0 -162
- data/lib/chef/knife/bootstrap/client_builder.rb +0 -212
- data/lib/chef/knife/bootstrap/templates/README.md +0 -11
- data/lib/chef/knife/bootstrap/templates/chef-full.erb +0 -242
- data/lib/chef/knife/bootstrap/templates/windows-chef-client-msi.erb +0 -278
- data/lib/chef/knife/bootstrap/train_connector.rb +0 -336
- data/lib/chef/knife/client_bulk_delete.rb +0 -104
- data/lib/chef/knife/client_create.rb +0 -101
- data/lib/chef/knife/client_delete.rb +0 -62
- data/lib/chef/knife/client_edit.rb +0 -52
- data/lib/chef/knife/client_key_create.rb +0 -73
- data/lib/chef/knife/client_key_delete.rb +0 -80
- data/lib/chef/knife/client_key_edit.rb +0 -83
- data/lib/chef/knife/client_key_list.rb +0 -73
- data/lib/chef/knife/client_key_show.rb +0 -80
- data/lib/chef/knife/client_list.rb +0 -41
- data/lib/chef/knife/client_reregister.rb +0 -58
- data/lib/chef/knife/client_show.rb +0 -48
- data/lib/chef/knife/config_get.rb +0 -39
- data/lib/chef/knife/config_get_profile.rb +0 -37
- data/lib/chef/knife/config_list.rb +0 -139
- data/lib/chef/knife/config_list_profiles.rb +0 -37
- data/lib/chef/knife/config_show.rb +0 -127
- data/lib/chef/knife/config_use.rb +0 -61
- data/lib/chef/knife/config_use_profile.rb +0 -47
- data/lib/chef/knife/configure.rb +0 -150
- data/lib/chef/knife/configure_client.rb +0 -48
- data/lib/chef/knife/cookbook_bulk_delete.rb +0 -71
- data/lib/chef/knife/cookbook_delete.rb +0 -151
- data/lib/chef/knife/cookbook_download.rb +0 -142
- data/lib/chef/knife/cookbook_list.rb +0 -47
- data/lib/chef/knife/cookbook_metadata.rb +0 -106
- data/lib/chef/knife/cookbook_metadata_from_file.rb +0 -49
- data/lib/chef/knife/cookbook_show.rb +0 -98
- data/lib/chef/knife/cookbook_upload.rb +0 -292
- data/lib/chef/knife/core/bootstrap_context.rb +0 -264
- data/lib/chef/knife/core/cookbook_scm_repo.rb +0 -159
- data/lib/chef/knife/core/formatting_options.rb +0 -49
- data/lib/chef/knife/core/gem_glob_loader.rb +0 -138
- data/lib/chef/knife/core/generic_presenter.rb +0 -232
- data/lib/chef/knife/core/hashed_command_loader.rb +0 -100
- data/lib/chef/knife/core/node_editor.rb +0 -130
- data/lib/chef/knife/core/node_presenter.rb +0 -133
- data/lib/chef/knife/core/object_loader.rb +0 -115
- data/lib/chef/knife/core/status_presenter.rb +0 -147
- data/lib/chef/knife/core/subcommand_loader.rb +0 -203
- data/lib/chef/knife/core/text_formatter.rb +0 -85
- data/lib/chef/knife/core/ui.rb +0 -338
- data/lib/chef/knife/core/windows_bootstrap_context.rb +0 -406
- data/lib/chef/knife/data_bag_create.rb +0 -81
- data/lib/chef/knife/data_bag_delete.rb +0 -49
- data/lib/chef/knife/data_bag_edit.rb +0 -74
- data/lib/chef/knife/data_bag_from_file.rb +0 -113
- data/lib/chef/knife/data_bag_list.rb +0 -42
- data/lib/chef/knife/data_bag_secret_options.rb +0 -122
- data/lib/chef/knife/data_bag_show.rb +0 -69
- data/lib/chef/knife/delete.rb +0 -125
- data/lib/chef/knife/deps.rb +0 -156
- data/lib/chef/knife/diff.rb +0 -83
- data/lib/chef/knife/download.rb +0 -84
- data/lib/chef/knife/edit.rb +0 -88
- data/lib/chef/knife/environment_compare.rb +0 -128
- data/lib/chef/knife/environment_create.rb +0 -52
- data/lib/chef/knife/environment_delete.rb +0 -44
- data/lib/chef/knife/environment_edit.rb +0 -44
- data/lib/chef/knife/environment_from_file.rb +0 -84
- data/lib/chef/knife/environment_list.rb +0 -41
- data/lib/chef/knife/environment_show.rb +0 -47
- data/lib/chef/knife/exec.rb +0 -99
- data/lib/chef/knife/group_add.rb +0 -55
- data/lib/chef/knife/group_create.rb +0 -49
- data/lib/chef/knife/group_destroy.rb +0 -53
- data/lib/chef/knife/group_list.rb +0 -43
- data/lib/chef/knife/group_remove.rb +0 -56
- data/lib/chef/knife/group_show.rb +0 -49
- data/lib/chef/knife/key_create.rb +0 -112
- data/lib/chef/knife/key_create_base.rb +0 -50
- data/lib/chef/knife/key_delete.rb +0 -55
- data/lib/chef/knife/key_edit.rb +0 -118
- data/lib/chef/knife/key_edit_base.rb +0 -55
- data/lib/chef/knife/key_list.rb +0 -90
- data/lib/chef/knife/key_list_base.rb +0 -45
- data/lib/chef/knife/key_show.rb +0 -53
- data/lib/chef/knife/list.rb +0 -177
- data/lib/chef/knife/node_bulk_delete.rb +0 -75
- data/lib/chef/knife/node_create.rb +0 -47
- data/lib/chef/knife/node_delete.rb +0 -46
- data/lib/chef/knife/node_edit.rb +0 -70
- data/lib/chef/knife/node_environment_set.rb +0 -53
- data/lib/chef/knife/node_from_file.rb +0 -51
- data/lib/chef/knife/node_list.rb +0 -44
- data/lib/chef/knife/node_policy_set.rb +0 -79
- data/lib/chef/knife/node_run_list_add.rb +0 -104
- data/lib/chef/knife/node_run_list_remove.rb +0 -67
- data/lib/chef/knife/node_run_list_set.rb +0 -66
- data/lib/chef/knife/node_show.rb +0 -63
- data/lib/chef/knife/null.rb +0 -12
- data/lib/chef/knife/raw.rb +0 -123
- data/lib/chef/knife/recipe_list.rb +0 -32
- data/lib/chef/knife/rehash.rb +0 -50
- data/lib/chef/knife/role_bulk_delete.rb +0 -66
- data/lib/chef/knife/role_create.rb +0 -53
- data/lib/chef/knife/role_delete.rb +0 -46
- data/lib/chef/knife/role_edit.rb +0 -45
- data/lib/chef/knife/role_env_run_list_add.rb +0 -87
- data/lib/chef/knife/role_env_run_list_clear.rb +0 -55
- data/lib/chef/knife/role_env_run_list_remove.rb +0 -57
- data/lib/chef/knife/role_env_run_list_replace.rb +0 -60
- data/lib/chef/knife/role_env_run_list_set.rb +0 -70
- data/lib/chef/knife/role_from_file.rb +0 -51
- data/lib/chef/knife/role_list.rb +0 -42
- data/lib/chef/knife/role_run_list_add.rb +0 -87
- data/lib/chef/knife/role_run_list_clear.rb +0 -55
- data/lib/chef/knife/role_run_list_remove.rb +0 -56
- data/lib/chef/knife/role_run_list_replace.rb +0 -60
- data/lib/chef/knife/role_run_list_set.rb +0 -69
- data/lib/chef/knife/role_show.rb +0 -48
- data/lib/chef/knife/search.rb +0 -194
- data/lib/chef/knife/serve.rb +0 -65
- data/lib/chef/knife/show.rb +0 -72
- data/lib/chef/knife/ssh.rb +0 -645
- data/lib/chef/knife/ssl_check.rb +0 -284
- data/lib/chef/knife/ssl_fetch.rb +0 -161
- data/lib/chef/knife/status.rb +0 -95
- data/lib/chef/knife/supermarket_download.rb +0 -121
- data/lib/chef/knife/supermarket_install.rb +0 -192
- data/lib/chef/knife/supermarket_list.rb +0 -76
- data/lib/chef/knife/supermarket_search.rb +0 -53
- data/lib/chef/knife/supermarket_share.rb +0 -166
- data/lib/chef/knife/supermarket_show.rb +0 -66
- data/lib/chef/knife/supermarket_unshare.rb +0 -61
- data/lib/chef/knife/tag_create.rb +0 -52
- data/lib/chef/knife/tag_delete.rb +0 -60
- data/lib/chef/knife/tag_list.rb +0 -47
- data/lib/chef/knife/upload.rb +0 -86
- data/lib/chef/knife/user_create.rb +0 -107
- data/lib/chef/knife/user_delete.rb +0 -44
- data/lib/chef/knife/user_dissociate.rb +0 -42
- data/lib/chef/knife/user_edit.rb +0 -52
- data/lib/chef/knife/user_invite_add.rb +0 -43
- data/lib/chef/knife/user_invite_list.rb +0 -34
- data/lib/chef/knife/user_invite_rescind.rb +0 -63
- data/lib/chef/knife/user_key_create.rb +0 -73
- data/lib/chef/knife/user_key_delete.rb +0 -80
- data/lib/chef/knife/user_key_edit.rb +0 -83
- data/lib/chef/knife/user_key_list.rb +0 -73
- data/lib/chef/knife/user_key_show.rb +0 -80
- data/lib/chef/knife/user_list.rb +0 -42
- data/lib/chef/knife/user_reregister.rb +0 -59
- data/lib/chef/knife/user_show.rb +0 -48
- data/lib/chef/knife/xargs.rb +0 -282
- data/lib/chef/knife/yaml_convert.rb +0 -91
- data/lib/chef/provider/package/yum/simplejson/LICENSE.txt +0 -79
- data/lib/chef/provider/package/yum/simplejson/__init__.py +0 -318
- data/lib/chef/provider/package/yum/simplejson/__init__.pyc +0 -0
- data/lib/chef/provider/package/yum/simplejson/decoder.py +0 -354
- data/lib/chef/provider/package/yum/simplejson/decoder.pyc +0 -0
- data/lib/chef/provider/package/yum/simplejson/encoder.py +0 -440
- data/lib/chef/provider/package/yum/simplejson/encoder.pyc +0 -0
- data/lib/chef/provider/package/yum/simplejson/scanner.py +0 -65
- data/lib/chef/provider/package/yum/simplejson/scanner.pyc +0 -0
- data/lib/chef/provider/package/yum/simplejson/tool.py +0 -37
- data/lib/chef/resource/user/dscl_user.rb +0 -35
- data/spec/functional/knife/configure_spec.rb +0 -33
- data/spec/functional/knife/cookbook_delete_spec.rb +0 -156
- data/spec/functional/knife/exec_spec.rb +0 -55
- data/spec/functional/knife/rehash_spec.rb +0 -39
- data/spec/functional/knife/smoke_test.rb +0 -42
- data/spec/functional/knife/ssh_spec.rb +0 -352
- data/spec/functional/resource/user/dscl_spec.rb +0 -188
- data/spec/functional/resource/windows_service_spec.rb +0 -105
- data/spec/functional/win32/service_manager_spec.rb +0 -220
- data/spec/integration/knife/chef_fs_data_store_spec.rb +0 -557
- data/spec/integration/knife/chef_repo_path_spec.rb +0 -962
- data/spec/integration/knife/chef_repository_file_system_spec.rb +0 -200
- data/spec/integration/knife/chefignore_spec.rb +0 -301
- data/spec/integration/knife/client_bulk_delete_spec.rb +0 -131
- data/spec/integration/knife/client_create_spec.rb +0 -70
- data/spec/integration/knife/client_delete_spec.rb +0 -64
- data/spec/integration/knife/client_key_create_spec.rb +0 -66
- data/spec/integration/knife/client_key_delete_spec.rb +0 -43
- data/spec/integration/knife/client_key_list_spec.rb +0 -61
- data/spec/integration/knife/client_key_show_spec.rb +0 -45
- data/spec/integration/knife/client_list_spec.rb +0 -49
- data/spec/integration/knife/client_show_spec.rb +0 -37
- data/spec/integration/knife/common_options_spec.rb +0 -174
- data/spec/integration/knife/config_list_spec.rb +0 -220
- data/spec/integration/knife/config_show_spec.rb +0 -192
- data/spec/integration/knife/config_use_spec.rb +0 -198
- data/spec/integration/knife/cookbook_api_ipv6_spec.rb +0 -113
- data/spec/integration/knife/cookbook_bulk_delete_spec.rb +0 -65
- data/spec/integration/knife/cookbook_download_spec.rb +0 -72
- data/spec/integration/knife/cookbook_list_spec.rb +0 -55
- data/spec/integration/knife/cookbook_show_spec.rb +0 -149
- data/spec/integration/knife/cookbook_upload_spec.rb +0 -128
- data/spec/integration/knife/data_bag_create_spec.rb +0 -125
- data/spec/integration/knife/data_bag_delete_spec.rb +0 -59
- data/spec/integration/knife/data_bag_edit_spec.rb +0 -105
- data/spec/integration/knife/data_bag_from_file_spec.rb +0 -116
- data/spec/integration/knife/data_bag_list_spec.rb +0 -44
- data/spec/integration/knife/data_bag_show_spec.rb +0 -95
- data/spec/integration/knife/delete_spec.rb +0 -1018
- data/spec/integration/knife/deps_spec.rb +0 -703
- data/spec/integration/knife/diff_spec.rb +0 -605
- data/spec/integration/knife/download_spec.rb +0 -1336
- data/spec/integration/knife/environment_compare_spec.rb +0 -75
- data/spec/integration/knife/environment_create_spec.rb +0 -41
- data/spec/integration/knife/environment_delete_spec.rb +0 -37
- data/spec/integration/knife/environment_from_file_spec.rb +0 -116
- data/spec/integration/knife/environment_list_spec.rb +0 -42
- data/spec/integration/knife/environment_show_spec.rb +0 -77
- data/spec/integration/knife/list_spec.rb +0 -1060
- data/spec/integration/knife/node_bulk_delete_spec.rb +0 -52
- data/spec/integration/knife/node_create_spec.rb +0 -47
- data/spec/integration/knife/node_delete_spec.rb +0 -48
- data/spec/integration/knife/node_environment_set_spec.rb +0 -46
- data/spec/integration/knife/node_from_file_spec.rb +0 -59
- data/spec/integration/knife/node_list_spec.rb +0 -45
- data/spec/integration/knife/node_run_list_add_spec.rb +0 -54
- data/spec/integration/knife/node_run_list_remove_spec.rb +0 -36
- data/spec/integration/knife/node_run_list_set_spec.rb +0 -41
- data/spec/integration/knife/node_show_spec.rb +0 -36
- data/spec/integration/knife/raw_spec.rb +0 -297
- data/spec/integration/knife/redirection_spec.rb +0 -64
- data/spec/integration/knife/role_bulk_delete_spec.rb +0 -52
- data/spec/integration/knife/role_create_spec.rb +0 -41
- data/spec/integration/knife/role_delete_spec.rb +0 -48
- data/spec/integration/knife/role_from_file_spec.rb +0 -96
- data/spec/integration/knife/role_list_spec.rb +0 -45
- data/spec/integration/knife/role_show_spec.rb +0 -51
- data/spec/integration/knife/search_node_spec.rb +0 -40
- data/spec/integration/knife/serve_spec.rb +0 -92
- data/spec/integration/knife/show_spec.rb +0 -197
- data/spec/integration/knife/upload_spec.rb +0 -1617
- data/spec/support/shared/functional/win32_service.rb +0 -57
- data/spec/unit/application/knife_spec.rb +0 -241
- data/spec/unit/chef_fs/parallelizer_spec.rb +0 -479
- data/spec/unit/cookbook_site_streaming_uploader_spec.rb +0 -198
- data/spec/unit/knife/bootstrap/chef_vault_handler_spec.rb +0 -152
- data/spec/unit/knife/bootstrap/client_builder_spec.rb +0 -207
- data/spec/unit/knife/bootstrap/train_connector_spec.rb +0 -244
- data/spec/unit/knife/bootstrap_spec.rb +0 -2220
- data/spec/unit/knife/client_bulk_delete_spec.rb +0 -166
- data/spec/unit/knife/client_create_spec.rb +0 -169
- data/spec/unit/knife/client_delete_spec.rb +0 -99
- data/spec/unit/knife/client_edit_spec.rb +0 -53
- data/spec/unit/knife/client_list_spec.rb +0 -34
- data/spec/unit/knife/client_reregister_spec.rb +0 -62
- data/spec/unit/knife/client_show_spec.rb +0 -52
- data/spec/unit/knife/configure_client_spec.rb +0 -81
- data/spec/unit/knife/configure_spec.rb +0 -190
- data/spec/unit/knife/cookbook_bulk_delete_spec.rb +0 -87
- data/spec/unit/knife/cookbook_delete_spec.rb +0 -239
- data/spec/unit/knife/cookbook_download_spec.rb +0 -255
- data/spec/unit/knife/cookbook_list_spec.rb +0 -88
- data/spec/unit/knife/cookbook_metadata_from_file_spec.rb +0 -72
- data/spec/unit/knife/cookbook_metadata_spec.rb +0 -182
- data/spec/unit/knife/cookbook_show_spec.rb +0 -253
- data/spec/unit/knife/cookbook_upload_spec.rb +0 -364
- data/spec/unit/knife/core/bootstrap_context_spec.rb +0 -287
- data/spec/unit/knife/core/cookbook_scm_repo_spec.rb +0 -187
- data/spec/unit/knife/core/gem_glob_loader_spec.rb +0 -209
- data/spec/unit/knife/core/hashed_command_loader_spec.rb +0 -112
- data/spec/unit/knife/core/node_editor_spec.rb +0 -211
- data/spec/unit/knife/core/object_loader_spec.rb +0 -81
- data/spec/unit/knife/core/status_presenter_spec.rb +0 -54
- data/spec/unit/knife/core/subcommand_loader_spec.rb +0 -64
- data/spec/unit/knife/core/ui_spec.rb +0 -656
- data/spec/unit/knife/core/windows_bootstrap_context_spec.rb +0 -238
- data/spec/unit/knife/data_bag_create_spec.rb +0 -175
- data/spec/unit/knife/data_bag_edit_spec.rb +0 -126
- data/spec/unit/knife/data_bag_from_file_spec.rb +0 -174
- data/spec/unit/knife/data_bag_secret_options_spec.rb +0 -173
- data/spec/unit/knife/data_bag_show_spec.rb +0 -139
- data/spec/unit/knife/environment_compare_spec.rb +0 -112
- data/spec/unit/knife/environment_create_spec.rb +0 -91
- data/spec/unit/knife/environment_delete_spec.rb +0 -71
- data/spec/unit/knife/environment_edit_spec.rb +0 -79
- data/spec/unit/knife/environment_from_file_spec.rb +0 -90
- data/spec/unit/knife/environment_list_spec.rb +0 -54
- data/spec/unit/knife/environment_show_spec.rb +0 -52
- data/spec/unit/knife/key_create_spec.rb +0 -223
- data/spec/unit/knife/key_delete_spec.rb +0 -133
- data/spec/unit/knife/key_edit_spec.rb +0 -264
- data/spec/unit/knife/key_helper.rb +0 -74
- data/spec/unit/knife/key_list_spec.rb +0 -216
- data/spec/unit/knife/key_show_spec.rb +0 -126
- data/spec/unit/knife/node_bulk_delete_spec.rb +0 -94
- data/spec/unit/knife/node_delete_spec.rb +0 -77
- data/spec/unit/knife/node_edit_spec.rb +0 -116
- data/spec/unit/knife/node_environment_set_spec.rb +0 -61
- data/spec/unit/knife/node_from_file_spec.rb +0 -59
- data/spec/unit/knife/node_list_spec.rb +0 -62
- data/spec/unit/knife/node_policy_set_spec.rb +0 -122
- data/spec/unit/knife/node_run_list_add_spec.rb +0 -145
- data/spec/unit/knife/node_run_list_remove_spec.rb +0 -106
- data/spec/unit/knife/node_run_list_set_spec.rb +0 -115
- data/spec/unit/knife/node_show_spec.rb +0 -65
- data/spec/unit/knife/raw_spec.rb +0 -43
- data/spec/unit/knife/role_bulk_delete_spec.rb +0 -80
- data/spec/unit/knife/role_create_spec.rb +0 -80
- data/spec/unit/knife/role_delete_spec.rb +0 -67
- data/spec/unit/knife/role_edit_spec.rb +0 -77
- data/spec/unit/knife/role_env_run_list_add_spec.rb +0 -217
- data/spec/unit/knife/role_env_run_list_clear_spec.rb +0 -94
- data/spec/unit/knife/role_env_run_list_remove_spec.rb +0 -102
- data/spec/unit/knife/role_env_run_list_replace_spec.rb +0 -105
- data/spec/unit/knife/role_env_run_list_set_spec.rb +0 -99
- data/spec/unit/knife/role_from_file_spec.rb +0 -69
- data/spec/unit/knife/role_list_spec.rb +0 -54
- data/spec/unit/knife/role_run_list_add_spec.rb +0 -179
- data/spec/unit/knife/role_run_list_clear_spec.rb +0 -84
- data/spec/unit/knife/role_run_list_remove_spec.rb +0 -92
- data/spec/unit/knife/role_run_list_replace_spec.rb +0 -98
- data/spec/unit/knife/role_run_list_set_spec.rb +0 -89
- data/spec/unit/knife/role_show_spec.rb +0 -59
- data/spec/unit/knife/ssh_spec.rb +0 -403
- data/spec/unit/knife/ssl_check_spec.rb +0 -256
- data/spec/unit/knife/ssl_fetch_spec.rb +0 -222
- data/spec/unit/knife/status_spec.rb +0 -112
- data/spec/unit/knife/supermarket_download_spec.rb +0 -152
- data/spec/unit/knife/supermarket_install_spec.rb +0 -202
- data/spec/unit/knife/supermarket_list_spec.rb +0 -70
- data/spec/unit/knife/supermarket_search_spec.rb +0 -85
- data/spec/unit/knife/supermarket_share_spec.rb +0 -208
- data/spec/unit/knife/supermarket_unshare_spec.rb +0 -78
- data/spec/unit/knife/tag_create_spec.rb +0 -23
- data/spec/unit/knife/tag_delete_spec.rb +0 -25
- data/spec/unit/knife/tag_list_spec.rb +0 -23
- data/spec/unit/knife/user_create_spec.rb +0 -184
- data/spec/unit/knife/user_delete_spec.rb +0 -46
- data/spec/unit/knife/user_edit_spec.rb +0 -48
- data/spec/unit/knife/user_list_spec.rb +0 -36
- data/spec/unit/knife/user_reregister_spec.rb +0 -56
- data/spec/unit/knife/user_show_spec.rb +0 -46
- data/spec/unit/knife_spec.rb +0 -634
- data/spec/unit/provider/user/dscl_spec.rb +0 -699
- data/spec/unit/windows_service_spec.rb +0 -118
data/lib/chef/run_lock.rb
CHANGED
@@ -173,7 +173,7 @@ class Chef
|
|
173
173
|
# Mutex name is case-sensitive contrary to other things in
|
174
174
|
# windows. "\" is the only invalid character.
|
175
175
|
def acquire_win32_mutex
|
176
|
-
@mutex = Chef::ReservedNames::Win32::Mutex.new("Global\\#{runlock_file.tr(
|
176
|
+
@mutex = Chef::ReservedNames::Win32::Mutex.new("Global\\#{runlock_file.tr("\\", "/").downcase}")
|
177
177
|
mutex.test
|
178
178
|
end
|
179
179
|
|
data/lib/chef/runner.rb
CHANGED
data/lib/chef/shell/ext.rb
CHANGED
@@ -198,9 +198,9 @@ module Shell
|
|
198
198
|
prints a detailed explanation of the command if available, or the
|
199
199
|
description if no explanation is available.
|
200
200
|
E
|
201
|
-
def help(
|
202
|
-
if
|
203
|
-
explain_command(
|
201
|
+
def help(command = nil)
|
202
|
+
if command
|
203
|
+
explain_command(command)
|
204
204
|
else
|
205
205
|
puts help_banner
|
206
206
|
end
|
data/lib/chef/user.rb
CHANGED
data/lib/chef/user_v1.rb
CHANGED
@@ -145,11 +145,11 @@ class Chef
|
|
145
145
|
payload = {
|
146
146
|
username: @username,
|
147
147
|
display_name: @display_name,
|
148
|
-
first_name: @first_name,
|
149
|
-
last_name: @last_name,
|
150
148
|
email: @email,
|
151
|
-
password: @password,
|
152
149
|
}
|
150
|
+
payload[:first_name] = @first_name unless @first_name.nil?
|
151
|
+
payload[:last_name] = @last_name unless @last_name.nil?
|
152
|
+
payload[:password] = @password unless @password.nil?
|
153
153
|
payload[:public_key] = @public_key unless @public_key.nil?
|
154
154
|
payload[:create_key] = @create_key unless @create_key.nil?
|
155
155
|
payload[:middle_name] = @middle_name unless @middle_name.nil?
|
@@ -258,7 +258,6 @@ class Chef
|
|
258
258
|
end
|
259
259
|
|
260
260
|
# Class Methods
|
261
|
-
|
262
261
|
def self.from_hash(user_hash)
|
263
262
|
user = Chef::UserV1.new
|
264
263
|
user.username user_hash["username"]
|
@@ -103,7 +103,7 @@ class Chef::Util::DSC
|
|
103
103
|
end
|
104
104
|
|
105
105
|
def whatif_not_supported?(dsc_exception_output)
|
106
|
-
!! (dsc_exception_output.gsub(
|
106
|
+
!! (dsc_exception_output.gsub(/\n+/, "").gsub(/\s+/, " ") =~ /A parameter cannot be found that matches parameter name 'Whatif'/i)
|
107
107
|
end
|
108
108
|
|
109
109
|
def dsc_module_import_failure?(command_output)
|
data/lib/chef/version.rb
CHANGED
data/lib/chef/win32/api.rb
CHANGED
@@ -43,6 +43,8 @@ class Chef
|
|
43
43
|
|
44
44
|
host.ffi_convention :stdcall
|
45
45
|
|
46
|
+
win64 = ENV["PROCESSOR_ARCHITECTURE"] == "AMD64"
|
47
|
+
|
46
48
|
# Windows-specific type defs (ms-help://MS.MSDNQTR.v90.en/winprog/winprog/windows_data_types.htm):
|
47
49
|
host.typedef :ushort, :ATOM # Atom ~= Symbol: Atom table stores strings and corresponding identifiers. Application
|
48
50
|
# places a string in an atom table and receives a 16-bit integer, called an atom, that
|
@@ -120,10 +122,15 @@ class Chef
|
|
120
122
|
host.typedef :int32, :LONG32 # 32-bit signed integer. The range is -2,147,483,648 through +...647 decimal.
|
121
123
|
host.typedef :int64, :LONG64 # 64-bit signed integer. The range is –9,223,372,036,854,775,808 through +...807
|
122
124
|
host.typedef :int64, :LONGLONG # 64-bit signed integer. The range is –9,223,372,036,854,775,808 through +...807
|
123
|
-
host.typedef :long, :LONG_PTR # Signed long type for pointer precision. Use when casting a pointer to a long to
|
124
125
|
# perform pointer arithmetic. BaseTsd.h:
|
125
126
|
# if defined(_WIN64) host.typedef __int64 LONG_PTR; #else host.typedef long LONG_PTR;
|
126
|
-
|
127
|
+
if win64
|
128
|
+
host.typedef :int64, :LONG_PTR # Signed long type for pointer precision. Use when casting a pointer to a long to
|
129
|
+
host.typedef :int64, :LPARAM # Message parameter. WinDef.h as follows: #host.typedef LONG_PTR LPARAM;
|
130
|
+
else
|
131
|
+
host.typedef :long, :LONG_PTR # Signed long type for pointer precision. Use when casting a pointer to a long to
|
132
|
+
host.typedef :long, :LPARAM # Message parameter. WinDef.h as follows: #host.typedef LONG_PTR LPARAM;
|
133
|
+
end
|
127
134
|
host.typedef :pointer, :LPBOOL # Pointer to a BOOL. WinDef.h as follows: #host.typedef BOOL far *LPBOOL;
|
128
135
|
host.typedef :pointer, :LPBYTE # Pointer to a BYTE. WinDef.h as follows: #host.typedef BYTE far *LPBYTE;
|
129
136
|
host.typedef :pointer, :LPCOLORREF # Pointer to a COLORREF value. WinDef.h as follows: #host.typedef DWORD *LPCOLORREF;
|
data/lib/chef/win32/registry.rb
CHANGED
@@ -21,9 +21,11 @@ require_relative "api"
|
|
21
21
|
require_relative "../mixin/wide_string"
|
22
22
|
|
23
23
|
if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
|
24
|
-
Win32.autoload :Registry, File.expand_path("../monkey_patches/win32/registry", __dir__)
|
25
|
-
require_relative "api/registry"
|
26
24
|
require "win32/api"
|
25
|
+
module Win32
|
26
|
+
autoload :Registry, File.expand_path("../monkey_patches/win32/registry", __dir__)
|
27
|
+
end
|
28
|
+
require_relative "api/registry"
|
27
29
|
end
|
28
30
|
|
29
31
|
class Chef
|
@@ -0,0 +1 @@
|
|
1
|
+
unified_mode true
|
@@ -0,0 +1 @@
|
|
1
|
+
This gem could not be found
|
@@ -0,0 +1,49 @@
|
|
1
|
+
---
|
2
|
+
3.0.0 |checksum:ff9abf0d904ba57b9654352b396aa28cf6ad5315af99d8bbf664f5ff6efd3a5d
|
3
|
+
3.0.1 |checksum:d012a759dc6950dcda667a359051c2e62e4bd19790aeed698a5e47d013ef3ae7
|
4
|
+
3.0.2 |checksum:ba85e835493e6099c2f52937b77ce518d65af39409befdd9b43927c0a604ed87
|
5
|
+
3.0.3 |checksum:a433b01d821f5e81200fbec77fc26a1ecb186ad7d8e40d19ed34ea295287170a
|
6
|
+
3.0.4 |checksum:5f394545863d5abe5c3f53c3b883128f58900cd792504076a765b53c9a49f10a
|
7
|
+
3.0.5 |checksum:8e06c84ed3a0159a0f2e6f7b10bbd056954ac2d33548318ccc3088556c8a8891
|
8
|
+
3.0.6 |checksum:e6e0f30ff14b73b28f8e5803646aa6d2ed81b3b239e76815fd8160ea4121c650
|
9
|
+
3.0.7 |checksum:7647c24bbebea0ef57a892953fc96349091924a399ee5d98f41da5d9db484816
|
10
|
+
3.0.8 |checksum:6c8ff89feab635e332e115356451614a16d171485e34b6b30a6dea243caaaed7
|
11
|
+
3.0.9 |checksum:b55c35100f5e1e191ff67eac8667aea9433d1492697c9434cdb35550cf6e4dd0
|
12
|
+
3.0.10 |checksum:e168db8d4eccfc721685d939654698f1b419f018f45e38d17ab40033102987f4
|
13
|
+
3.1.0 |checksum:3d9dd950ba0b235c4901d04e410c7e716feb491148bf0ca7daa0f510838b3bf7
|
14
|
+
3.2.0 |checksum:5951f8d33ede2f68686c701142c6cc1004d6f525b0aa8e8279a1bf075542b0f0
|
15
|
+
4.0.0 |checksum:36c185f8caecacb178500cabdc3e038862df640536c2e84ab763ae134462896f
|
16
|
+
4.0.1 |checksum:efd33857c0f41a413ec3ea20251f43c4826fe8a11b01099335f4a3b6777eb727
|
17
|
+
4.1.0 |checksum:d26879b9a0675ea156c82e26971149349a1474aac3da4d0d2a04cc18e6df73a3
|
18
|
+
4.1.1 |checksum:15df4e54e0fab19e225862b36dff823d5b87d57ea998f2e47c52ce01de82b3d9
|
19
|
+
4.1.2 |checksum:7c2ed2d62d0305f2c33cba2e99b288df0f3f4343c367b8ee8cad8c735abc8568
|
20
|
+
4.1.3 |checksum:d02f1465c7f012f77a61abdaa841a5273a2277247bc143bfa11cf139a29dbdf8
|
21
|
+
4.1.4 |checksum:f7798b1682dcf750dab5f4f8da548fee36f30864a4e4b0d8a63295d159357c3b
|
22
|
+
4.1.5 |checksum:741c7dfe5e392ae39e22399546d25fe00ffdfc7a55e653e6a99b6770b1c0066c
|
23
|
+
4.2.0 |checksum:3cde88e3d440f63af3cd48edca88bd98872622403740ecda78b7d27161367486
|
24
|
+
4.2.1 |checksum:dfc3eef6ef13c5750c3faab782c4db6c74a7bcc5d03e56e4edeec21aab034185
|
25
|
+
4.3.0 |checksum:7accb37900d1599c6f0f40be92bc62a5db4e5a7eb64f33a858cf83e798dd1ddc
|
26
|
+
4.4.0 |checksum:71591ddbda99b5e12e4a46d377c87513850ca7aa4b1aa800ae02792cadee6be7
|
27
|
+
4.4.1 |checksum:8a10333552216bf3d3846476cfe78dbc9b5724864e3f5016837724622d828f16
|
28
|
+
4.4.2 |checksum:adba9d17de5957532223a1bf0e7bdba5ab849d6576e9210439a7d99e0cfa2595
|
29
|
+
4.4.3 |checksum:b3eb96da1fe998f1c00665a9c645878518134cca7c35d39c4bb716e866f4cc57
|
30
|
+
4.4.4 |checksum:43cab5a67ca409d62411f869ddb7a0a4de0988b489d3f1d610d9b6e521964fd5
|
31
|
+
4.4.5 |checksum:af8713761f1b6604865830c54324e57c33e7cc05107ebdbee4e6d458f8f8fe7c
|
32
|
+
4.5.0 |checksum:54d94dc52cf98a51548c8f3e77031a3347508b542b8cb066100ed3ac40c03081
|
33
|
+
4.5.1 |checksum:1456a9be103bf1de0d34ff6980b77a5a72cf3d4b35bbd2182ac62506981a234c
|
34
|
+
4.6.0 |checksum:e2498f90c75bd4c19d1739afadde8c03af26a881c8bd775f71d2f180de65b43f
|
35
|
+
4.6.1 |checksum:e2e96c2ee3ea81e1dc7b4b4abee23b6e552e669cfe456ee69126a29a03373cd7
|
36
|
+
4.7.0 |checksum:963a1f5b21c95595fb3cf1e8531784bf3d8fe30302cf6f271b08aefdc63e453f
|
37
|
+
4.8.0 |checksum:5b9325f28b5be80ba8d43b7660f60ad67c9304fe8181dee89d3a348b13d2fada
|
38
|
+
4.9.0 |checksum:333619bc71d563ee60f26fc5f3a7f57bd89ee3191177fdce87a014dcb1b8d3b0
|
39
|
+
4.10.0b1 |checksum:8791e2006a2ddbf8dc96cfc19633de01af8cb8687703177a85aeb3f959974d5b,rubygems:> 1.3.1
|
40
|
+
4.10.0 |checksum:b67a289ae4a3968d93dab0803d0ef5a262b6f94138ab98072e489d2aa8af4034
|
41
|
+
4.10.1 |checksum:63d2297712eb1d6219ab1cb9207d9a239ac9ad20463c0b58ca865f0b46deb5ec
|
42
|
+
4.11.0 |checksum:4c90ff17c492789fdd248369fa16ce65ef05576b3d9f593a49c6a0961dbcd5ee
|
43
|
+
4.12.0 |checksum:671110574e96377a03b328bfb7f6339540443eca0b62913bf8fe38e9ebcb4470
|
44
|
+
4.12.1 |checksum:f87cd92457a343b4e951e1f1ac3e8183f98de4640a32f6ceb44628332d21a088
|
45
|
+
4.13.0 |checksum:47e86c22a2d7810897e3eae9669ab9afa220f5e6cea5ac1d47164650a9b857d3
|
46
|
+
4.14.0 |checksum:99a20cc5e7b901f6b493a8ca5e13439b73b19671eaaca68a00216c4f66765edc
|
47
|
+
4.14.1 |checksum:0fa8731445cf4a0c01570ec29aac4b50a0451ce66b1b31ad768f5035e3af7b90,ruby:~> 2.2
|
48
|
+
4.15.0 |checksum:a5ec27d8055ad47444cfb7ce860bad8af2365772a82892f4a8a0d97e8e9e3b34,ruby:~> 2.2
|
49
|
+
4.15.1 |checksum:9291a0f2247f50d15068ee6965b67cd7b678b0d273e18adf3c0b2ea4a890125c,ruby:< 3.1&>= 2.1
|
@@ -21,7 +21,7 @@ require "spec_helper"
|
|
21
21
|
|
22
22
|
describe Chef::Resource::RegistryKey, :windows_only do
|
23
23
|
|
24
|
-
before
|
24
|
+
before(:all) do
|
25
25
|
::Win32::Registry::HKEY_CURRENT_USER.create "Software\\Root"
|
26
26
|
::Win32::Registry::HKEY_CURRENT_USER.create "Software\\Root\\Branch"
|
27
27
|
::Win32::Registry::HKEY_CURRENT_USER.open('Software\\Root', Win32::Registry::KEY_ALL_ACCESS) do |reg|
|
@@ -34,7 +34,7 @@ describe Chef::Resource::Service, :requires_root, :aix_only do
|
|
34
34
|
expect(File.exist?("#{Dir.tmpdir}/#{file_name}")).to be_falsey
|
35
35
|
end
|
36
36
|
|
37
|
-
def
|
37
|
+
def valid_symlinks(expected_output, run_level = nil, status = nil, priority = nil)
|
38
38
|
directory = []
|
39
39
|
if priority.is_a? Hash
|
40
40
|
priority.each do |level, o|
|
@@ -129,7 +129,7 @@ describe Chef::Resource::Service, :requires_root, :aix_only do
|
|
129
129
|
context "when the service doesn't set a priority" do
|
130
130
|
it "creates symlink with status S" do
|
131
131
|
new_resource.run_action(:enable)
|
132
|
-
|
132
|
+
valid_symlinks(["/etc/rc.d/rc2.d/Schefinittest"], 2, "S")
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
@@ -140,7 +140,7 @@ describe Chef::Resource::Service, :requires_root, :aix_only do
|
|
140
140
|
|
141
141
|
it "creates a symlink with status S and a priority" do
|
142
142
|
new_resource.run_action(:enable)
|
143
|
-
|
143
|
+
valid_symlinks(["/etc/rc.d/rc2.d/S75chefinittest"], 2, "S", 75)
|
144
144
|
end
|
145
145
|
end
|
146
146
|
|
@@ -152,7 +152,7 @@ describe Chef::Resource::Service, :requires_root, :aix_only do
|
|
152
152
|
|
153
153
|
it "create symlink with status start (S) or stop (K) and a priority " do
|
154
154
|
new_resource.run_action(:enable)
|
155
|
-
|
155
|
+
valid_symlinks(["/etc/rc.d/rc2.d/S20chefinittest", "/etc/rc.d/rc3.d/K10chefinittest"], 2, "S", new_resource.priority)
|
156
156
|
end
|
157
157
|
end
|
158
158
|
end
|
@@ -170,7 +170,7 @@ describe Chef::Resource::Service, :requires_root, :aix_only do
|
|
170
170
|
|
171
171
|
it "creates symlink with status K" do
|
172
172
|
new_resource.run_action(:disable)
|
173
|
-
|
173
|
+
valid_symlinks(["/etc/rc.d/rc2.d/Kchefinittest"], 2, "K")
|
174
174
|
end
|
175
175
|
end
|
176
176
|
|
@@ -186,7 +186,7 @@ describe Chef::Resource::Service, :requires_root, :aix_only do
|
|
186
186
|
|
187
187
|
it "creates a symlink with status K and a priority" do
|
188
188
|
new_resource.run_action(:disable)
|
189
|
-
|
189
|
+
valid_symlinks(["/etc/rc.d/rc2.d/K25chefinittest"], 2, "K", 25)
|
190
190
|
end
|
191
191
|
end
|
192
192
|
|
@@ -203,7 +203,7 @@ describe Chef::Resource::Service, :requires_root, :aix_only do
|
|
203
203
|
|
204
204
|
it "create symlink with status stop (K) and a priority " do
|
205
205
|
new_resource.run_action(:disable)
|
206
|
-
|
206
|
+
valid_symlinks(["/etc/rc.d/rc2.d/K80chefinittest"], 2, "K", 80)
|
207
207
|
end
|
208
208
|
end
|
209
209
|
end
|
@@ -186,7 +186,7 @@ describe Chef::Resource::AptPackage, metadata do
|
|
186
186
|
it "raises a reasonable error for action :install" do
|
187
187
|
expect do
|
188
188
|
package_resource.run_action(:install)
|
189
|
-
end.to raise_error(
|
189
|
+
end.to raise_error(Chef::Exceptions::Package)
|
190
190
|
end
|
191
191
|
|
192
192
|
end
|
@@ -41,6 +41,19 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
|
|
41
41
|
provider
|
42
42
|
end
|
43
43
|
|
44
|
+
# This bit of magic ensures that we pass a mixed-case Path var in the env to chocolatey and not PATH
|
45
|
+
# (both ENV["PATH"] and ENV["Path"] are the same thing in ruby-on-windows, and the first created key
|
46
|
+
# is the one that is actually passed to a subprocess, and choco demands it be Path)
|
47
|
+
#
|
48
|
+
# This is not a no-op.
|
49
|
+
#
|
50
|
+
# I don't know how to tell what state we were in to begin with, so we cannot restore. Nothing else
|
51
|
+
# seems to care.
|
52
|
+
#
|
53
|
+
before(:all) do
|
54
|
+
ENV["Path"] = ENV.delete("Path")
|
55
|
+
end
|
56
|
+
|
44
57
|
context "installing a package" do
|
45
58
|
after { remove_package }
|
46
59
|
|
@@ -18,9 +18,10 @@
|
|
18
18
|
require "spec_helper"
|
19
19
|
require "chef/mixin/shell_out"
|
20
20
|
|
21
|
-
#
|
22
|
-
exclude_test = !(%w{rhel fedora
|
21
|
+
# test on any fedora-ish platform with dnf
|
22
|
+
exclude_test = !(%w{rhel amazon fedora}.include?(OHAI_SYSTEM[:platform_family]) && File.exist?("/usr/bin/dnf"))
|
23
23
|
describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
24
|
+
include RecipeDSLHelper
|
24
25
|
include Chef::Mixin::ShellOut
|
25
26
|
|
26
27
|
# NOTE: every single test here either needs to explicitly call flush_cache or needs to explicitly
|
@@ -30,7 +31,7 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
30
31
|
def flush_cache
|
31
32
|
# needed on at least fc23/fc24 sometimes to deal with the dnf cache getting out of sync with the rpm db
|
32
33
|
FileUtils.rm_f "/var/cache/dnf/@System.solv"
|
33
|
-
Chef::
|
34
|
+
Chef::Provider::Package::Dnf::PythonHelper.instance.reap
|
34
35
|
end
|
35
36
|
|
36
37
|
def preinstall(*rpms)
|
@@ -40,11 +41,17 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
40
41
|
flush_cache
|
41
42
|
end
|
42
43
|
|
44
|
+
def expect_matching_installed_version(version)
|
45
|
+
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(version)
|
46
|
+
end
|
47
|
+
|
43
48
|
before(:all) do
|
44
49
|
shell_out!("dnf -y install dnf-plugins-core")
|
45
50
|
end
|
46
51
|
|
47
52
|
before(:each) do
|
53
|
+
# force errors to fail and not retry
|
54
|
+
ENV["DNF_HELPER_NO_RETRIES"] = "true"
|
48
55
|
File.open("/etc/yum.repos.d/chef-dnf-localtesting.repo", "w+") do |f|
|
49
56
|
f.write <<~EOF
|
50
57
|
[chef-dnf-localtesting]
|
@@ -54,6 +61,7 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
54
61
|
gpgcheck=0
|
55
62
|
EOF
|
56
63
|
end
|
64
|
+
# ensure we don't have any stray chef_rpms installed
|
57
65
|
shell_out!("rpm -qa --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' | grep chef_rpm | xargs -r rpm -e")
|
58
66
|
# next line is useful cleanup if you happen to have been testing both yum + dnf func tests on the same box and
|
59
67
|
# have some yum garbage left around
|
@@ -65,64 +73,71 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
65
73
|
FileUtils.rm_f "/etc/yum.repos.d/chef-dnf-localtesting.repo"
|
66
74
|
end
|
67
75
|
|
68
|
-
let(:
|
69
|
-
Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
|
70
|
-
end
|
71
|
-
|
72
|
-
let(:package_name) { "chef_rpm" }
|
73
|
-
let(:dnf_package) { Chef::Resource::DnfPackage.new(package_name, run_context) }
|
76
|
+
let(:default_options) { "--nogpgcheck --disablerepo=* --enablerepo=chef-dnf-localtesting" }
|
74
77
|
|
75
78
|
def pkg_arch
|
76
|
-
|
79
|
+
OHAI_SYSTEM[:kernel][:machine]
|
77
80
|
end
|
78
81
|
|
79
82
|
describe ":install" do
|
80
83
|
context "vanilla use case" do
|
81
|
-
let(:package_name) { "chef_rpm" }
|
82
|
-
|
83
84
|
it "installs if the package is not installed" do
|
84
85
|
flush_cache
|
85
|
-
dnf_package
|
86
|
-
|
86
|
+
dnf_package "chef_rpm" do
|
87
|
+
options default_options
|
88
|
+
action :install
|
89
|
+
end.should_be_updated
|
87
90
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
88
91
|
end
|
89
92
|
|
90
93
|
it "does not install if the package is installed" do
|
91
94
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
92
|
-
dnf_package
|
93
|
-
|
95
|
+
dnf_package "chef_rpm" do
|
96
|
+
options default_options
|
97
|
+
action :install
|
98
|
+
end.should_not_be_updated
|
94
99
|
end
|
95
100
|
|
96
101
|
it "does not install twice" do
|
97
102
|
flush_cache
|
98
|
-
dnf_package
|
99
|
-
|
103
|
+
dnf_package "chef_rpm" do
|
104
|
+
options default_options
|
105
|
+
action :install
|
106
|
+
end.should_be_updated
|
100
107
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
101
|
-
dnf_package
|
102
|
-
|
108
|
+
dnf_package "chef_rpm" do
|
109
|
+
options default_options
|
110
|
+
action :install
|
111
|
+
end.should_not_be_updated
|
103
112
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
104
113
|
end
|
105
114
|
|
106
115
|
it "does not install if the prior version package is installed" do
|
107
116
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
108
|
-
dnf_package
|
109
|
-
|
117
|
+
dnf_package "chef_rpm" do
|
118
|
+
options default_options
|
119
|
+
action :install
|
120
|
+
end.should_not_be_updated
|
110
121
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
111
122
|
end
|
112
123
|
|
113
124
|
it "does not install if the i686 package is installed", :intel_64bit do
|
114
125
|
skip "FIXME: do nothing, or install the #{pkg_arch} version?"
|
115
126
|
preinstall("chef_rpm-1.10-1.i686.rpm")
|
116
|
-
dnf_package
|
117
|
-
|
127
|
+
dnf_package "chef_rpm" do
|
128
|
+
options default_options
|
129
|
+
action :install
|
130
|
+
end.should_not_be_updated
|
118
131
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.i686$")
|
119
132
|
end
|
120
133
|
|
121
134
|
it "does not install if the prior version i686 package is installed", :intel_64bit do
|
122
135
|
skip "FIXME: do nothing, or install the #{pkg_arch} version?"
|
123
136
|
preinstall("chef_rpm-1.2-1.i686.rpm")
|
124
|
-
dnf_package
|
125
|
-
|
137
|
+
dnf_package "chef_rpm" do
|
138
|
+
options default_options
|
139
|
+
action :install
|
140
|
+
end.should_not_be_updated
|
126
141
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.i686$")
|
127
142
|
end
|
128
143
|
end
|
@@ -131,72 +146,81 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
131
146
|
%w{1.10 1* 1.10-1 1*-1 1.10-* 1*-* 0:1.10 0:1* 0:1.10-1 0:1*-1 *:1.10-* *:1*-*}.each do |vstring|
|
132
147
|
it "installs the rpm when #{vstring} is in the package_name" do
|
133
148
|
flush_cache
|
134
|
-
dnf_package
|
135
|
-
|
136
|
-
|
149
|
+
dnf_package "chef_rpm-#{vstring}" do
|
150
|
+
options default_options
|
151
|
+
action :install
|
152
|
+
end.should_be_updated
|
137
153
|
end
|
138
154
|
|
139
155
|
it "is idempotent when #{vstring} is in the package_name" do
|
140
156
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
141
|
-
dnf_package
|
142
|
-
|
143
|
-
|
157
|
+
dnf_package "chef_rpm-#{vstring}" do
|
158
|
+
options default_options
|
159
|
+
action :install
|
160
|
+
end.should_not_be_updated
|
144
161
|
end
|
145
162
|
|
146
163
|
it "installs the rpm when #{vstring} is in the version property" do
|
147
164
|
flush_cache
|
148
|
-
dnf_package
|
149
|
-
|
150
|
-
|
151
|
-
|
165
|
+
dnf_package "chef_rpm" do
|
166
|
+
options default_options
|
167
|
+
version vstring
|
168
|
+
action :install
|
169
|
+
end.should_be_updated
|
152
170
|
end
|
153
171
|
|
154
172
|
it "is idempotent when #{vstring} is in the version property" do
|
155
173
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
156
|
-
dnf_package
|
157
|
-
|
158
|
-
|
159
|
-
|
174
|
+
dnf_package "chef_rpm" do
|
175
|
+
options default_options
|
176
|
+
version vstring
|
177
|
+
action :install
|
178
|
+
end.should_not_be_updated
|
160
179
|
end
|
161
180
|
|
162
181
|
it "upgrades the rpm when #{vstring} is in the package_name" do
|
163
182
|
flush_cache
|
164
|
-
dnf_package
|
165
|
-
|
166
|
-
|
183
|
+
dnf_package "chef_rpm-#{vstring}" do
|
184
|
+
options default_options
|
185
|
+
action :upgrade
|
186
|
+
end.should_be_updated
|
167
187
|
end
|
168
188
|
|
169
189
|
it "is idempotent when #{vstring} is in the package_name" do
|
170
190
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
171
|
-
dnf_package
|
172
|
-
|
173
|
-
|
191
|
+
dnf_package "chef_rpm-#{vstring}" do
|
192
|
+
options default_options
|
193
|
+
action :upgrade
|
194
|
+
end.should_not_be_updated
|
174
195
|
end
|
175
196
|
|
176
197
|
it "upgrades the rpm when #{vstring} is in the version property" do
|
177
198
|
flush_cache
|
178
|
-
dnf_package
|
179
|
-
|
180
|
-
|
181
|
-
|
199
|
+
dnf_package "chef_rpm" do
|
200
|
+
options default_options
|
201
|
+
version vstring
|
202
|
+
action :upgrade
|
203
|
+
end.should_be_updated
|
182
204
|
end
|
183
205
|
|
184
206
|
it "is idempotent when #{vstring} is in the version property" do
|
185
207
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
186
|
-
dnf_package
|
187
|
-
|
188
|
-
|
189
|
-
|
208
|
+
dnf_package "chef_rpm" do
|
209
|
+
options default_options
|
210
|
+
version vstring
|
211
|
+
action :upgrade
|
212
|
+
end.should_not_be_updated
|
190
213
|
end
|
191
214
|
end
|
192
215
|
|
193
216
|
%w{1.2 1* 1.2-1 1*-1 1.2-* 1*-* 0:1.2 0:1* 0:1.2-1 0:1*-1 *:1.2-* *:1*-*}.each do |vstring|
|
194
217
|
it "is idempotent when #{vstring} is in the version property and there is a candidate version" do
|
195
218
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
196
|
-
dnf_package
|
197
|
-
|
198
|
-
|
199
|
-
|
219
|
+
dnf_package "chef_rpm" do
|
220
|
+
options default_options
|
221
|
+
version vstring
|
222
|
+
action :install
|
223
|
+
end.should_not_be_updated
|
200
224
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
201
225
|
end
|
202
226
|
end
|
@@ -204,10 +228,11 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
204
228
|
%w{1.2 1.2-1 1.2-* 0:1.2 0:1.2-1 *:1.2-*}.each do |vstring|
|
205
229
|
it "is idempotent when #{vstring} is in the version property on upgrade and it doesn't match the candidate version" do
|
206
230
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
207
|
-
dnf_package
|
208
|
-
|
209
|
-
|
210
|
-
|
231
|
+
dnf_package "chef_rpm" do
|
232
|
+
options default_options
|
233
|
+
version vstring
|
234
|
+
action :upgrade
|
235
|
+
end.should_not_be_updated
|
211
236
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
212
237
|
end
|
213
238
|
end
|
@@ -215,13 +240,17 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
215
240
|
%w{1* 1*-1 1*-* 0:1* 0:1*-1 *:1*-*}.each do |vstring|
|
216
241
|
it "upgrades when #{vstring} is in the version property on upgrade and it matches the candidate version" do
|
217
242
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
218
|
-
dnf_package
|
219
|
-
|
220
|
-
|
221
|
-
|
243
|
+
dnf_package "chef_rpm" do
|
244
|
+
options default_options
|
245
|
+
version vstring
|
246
|
+
action :upgrade
|
247
|
+
end.should_be_updated
|
222
248
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
223
|
-
dnf_package
|
224
|
-
|
249
|
+
dnf_package "chef_rpm" do
|
250
|
+
options default_options
|
251
|
+
version vstring
|
252
|
+
action :upgrade
|
253
|
+
end.should_not_be_updated
|
225
254
|
end
|
226
255
|
end
|
227
256
|
end
|
@@ -229,82 +258,106 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
229
258
|
context "with versions or globs in the name" do
|
230
259
|
it "works with a version" do
|
231
260
|
flush_cache
|
232
|
-
dnf_package
|
233
|
-
|
234
|
-
|
261
|
+
dnf_package "chef_rpm-1.10" do
|
262
|
+
options default_options
|
263
|
+
action :install
|
264
|
+
end.should_be_updated
|
235
265
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
236
|
-
dnf_package.
|
237
|
-
|
266
|
+
dnf_package "chef_rpm-1.10" do
|
267
|
+
options default_options
|
268
|
+
action :install
|
269
|
+
end.should_not_be_updated
|
238
270
|
end
|
239
271
|
|
240
272
|
it "works with an older version" do
|
241
273
|
flush_cache
|
242
|
-
dnf_package
|
243
|
-
|
244
|
-
|
274
|
+
dnf_package "chef_rpm-1.2" do
|
275
|
+
options default_options
|
276
|
+
action :install
|
277
|
+
end.should_be_updated
|
245
278
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
246
|
-
dnf_package.
|
247
|
-
|
279
|
+
dnf_package "chef_rpm-1.2" do
|
280
|
+
options default_options
|
281
|
+
action :install
|
282
|
+
end.should_not_be_updated
|
248
283
|
end
|
249
284
|
|
250
285
|
it "works with an evra" do
|
251
286
|
flush_cache
|
252
|
-
dnf_package
|
253
|
-
|
254
|
-
|
287
|
+
dnf_package "chef_rpm-0:1.2-1.#{pkg_arch}" do
|
288
|
+
options default_options
|
289
|
+
action :install
|
290
|
+
end.should_be_updated
|
255
291
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
256
|
-
dnf_package.
|
257
|
-
|
292
|
+
dnf_package "chef_rpm-0:1.2-1.#{pkg_arch}" do
|
293
|
+
options default_options
|
294
|
+
action :install
|
295
|
+
end.should_not_be_updated
|
258
296
|
end
|
259
297
|
|
260
298
|
it "works with version and release" do
|
261
299
|
flush_cache
|
262
|
-
dnf_package
|
263
|
-
|
264
|
-
|
300
|
+
dnf_package "chef_rpm-1.2-1" do
|
301
|
+
options default_options
|
302
|
+
action :install
|
303
|
+
end.should_be_updated
|
265
304
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
266
|
-
dnf_package.
|
267
|
-
|
305
|
+
dnf_package "chef_rpm-1.2-1" do
|
306
|
+
options default_options
|
307
|
+
action :install
|
308
|
+
end.should_not_be_updated
|
268
309
|
end
|
269
310
|
|
270
311
|
it "works with a version glob" do
|
271
312
|
flush_cache
|
272
|
-
dnf_package
|
273
|
-
|
274
|
-
|
313
|
+
dnf_package "chef_rpm-1*" do
|
314
|
+
options default_options
|
315
|
+
action :install
|
316
|
+
end.should_be_updated
|
275
317
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
276
|
-
dnf_package
|
277
|
-
|
318
|
+
dnf_package "chef_rpm-1*" do
|
319
|
+
options default_options
|
320
|
+
action :install
|
321
|
+
end.should_not_be_updated
|
278
322
|
end
|
279
323
|
|
280
324
|
it "works with a name glob + version glob" do
|
281
325
|
flush_cache
|
282
|
-
dnf_package
|
283
|
-
|
284
|
-
|
326
|
+
dnf_package "chef_rp*-1*" do
|
327
|
+
options default_options
|
328
|
+
action :install
|
329
|
+
end.should_be_updated
|
285
330
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
286
|
-
dnf_package
|
287
|
-
|
331
|
+
dnf_package "chef_rp*-1*" do
|
332
|
+
options default_options
|
333
|
+
action :install
|
334
|
+
end.should_not_be_updated
|
288
335
|
end
|
289
336
|
|
290
337
|
it "upgrades when the installed version does not match the version string" do
|
291
338
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
292
|
-
dnf_package
|
293
|
-
|
294
|
-
|
339
|
+
dnf_package "chef_rpm-1.10" do
|
340
|
+
options default_options
|
341
|
+
action :install
|
342
|
+
end.should_be_updated
|
295
343
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}")
|
296
|
-
dnf_package.
|
297
|
-
|
344
|
+
dnf_package "chef_rpm-1.10" do
|
345
|
+
options default_options
|
346
|
+
action :install
|
347
|
+
end.should_not_be_updated
|
298
348
|
end
|
299
349
|
|
300
350
|
it "downgrades when the installed version is higher than the package_name version" do
|
301
351
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
302
|
-
dnf_package
|
303
|
-
|
304
|
-
|
352
|
+
dnf_package "chef_rpm-1.2" do
|
353
|
+
options default_options
|
354
|
+
action :install
|
355
|
+
end.should_be_updated
|
305
356
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
306
|
-
dnf_package.
|
307
|
-
|
357
|
+
dnf_package "chef_rpm-1.2" do
|
358
|
+
options default_options
|
359
|
+
action :install
|
360
|
+
end.should_not_be_updated
|
308
361
|
end
|
309
362
|
end
|
310
363
|
|
@@ -312,68 +365,92 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
312
365
|
context "with version property" do
|
313
366
|
it "matches the full version" do
|
314
367
|
flush_cache
|
315
|
-
dnf_package
|
316
|
-
|
317
|
-
|
318
|
-
|
368
|
+
dnf_package "chef_rpm" do
|
369
|
+
options default_options
|
370
|
+
version "1.10"
|
371
|
+
action :install
|
372
|
+
end.should_be_updated
|
319
373
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
320
|
-
dnf_package
|
321
|
-
|
374
|
+
dnf_package "chef_rpm" do
|
375
|
+
options default_options
|
376
|
+
version "1.10"
|
377
|
+
action :install
|
378
|
+
end.should_not_be_updated
|
322
379
|
end
|
323
380
|
|
324
381
|
it "matches with a glob" do
|
325
382
|
flush_cache
|
326
|
-
dnf_package
|
327
|
-
|
328
|
-
|
329
|
-
|
383
|
+
dnf_package "chef_rpm" do
|
384
|
+
options default_options
|
385
|
+
version "1*"
|
386
|
+
action :install
|
387
|
+
end.should_be_updated
|
330
388
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
331
|
-
dnf_package
|
332
|
-
|
389
|
+
dnf_package "chef_rpm" do
|
390
|
+
options default_options
|
391
|
+
version "1*"
|
392
|
+
action :install
|
393
|
+
end.should_not_be_updated
|
333
394
|
end
|
334
395
|
|
335
396
|
it "matches the vr" do
|
336
397
|
flush_cache
|
337
|
-
dnf_package
|
338
|
-
|
339
|
-
|
340
|
-
|
398
|
+
dnf_package "chef_rpm" do
|
399
|
+
options default_options
|
400
|
+
version "1.10-1"
|
401
|
+
action :install
|
402
|
+
end.should_be_updated
|
341
403
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
342
|
-
dnf_package
|
343
|
-
|
404
|
+
dnf_package "chef_rpm" do
|
405
|
+
options default_options
|
406
|
+
version "1.10-1"
|
407
|
+
action :install
|
408
|
+
end.should_not_be_updated
|
344
409
|
end
|
345
410
|
|
346
411
|
it "matches the evr" do
|
347
412
|
flush_cache
|
348
|
-
dnf_package
|
349
|
-
|
350
|
-
|
351
|
-
|
413
|
+
dnf_package "chef_rpm" do
|
414
|
+
options default_options
|
415
|
+
version "0:1.10-1"
|
416
|
+
action :install
|
417
|
+
end.should_be_updated
|
352
418
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
353
|
-
dnf_package
|
354
|
-
|
419
|
+
dnf_package "chef_rpm" do
|
420
|
+
options default_options
|
421
|
+
version "0:1.10-1"
|
422
|
+
action :install
|
423
|
+
end.should_not_be_updated
|
355
424
|
end
|
356
425
|
|
357
426
|
it "matches with a vr glob", :rhel_gte_8 do
|
358
427
|
flush_cache
|
359
|
-
dnf_package
|
360
|
-
|
361
|
-
|
362
|
-
|
428
|
+
dnf_package "chef_rpm" do
|
429
|
+
options default_options
|
430
|
+
version "1.10-1*"
|
431
|
+
action :install
|
432
|
+
end.should_be_updated
|
363
433
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
364
|
-
dnf_package
|
365
|
-
|
434
|
+
dnf_package "chef_rpm" do
|
435
|
+
options default_options
|
436
|
+
version "1.10-1*"
|
437
|
+
action :install
|
438
|
+
end.should_not_be_updated
|
366
439
|
end
|
367
440
|
|
368
441
|
it "matches with an evr glob", :rhel_gte_8 do
|
369
442
|
flush_cache
|
370
|
-
dnf_package
|
371
|
-
|
372
|
-
|
373
|
-
|
443
|
+
dnf_package "chef_rpm" do
|
444
|
+
options default_options
|
445
|
+
version "0:1.10-1*"
|
446
|
+
action :install
|
447
|
+
end.should_be_updated
|
374
448
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
375
|
-
dnf_package
|
376
|
-
|
449
|
+
dnf_package "chef_rpm" do
|
450
|
+
options default_options
|
451
|
+
version "0:1.10-1*"
|
452
|
+
action :install
|
453
|
+
end.should_not_be_updated
|
377
454
|
end
|
378
455
|
end
|
379
456
|
|
@@ -381,274 +458,345 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
381
458
|
it "downgrades the package when allow_downgrade" do
|
382
459
|
flush_cache
|
383
460
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
384
|
-
dnf_package
|
385
|
-
|
386
|
-
|
387
|
-
|
461
|
+
dnf_package "chef_rpm" do
|
462
|
+
options default_options
|
463
|
+
version "1.2-1"
|
464
|
+
action :install
|
465
|
+
end.should_be_updated
|
388
466
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
389
|
-
dnf_package
|
390
|
-
|
467
|
+
dnf_package "chef_rpm" do
|
468
|
+
options default_options
|
469
|
+
version "1.2-1"
|
470
|
+
action :install
|
471
|
+
end.should_not_be_updated
|
391
472
|
end
|
392
473
|
end
|
393
474
|
|
394
475
|
context "with arches", :intel_64bit do
|
395
476
|
it "installs with 64-bit arch in the name" do
|
396
477
|
flush_cache
|
397
|
-
dnf_package
|
398
|
-
|
399
|
-
|
478
|
+
dnf_package "chef_rpm.#{pkg_arch}" do
|
479
|
+
options default_options
|
480
|
+
action :install
|
481
|
+
end.should_be_updated
|
400
482
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
401
|
-
dnf_package
|
402
|
-
|
483
|
+
dnf_package "chef_rpm.#{pkg_arch}" do
|
484
|
+
options default_options
|
485
|
+
action :install
|
486
|
+
end.should_not_be_updated
|
403
487
|
end
|
404
488
|
|
405
489
|
it "installs with 32-bit arch in the name" do
|
406
490
|
flush_cache
|
407
|
-
dnf_package
|
408
|
-
|
409
|
-
|
491
|
+
dnf_package "chef_rpm.i686" do
|
492
|
+
options default_options
|
493
|
+
action :install
|
494
|
+
end.should_be_updated
|
410
495
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.i686$")
|
411
|
-
dnf_package.
|
412
|
-
|
496
|
+
dnf_package "chef_rpm.i686" do
|
497
|
+
options default_options
|
498
|
+
action :install
|
499
|
+
end.should_not_be_updated
|
413
500
|
end
|
414
501
|
|
415
502
|
it "installs with 64-bit arch in the property" do
|
416
503
|
flush_cache
|
417
|
-
dnf_package
|
418
|
-
|
419
|
-
|
420
|
-
|
504
|
+
dnf_package "chef_rpm" do
|
505
|
+
options default_options
|
506
|
+
arch pkg_arch
|
507
|
+
action :install
|
508
|
+
end.should_be_updated
|
421
509
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
422
|
-
dnf_package
|
423
|
-
|
510
|
+
dnf_package "chef_rpm" do
|
511
|
+
options default_options
|
512
|
+
arch pkg_arch
|
513
|
+
action :install
|
514
|
+
end.should_not_be_updated
|
424
515
|
end
|
425
516
|
|
426
517
|
it "installs with 32-bit arch in the property" do
|
427
518
|
flush_cache
|
428
|
-
dnf_package
|
429
|
-
|
430
|
-
|
431
|
-
|
519
|
+
dnf_package "chef_rpm" do
|
520
|
+
options default_options
|
521
|
+
arch "i686"
|
522
|
+
action :install
|
523
|
+
end.should_be_updated
|
432
524
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.i686$")
|
433
|
-
dnf_package
|
434
|
-
|
525
|
+
dnf_package "chef_rpm" do
|
526
|
+
options default_options
|
527
|
+
arch "i686"
|
528
|
+
action :install
|
529
|
+
end.should_not_be_updated
|
435
530
|
end
|
436
531
|
|
437
532
|
it "installs when the 32-bit arch is in the name and the version is in the property" do
|
438
533
|
flush_cache
|
439
|
-
dnf_package
|
440
|
-
|
441
|
-
|
442
|
-
|
534
|
+
dnf_package "chef_rpm.i686" do
|
535
|
+
options default_options
|
536
|
+
version "1.10-1"
|
537
|
+
action :install
|
538
|
+
end.should_be_updated
|
443
539
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.i686$")
|
444
|
-
dnf_package.
|
445
|
-
|
540
|
+
dnf_package "chef_rpm.i686" do
|
541
|
+
options default_options
|
542
|
+
version "1.10-1"
|
543
|
+
action :install
|
544
|
+
end.should_not_be_updated
|
446
545
|
end
|
447
546
|
|
448
547
|
it "installs when the 64-bit arch is in the name and the version is in the property" do
|
449
548
|
flush_cache
|
450
|
-
dnf_package
|
451
|
-
|
452
|
-
|
453
|
-
|
549
|
+
dnf_package "chef_rpm.#{pkg_arch}" do
|
550
|
+
options default_options
|
551
|
+
version "1.10-1"
|
552
|
+
action :install
|
553
|
+
end.should_be_updated
|
454
554
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
455
|
-
dnf_package
|
456
|
-
|
555
|
+
dnf_package "chef_rpm.#{pkg_arch}" do
|
556
|
+
options default_options
|
557
|
+
version "1.10-1"
|
558
|
+
action :install
|
559
|
+
end.should_not_be_updated
|
457
560
|
end
|
458
561
|
end
|
459
562
|
|
460
563
|
context "with constraints" do
|
461
564
|
it "with nothing installed, it installs the latest version" do
|
462
565
|
flush_cache
|
463
|
-
dnf_package
|
464
|
-
|
465
|
-
|
566
|
+
dnf_package "chef_rpm >= 1.2" do
|
567
|
+
options default_options
|
568
|
+
action :install
|
569
|
+
end.should_be_updated
|
466
570
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
467
|
-
dnf_package.
|
468
|
-
|
571
|
+
dnf_package "chef_rpm >= 1.2" do
|
572
|
+
options default_options
|
573
|
+
action :install
|
574
|
+
end.should_not_be_updated
|
469
575
|
end
|
470
576
|
|
471
577
|
it "when it is met, it does nothing" do
|
472
578
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
473
|
-
dnf_package
|
474
|
-
|
475
|
-
|
579
|
+
dnf_package "chef_rpm >= 1.2" do
|
580
|
+
options default_options
|
581
|
+
action :install
|
582
|
+
end.should_not_be_updated
|
476
583
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
477
584
|
end
|
478
585
|
|
479
586
|
it "when it is met, it does nothing" do
|
480
587
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
481
|
-
dnf_package
|
482
|
-
|
483
|
-
|
588
|
+
dnf_package "chef_rpm >= 1.2" do
|
589
|
+
options default_options
|
590
|
+
action :install
|
591
|
+
end.should_not_be_updated
|
484
592
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
485
593
|
end
|
486
594
|
|
487
595
|
it "with nothing installed, it installs the latest version" do
|
488
596
|
flush_cache
|
489
|
-
dnf_package
|
490
|
-
|
491
|
-
|
597
|
+
dnf_package "chef_rpm > 1.2" do
|
598
|
+
options default_options
|
599
|
+
action :install
|
600
|
+
end.should_be_updated
|
492
601
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
493
|
-
dnf_package.
|
494
|
-
|
602
|
+
dnf_package "chef_rpm > 1.2" do
|
603
|
+
options default_options
|
604
|
+
action :install
|
605
|
+
end.should_not_be_updated
|
495
606
|
end
|
496
607
|
|
497
608
|
it "when it is not met by an installed rpm, it upgrades" do
|
498
609
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
499
|
-
dnf_package
|
500
|
-
|
501
|
-
|
610
|
+
dnf_package "chef_rpm > 1.2" do
|
611
|
+
options default_options
|
612
|
+
action :install
|
613
|
+
end.should_be_updated
|
502
614
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
503
|
-
dnf_package.
|
504
|
-
|
615
|
+
dnf_package "chef_rpm > 1.2" do
|
616
|
+
options default_options
|
617
|
+
action :install
|
618
|
+
end.should_not_be_updated
|
505
619
|
end
|
506
620
|
|
507
621
|
it "with an equality constraint, when it is not met by an installed rpm, it upgrades" do
|
508
622
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
509
|
-
dnf_package
|
510
|
-
|
511
|
-
|
623
|
+
dnf_package "chef_rpm = 1.10" do
|
624
|
+
options default_options
|
625
|
+
action :install
|
626
|
+
end.should_be_updated
|
512
627
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
513
|
-
dnf_package.
|
514
|
-
|
628
|
+
dnf_package "chef_rpm = 1.10" do
|
629
|
+
options default_options
|
630
|
+
action :install
|
631
|
+
end.should_not_be_updated
|
515
632
|
end
|
516
633
|
|
517
634
|
it "with an equality constraint, when it is met by an installed rpm, it does nothing" do
|
518
635
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
519
|
-
dnf_package
|
520
|
-
|
521
|
-
|
636
|
+
dnf_package "chef_rpm = 1.2" do
|
637
|
+
options default_options
|
638
|
+
action :install
|
639
|
+
end.should_not_be_updated
|
522
640
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
523
641
|
end
|
524
642
|
|
525
643
|
it "when it is met by an installed rpm, it does nothing" do
|
526
644
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
527
|
-
dnf_package
|
528
|
-
|
529
|
-
|
645
|
+
dnf_package "chef_rpm > 1.2" do
|
646
|
+
options default_options
|
647
|
+
action :install
|
648
|
+
end.should_not_be_updated
|
530
649
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
531
650
|
end
|
532
651
|
|
533
652
|
it "when there is no solution to the contraint" do
|
534
653
|
flush_cache
|
535
|
-
|
536
|
-
|
654
|
+
expect {
|
655
|
+
dnf_package "chef_rpm > 2.0"
|
656
|
+
}.to raise_error(Chef::Exceptions::Package, /No candidate version available/)
|
537
657
|
end
|
538
658
|
|
539
659
|
it "when there is no solution to the contraint but an rpm is preinstalled" do
|
540
660
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
541
|
-
|
542
|
-
|
661
|
+
expect {
|
662
|
+
dnf_package "chef_rpm > 2.0"
|
663
|
+
}.to raise_error(Chef::Exceptions::Package, /No candidate version available/)
|
543
664
|
end
|
544
665
|
|
545
666
|
it "with a less than constraint, when nothing is installed, it installs" do
|
546
667
|
flush_cache
|
547
|
-
dnf_package
|
548
|
-
|
549
|
-
|
668
|
+
dnf_package "chef_rpm < 1.10" do
|
669
|
+
options default_options
|
670
|
+
action :install
|
671
|
+
end.should_be_updated
|
550
672
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
551
|
-
dnf_package.
|
552
|
-
|
673
|
+
dnf_package "chef_rpm < 1.10" do
|
674
|
+
options default_options
|
675
|
+
action :install
|
676
|
+
end.should_not_be_updated
|
553
677
|
end
|
554
678
|
|
555
679
|
it "with a less than constraint, when the install version matches, it does nothing" do
|
556
680
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
557
|
-
dnf_package
|
558
|
-
|
559
|
-
|
681
|
+
dnf_package "chef_rpm < 1.10" do
|
682
|
+
options default_options
|
683
|
+
action :install
|
684
|
+
end.should_not_be_updated
|
560
685
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
561
686
|
end
|
562
687
|
|
563
688
|
it "with a less than constraint, when the install version fails, it should downgrade" do
|
564
689
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
565
|
-
dnf_package
|
566
|
-
|
567
|
-
|
690
|
+
dnf_package "chef_rpm < 1.10" do
|
691
|
+
options default_options
|
692
|
+
action :install
|
693
|
+
end.should_be_updated
|
568
694
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
569
|
-
dnf_package.
|
570
|
-
|
695
|
+
dnf_package "chef_rpm < 1.10" do
|
696
|
+
options default_options
|
697
|
+
action :install
|
698
|
+
end.should_not_be_updated
|
571
699
|
end
|
572
700
|
end
|
573
701
|
|
574
702
|
context "with source arguments" do
|
575
703
|
it "raises an exception when the package does not exist" do
|
576
704
|
flush_cache
|
577
|
-
|
578
|
-
|
705
|
+
expect {
|
706
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/this-file-better-not-exist.rpm"
|
707
|
+
}.to raise_error(Chef::Exceptions::Package, /No candidate version available/)
|
579
708
|
end
|
580
709
|
|
581
710
|
it "does not raise a hard exception in why-run mode when the package does not exist" do
|
582
711
|
Chef::Config[:why_run] = true
|
583
712
|
flush_cache
|
584
|
-
dnf_package
|
585
|
-
|
586
|
-
|
713
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/this-file-better-not-exist.rpm" do
|
714
|
+
options default_options
|
715
|
+
action :install
|
716
|
+
end
|
587
717
|
end
|
588
718
|
|
589
719
|
it "installs the package when using the source argument" do
|
590
720
|
flush_cache
|
591
|
-
dnf_package
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
721
|
+
dnf_package "something" do
|
722
|
+
source("#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
723
|
+
options default_options
|
724
|
+
package_name "somethingelse"
|
725
|
+
name "something"
|
726
|
+
action :install
|
727
|
+
end.should_be_updated
|
596
728
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
597
|
-
dnf_package
|
598
|
-
|
729
|
+
dnf_package "something" do
|
730
|
+
source("#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
731
|
+
options default_options
|
732
|
+
package_name "somethingelse"
|
733
|
+
name "something"
|
734
|
+
action :install
|
735
|
+
end.should_not_be_updated
|
599
736
|
end
|
600
737
|
|
601
738
|
it "installs the package when the name is a path to a file" do
|
602
739
|
flush_cache
|
603
|
-
dnf_package
|
604
|
-
|
605
|
-
|
740
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do
|
741
|
+
options default_options
|
742
|
+
action :install
|
743
|
+
end.should_be_updated
|
606
744
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
607
|
-
dnf_package.
|
608
|
-
|
745
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do
|
746
|
+
options default_options
|
747
|
+
action :install
|
748
|
+
end.should_not_be_updated
|
609
749
|
end
|
610
750
|
|
611
751
|
it "downgrade on a local file with allow_downgrade true works" do
|
612
752
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
613
|
-
dnf_package
|
614
|
-
|
615
|
-
|
616
|
-
|
753
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do
|
754
|
+
options default_options
|
755
|
+
version "1.2-1"
|
756
|
+
action :install
|
757
|
+
end.should_be_updated
|
617
758
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
618
|
-
dnf_package.
|
619
|
-
|
759
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do
|
760
|
+
options default_options
|
761
|
+
version "1.2-1"
|
762
|
+
action :install
|
763
|
+
end.should_not_be_updated
|
620
764
|
end
|
621
765
|
|
622
766
|
it "does not downgrade the package with :install" do
|
623
767
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
624
|
-
dnf_package
|
625
|
-
|
626
|
-
|
768
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do
|
769
|
+
options default_options
|
770
|
+
action :install
|
771
|
+
end.should_not_be_updated
|
627
772
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
628
773
|
end
|
629
774
|
|
630
775
|
it "does not upgrade the package with :install" do
|
631
776
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
632
|
-
dnf_package
|
633
|
-
|
634
|
-
|
777
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.10-1.#{pkg_arch}.rpm" do
|
778
|
+
options default_options
|
779
|
+
action :install
|
780
|
+
end.should_not_be_updated
|
635
781
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
636
782
|
end
|
637
783
|
|
638
784
|
it "is idempotent when the package is already installed" do
|
639
785
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
640
|
-
dnf_package
|
641
|
-
|
642
|
-
|
786
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do
|
787
|
+
options default_options
|
788
|
+
action :install
|
789
|
+
end.should_not_be_updated
|
643
790
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
644
791
|
end
|
645
792
|
|
646
793
|
it "is idempotent when the package is already installed and there is a version string" do
|
647
794
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
648
|
-
dnf_package
|
649
|
-
|
650
|
-
|
651
|
-
|
795
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do
|
796
|
+
options default_options
|
797
|
+
version "1.2-1"
|
798
|
+
action :install
|
799
|
+
end.should_not_be_updated
|
652
800
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
653
801
|
end
|
654
802
|
end
|
@@ -657,142 +805,183 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
657
805
|
it "works when a package is installed" do
|
658
806
|
FileUtils.rm_f "/etc/yum.repos.d/chef-dnf-localtesting.repo"
|
659
807
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
660
|
-
dnf_package
|
661
|
-
|
808
|
+
dnf_package "chef_rpm" do
|
809
|
+
options "--nogpgcheck --disablerepo=*"
|
810
|
+
action :install
|
811
|
+
end.should_not_be_updated
|
662
812
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
663
813
|
end
|
664
814
|
|
665
815
|
it "works with a local source" do
|
666
816
|
FileUtils.rm_f "/etc/yum.repos.d/chef-dnf-localtesting.repo"
|
667
817
|
flush_cache
|
668
|
-
dnf_package
|
669
|
-
|
670
|
-
|
818
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do
|
819
|
+
options "--nogpgcheck --disablerepo=*"
|
820
|
+
action :install
|
821
|
+
end.should_be_updated
|
671
822
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
672
|
-
dnf_package.
|
673
|
-
|
823
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do
|
824
|
+
options "--nogpgcheck --disablerepo=*"
|
825
|
+
action :install
|
826
|
+
end.should_not_be_updated
|
674
827
|
end
|
675
828
|
end
|
676
829
|
|
677
830
|
context "multipackage with arches", :intel_64bit do
|
678
831
|
it "installs two rpms" do
|
679
832
|
flush_cache
|
680
|
-
dnf_package
|
681
|
-
|
682
|
-
|
833
|
+
dnf_package [ "chef_rpm.#{pkg_arch}", "chef_rpm.i686" ] do
|
834
|
+
options default_options
|
835
|
+
action :install
|
836
|
+
end.should_be_updated
|
683
837
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.#{pkg_arch}$/)
|
684
838
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.i686$/)
|
685
|
-
dnf_package.
|
686
|
-
|
839
|
+
dnf_package [ "chef_rpm.#{pkg_arch}", "chef_rpm.i686" ] do
|
840
|
+
options default_options
|
841
|
+
action :install
|
842
|
+
end.should_not_be_updated
|
687
843
|
end
|
688
844
|
|
689
845
|
it "does nothing if both are installed" do
|
690
846
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm", "chef_rpm-1.10-1.i686.rpm")
|
691
847
|
flush_cache
|
692
|
-
dnf_package
|
693
|
-
|
694
|
-
|
848
|
+
dnf_package [ "chef_rpm.#{pkg_arch}", "chef_rpm.i686" ] do
|
849
|
+
options default_options
|
850
|
+
action :install
|
851
|
+
end.should_not_be_updated
|
695
852
|
end
|
696
853
|
|
697
854
|
it "installs the second rpm if the first is installed" do
|
698
855
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
699
|
-
dnf_package
|
700
|
-
|
701
|
-
|
856
|
+
dnf_package [ "chef_rpm.#{pkg_arch}", "chef_rpm.i686" ] do
|
857
|
+
options default_options
|
858
|
+
action :install
|
859
|
+
end.should_be_updated
|
702
860
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.#{pkg_arch}$/)
|
703
861
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.i686$/)
|
704
|
-
dnf_package.
|
705
|
-
|
862
|
+
dnf_package [ "chef_rpm.#{pkg_arch}", "chef_rpm.i686" ] do
|
863
|
+
options default_options
|
864
|
+
action :install
|
865
|
+
end.should_not_be_updated
|
706
866
|
end
|
707
867
|
|
708
868
|
it "installs the first rpm if the second is installed" do
|
709
869
|
preinstall("chef_rpm-1.10-1.i686.rpm")
|
710
|
-
dnf_package
|
711
|
-
|
712
|
-
|
870
|
+
dnf_package [ "chef_rpm.#{pkg_arch}", "chef_rpm.i686" ] do
|
871
|
+
options default_options
|
872
|
+
action :install
|
873
|
+
end.should_be_updated
|
713
874
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.#{pkg_arch}$/)
|
714
875
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.i686$/)
|
715
|
-
dnf_package.
|
716
|
-
|
876
|
+
dnf_package [ "chef_rpm.#{pkg_arch}", "chef_rpm.i686" ] do
|
877
|
+
options default_options
|
878
|
+
action :install
|
879
|
+
end.should_not_be_updated
|
717
880
|
end
|
718
881
|
|
719
882
|
# unlikely to work consistently correct, okay to deprecate the arch-array in favor of the arch in the name
|
720
883
|
it "installs two rpms with multi-arch" do
|
721
884
|
flush_cache
|
722
|
-
dnf_package
|
723
|
-
|
724
|
-
|
725
|
-
|
885
|
+
dnf_package %w{chef_rpm chef_rpm} do
|
886
|
+
options default_options
|
887
|
+
arch [pkg_arch, "i686"]
|
888
|
+
action :install
|
889
|
+
end.should_be_updated
|
726
890
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.#{pkg_arch}$/)
|
727
891
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.i686$/)
|
728
|
-
dnf_package
|
729
|
-
|
892
|
+
dnf_package %w{chef_rpm chef_rpm} do
|
893
|
+
options default_options
|
894
|
+
arch [pkg_arch, "i686"]
|
895
|
+
action :install
|
896
|
+
end.should_not_be_updated
|
730
897
|
end
|
731
898
|
|
732
899
|
# unlikely to work consistently correct, okay to deprecate the arch-array in favor of the arch in the name
|
733
900
|
it "installs the second rpm if the first is installed (muti-arch)" do
|
734
901
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
735
|
-
dnf_package
|
736
|
-
|
737
|
-
|
738
|
-
|
902
|
+
dnf_package %w{chef_rpm chef_rpm} do
|
903
|
+
options default_options
|
904
|
+
arch [pkg_arch, "i686"]
|
905
|
+
action :install
|
906
|
+
end.should_be_updated
|
739
907
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.#{pkg_arch}$/)
|
740
908
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.i686$/)
|
741
|
-
dnf_package
|
742
|
-
|
909
|
+
dnf_package %w{chef_rpm chef_rpm} do
|
910
|
+
options default_options
|
911
|
+
action :install
|
912
|
+
end.should_not_be_updated
|
743
913
|
end
|
744
914
|
|
745
915
|
# unlikely to work consistently correct, okay to deprecate the arch-array in favor of the arch in the name
|
746
916
|
it "installs the first rpm if the second is installed (muti-arch)" do
|
747
917
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
748
|
-
dnf_package
|
749
|
-
|
750
|
-
|
751
|
-
|
918
|
+
dnf_package %w{chef_rpm chef_rpm} do
|
919
|
+
options default_options
|
920
|
+
arch [pkg_arch, "i686"]
|
921
|
+
action :install
|
922
|
+
end.should_be_updated
|
752
923
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.#{pkg_arch}$/)
|
753
924
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.i686$/)
|
754
|
-
dnf_package
|
755
|
-
|
925
|
+
dnf_package %w{chef_rpm chef_rpm} do
|
926
|
+
options default_options
|
927
|
+
action :install
|
928
|
+
end.should_not_be_updated
|
756
929
|
end
|
757
930
|
|
758
931
|
# unlikely to work consistently correct, okay to deprecate the arch-array in favor of the arch in the name
|
759
932
|
it "does nothing if both are installed (muti-arch)" do
|
760
933
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm", "chef_rpm-1.10-1.i686.rpm")
|
761
|
-
dnf_package
|
762
|
-
|
763
|
-
|
764
|
-
|
934
|
+
dnf_package %w{chef_rpm chef_rpm} do
|
935
|
+
options default_options
|
936
|
+
arch [pkg_arch, "i686"]
|
937
|
+
action :install
|
938
|
+
end.should_not_be_updated
|
765
939
|
end
|
766
940
|
end
|
767
941
|
|
768
942
|
context "repo controls" do
|
769
943
|
it "should fail with the repo disabled" do
|
770
944
|
flush_cache
|
771
|
-
|
772
|
-
|
945
|
+
expect {
|
946
|
+
dnf_package "chef_rpm" do
|
947
|
+
options "--nogpgcheck --disablerepo=chef-dnf-localtesting"
|
948
|
+
action :install
|
949
|
+
end
|
950
|
+
}.to raise_error(Chef::Exceptions::Package, /No candidate version available/)
|
773
951
|
end
|
774
952
|
|
775
953
|
it "should work with disablerepo first" do
|
776
954
|
flush_cache
|
777
|
-
dnf_package
|
778
|
-
|
779
|
-
|
955
|
+
dnf_package "chef_rpm" do
|
956
|
+
options ["--nogpgcheck", "--disablerepo=*", "--enablerepo=chef-dnf-localtesting"]
|
957
|
+
action :install
|
958
|
+
end.should_be_updated
|
780
959
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
781
|
-
dnf_package
|
782
|
-
|
960
|
+
dnf_package "chef_rpm" do
|
961
|
+
options ["--nogpgcheck", "--disablerepo=*", "--enablerepo=chef-dnf-localtesting"]
|
962
|
+
action :install
|
963
|
+
end.should_not_be_updated
|
783
964
|
end
|
784
965
|
|
785
966
|
it "should work to enable a disabled repo" do
|
786
967
|
shell_out!("dnf config-manager --set-disabled chef-dnf-localtesting")
|
787
968
|
flush_cache
|
788
|
-
expect {
|
969
|
+
expect {
|
970
|
+
dnf_package "chef_rpm" do
|
971
|
+
options "--nogpgcheck"
|
972
|
+
action :install
|
973
|
+
end
|
974
|
+
}.to raise_error(Chef::Exceptions::Package, /No candidate version available/)
|
789
975
|
flush_cache
|
790
|
-
dnf_package
|
791
|
-
|
792
|
-
|
976
|
+
dnf_package "chef_rpm" do
|
977
|
+
options "--nogpgcheck --enablerepo=chef-dnf-localtesting"
|
978
|
+
action :install
|
979
|
+
end.should_be_updated
|
793
980
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
794
|
-
dnf_package
|
795
|
-
|
981
|
+
dnf_package "chef_rpm" do
|
982
|
+
options "--nogpgcheck --enablerepo=chef-dnf-localtesting"
|
983
|
+
action :install
|
984
|
+
end.should_not_be_updated
|
796
985
|
end
|
797
986
|
|
798
987
|
it "when an idempotent install action is run, does not leave repos disabled" do
|
@@ -802,19 +991,22 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
802
991
|
# accomplishes both those goals (it would be easier if we had other rpms in this repo, but with
|
803
992
|
# one rpm we need to do this).
|
804
993
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
805
|
-
dnf_package
|
806
|
-
|
807
|
-
|
994
|
+
dnf_package "chef_rpm" do
|
995
|
+
options "--nogpgcheck --disablerepo=chef-dnf-localtesting"
|
996
|
+
action :upgrade
|
997
|
+
end.should_not_be_updated
|
808
998
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
809
999
|
# now we're still using the same cache in the dnf_helper.py cache and we test to see if the
|
810
1000
|
# repo that we temporarily disabled is enabled on this pass.
|
811
|
-
dnf_package
|
812
|
-
|
813
|
-
|
814
|
-
|
1001
|
+
dnf_package "chef_rpm-1.10-1.#{pkg_arch}" do
|
1002
|
+
options "--nogpgcheck"
|
1003
|
+
action :install
|
1004
|
+
end.should_be_updated
|
815
1005
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
816
|
-
dnf_package.
|
817
|
-
|
1006
|
+
dnf_package "chef_rpm-1.10-1.#{pkg_arch}" do
|
1007
|
+
options "--nogpgcheck"
|
1008
|
+
action :install
|
1009
|
+
end.should_not_be_updated
|
818
1010
|
end
|
819
1011
|
end
|
820
1012
|
end
|
@@ -823,76 +1015,102 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
823
1015
|
context "downgrades" do
|
824
1016
|
it "just work with DNF" do
|
825
1017
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
826
|
-
dnf_package
|
827
|
-
|
828
|
-
|
1018
|
+
dnf_package "chef_rpm" do
|
1019
|
+
options default_options
|
1020
|
+
version "1.2"
|
1021
|
+
action :install
|
1022
|
+
end.should_be_updated
|
829
1023
|
expect(shell_out("rpm -q chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}")
|
830
|
-
dnf_package
|
831
|
-
|
1024
|
+
dnf_package "chef_rpm" do
|
1025
|
+
options default_options
|
1026
|
+
version "1.2"
|
1027
|
+
action :install
|
1028
|
+
end.should_not_be_updated
|
832
1029
|
end
|
833
1030
|
|
834
1031
|
it "throws a deprecation warning with allow_downgrade" do
|
835
1032
|
Chef::Config[:treat_deprecation_warnings_as_errors] = false
|
836
|
-
expect(Chef).to receive(:deprecated).with(:dnf_package_allow_downgrade, /^the allow_downgrade property on the dnf_package provider is not used/)
|
1033
|
+
expect(Chef).to receive(:deprecated).at_least(:once).with(:dnf_package_allow_downgrade, /^the allow_downgrade property on the dnf_package provider is not used/)
|
837
1034
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
838
|
-
dnf_package
|
839
|
-
|
840
|
-
|
841
|
-
|
1035
|
+
dnf_package "chef_rpm" do
|
1036
|
+
options default_options
|
1037
|
+
version "1.2"
|
1038
|
+
allow_downgrade true
|
1039
|
+
action :install
|
1040
|
+
end.should_be_updated
|
842
1041
|
expect(shell_out("rpm -q chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}")
|
843
|
-
dnf_package
|
844
|
-
|
1042
|
+
dnf_package "chef_rpm" do
|
1043
|
+
options default_options
|
1044
|
+
version "1.2"
|
1045
|
+
allow_downgrade true
|
1046
|
+
action :install
|
1047
|
+
end.should_not_be_updated
|
845
1048
|
end
|
846
1049
|
end
|
847
1050
|
|
848
1051
|
context "with source arguments" do
|
849
1052
|
it "installs the package when using the source argument" do
|
850
1053
|
flush_cache
|
851
|
-
dnf_package
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
1054
|
+
dnf_package "something" do
|
1055
|
+
options default_options
|
1056
|
+
package_name "somethingelse"
|
1057
|
+
source("#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
1058
|
+
action :upgrade
|
1059
|
+
end.should_be_updated
|
856
1060
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
857
|
-
dnf_package
|
858
|
-
|
1061
|
+
dnf_package "something" do
|
1062
|
+
options default_options
|
1063
|
+
package_name "somethingelse"
|
1064
|
+
source("#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
1065
|
+
action :upgrade
|
1066
|
+
end.should_not_be_updated
|
859
1067
|
end
|
860
1068
|
|
861
1069
|
it "installs the package when the name is a path to a file" do
|
862
1070
|
flush_cache
|
863
|
-
dnf_package
|
864
|
-
|
865
|
-
|
1071
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do
|
1072
|
+
options default_options
|
1073
|
+
action :upgrade
|
1074
|
+
end.should_be_updated
|
866
1075
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
867
|
-
dnf_package.
|
868
|
-
|
1076
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do
|
1077
|
+
options default_options
|
1078
|
+
action :upgrade
|
1079
|
+
end.should_not_be_updated
|
869
1080
|
end
|
870
1081
|
|
871
1082
|
it "downgrades the package when allow_downgrade is true" do
|
872
1083
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
873
|
-
dnf_package
|
874
|
-
|
875
|
-
|
1084
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do
|
1085
|
+
options default_options
|
1086
|
+
action :upgrade
|
1087
|
+
end.should_be_updated
|
876
1088
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
877
|
-
dnf_package.
|
878
|
-
|
1089
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do
|
1090
|
+
options default_options
|
1091
|
+
action :upgrade
|
1092
|
+
end.should_not_be_updated
|
879
1093
|
end
|
880
1094
|
|
881
1095
|
it "upgrades the package" do
|
882
1096
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
883
|
-
dnf_package
|
884
|
-
|
885
|
-
|
1097
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.10-1.#{pkg_arch}.rpm" do
|
1098
|
+
options default_options
|
1099
|
+
action :upgrade
|
1100
|
+
end.should_be_updated
|
886
1101
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
887
|
-
dnf_package.
|
888
|
-
|
1102
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.10-1.#{pkg_arch}.rpm" do
|
1103
|
+
options default_options
|
1104
|
+
action :upgrade
|
1105
|
+
end.should_not_be_updated
|
889
1106
|
end
|
890
1107
|
|
891
1108
|
it "is idempotent when the package is already installed" do
|
892
1109
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
893
|
-
dnf_package
|
894
|
-
|
895
|
-
|
1110
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do
|
1111
|
+
options default_options
|
1112
|
+
action :upgrade
|
1113
|
+
end.should_not_be_updated
|
896
1114
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
897
1115
|
end
|
898
1116
|
end
|
@@ -901,295 +1119,382 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
901
1119
|
it "works when a package is installed" do
|
902
1120
|
FileUtils.rm_f "/etc/yum.repos.d/chef-dnf-localtesting.repo"
|
903
1121
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
904
|
-
dnf_package
|
905
|
-
|
906
|
-
|
1122
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do
|
1123
|
+
options "--nogpgcheck --disablerepo=*"
|
1124
|
+
action :upgrade
|
1125
|
+
end.should_not_be_updated
|
907
1126
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
908
1127
|
end
|
909
1128
|
|
910
1129
|
it "works with a local source" do
|
911
1130
|
FileUtils.rm_f "/etc/yum.repos.d/chef-dnf-localtesting.repo"
|
912
1131
|
flush_cache
|
913
|
-
dnf_package
|
914
|
-
|
915
|
-
|
1132
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do
|
1133
|
+
options "--nogpgcheck --disablerepo=*"
|
1134
|
+
action :upgrade
|
1135
|
+
end.should_be_updated
|
916
1136
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
917
|
-
dnf_package.
|
918
|
-
|
1137
|
+
dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do
|
1138
|
+
options default_options
|
1139
|
+
action :upgrade
|
1140
|
+
end.should_not_be_updated
|
919
1141
|
end
|
920
1142
|
end
|
921
1143
|
|
922
1144
|
context "version pinning" do
|
923
1145
|
it "with a full version pin it installs a later package" do
|
924
1146
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
925
|
-
dnf_package
|
926
|
-
|
927
|
-
|
928
|
-
|
1147
|
+
dnf_package "chef_rpm" do
|
1148
|
+
options default_options
|
1149
|
+
version "1.10-1"
|
1150
|
+
action :upgrade
|
1151
|
+
end.should_be_updated
|
929
1152
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
930
|
-
dnf_package
|
931
|
-
|
1153
|
+
dnf_package "chef_rpm" do
|
1154
|
+
options default_options
|
1155
|
+
version "1.10-1"
|
1156
|
+
action :upgrade
|
1157
|
+
end.should_not_be_updated
|
932
1158
|
end
|
933
1159
|
|
934
1160
|
it "with a full version pin in the name it downgrades the package" do
|
935
1161
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
936
|
-
dnf_package
|
937
|
-
|
938
|
-
|
939
|
-
|
1162
|
+
dnf_package "chef_rpm" do
|
1163
|
+
options default_options
|
1164
|
+
version "1.2-1"
|
1165
|
+
action :upgrade
|
1166
|
+
end.should_be_updated
|
940
1167
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
941
|
-
dnf_package
|
942
|
-
|
1168
|
+
dnf_package "chef_rpm" do
|
1169
|
+
options default_options
|
1170
|
+
version "1.2-1"
|
1171
|
+
action :upgrade
|
1172
|
+
end.should_not_be_updated
|
943
1173
|
end
|
944
1174
|
|
945
1175
|
it "with a partial (no release) version pin it installs a later package" do
|
946
1176
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
947
|
-
dnf_package
|
948
|
-
|
949
|
-
|
950
|
-
|
1177
|
+
dnf_package "chef_rpm" do
|
1178
|
+
options default_options
|
1179
|
+
version "1.10"
|
1180
|
+
action :upgrade
|
1181
|
+
end.should_be_updated
|
951
1182
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
952
|
-
dnf_package
|
953
|
-
|
1183
|
+
dnf_package "chef_rpm" do
|
1184
|
+
options default_options
|
1185
|
+
version "1.10"
|
1186
|
+
action :upgrade
|
1187
|
+
end.should_not_be_updated
|
954
1188
|
end
|
955
1189
|
|
956
1190
|
it "with a partial (no release) version pin in the name it downgrades the package" do
|
957
1191
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
958
|
-
dnf_package
|
959
|
-
|
960
|
-
|
961
|
-
|
1192
|
+
dnf_package "chef_rpm" do
|
1193
|
+
options default_options
|
1194
|
+
version("1.2")
|
1195
|
+
action :upgrade
|
1196
|
+
end.should_be_updated
|
962
1197
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
963
|
-
dnf_package
|
964
|
-
|
1198
|
+
dnf_package "chef_rpm" do
|
1199
|
+
options default_options
|
1200
|
+
version("1.2")
|
1201
|
+
action :upgrade
|
1202
|
+
end.should_not_be_updated
|
965
1203
|
end
|
966
1204
|
|
967
1205
|
it "with a full version pin it installs a later package" do
|
968
1206
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
969
|
-
dnf_package
|
970
|
-
|
971
|
-
|
1207
|
+
dnf_package "chef_rpm-1.10-1" do
|
1208
|
+
options default_options
|
1209
|
+
action :upgrade
|
1210
|
+
end.should_be_updated
|
972
1211
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
973
|
-
dnf_package.
|
974
|
-
|
1212
|
+
dnf_package "chef_rpm-1.10-1" do
|
1213
|
+
options default_options
|
1214
|
+
action :upgrade
|
1215
|
+
end.should_not_be_updated
|
975
1216
|
end
|
976
1217
|
|
977
1218
|
it "with a full version pin in the name it downgrades the package" do
|
978
1219
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
979
|
-
dnf_package
|
980
|
-
|
981
|
-
|
1220
|
+
dnf_package "chef_rpm-1.2-1" do
|
1221
|
+
options default_options
|
1222
|
+
action :upgrade
|
1223
|
+
end.should_be_updated
|
982
1224
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
983
|
-
dnf_package.
|
984
|
-
|
1225
|
+
dnf_package "chef_rpm-1.2-1" do
|
1226
|
+
options default_options
|
1227
|
+
action :upgrade
|
1228
|
+
end.should_not_be_updated
|
985
1229
|
end
|
986
1230
|
|
987
1231
|
it "with a partial (no release) version pin it installs a later package" do
|
988
1232
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
989
|
-
dnf_package
|
990
|
-
|
991
|
-
|
1233
|
+
dnf_package "chef_rpm-1.10" do
|
1234
|
+
options default_options
|
1235
|
+
action :upgrade
|
1236
|
+
end.should_be_updated
|
992
1237
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
993
|
-
dnf_package.
|
994
|
-
|
1238
|
+
dnf_package "chef_rpm-1.10" do
|
1239
|
+
options default_options
|
1240
|
+
action :upgrade
|
1241
|
+
end.should_not_be_updated
|
995
1242
|
end
|
996
1243
|
|
997
1244
|
it "with a partial (no release) version pin in the name it downgrades the package" do
|
998
1245
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
999
|
-
dnf_package
|
1000
|
-
|
1001
|
-
|
1246
|
+
dnf_package "chef_rpm-1.2" do
|
1247
|
+
options default_options
|
1248
|
+
action :upgrade
|
1249
|
+
end.should_be_updated
|
1002
1250
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
1003
|
-
dnf_package.
|
1004
|
-
|
1251
|
+
dnf_package "chef_rpm-1.2" do
|
1252
|
+
options default_options
|
1253
|
+
action :upgrade
|
1254
|
+
end.should_not_be_updated
|
1005
1255
|
end
|
1006
1256
|
|
1007
1257
|
it "with a prco equality pin in the name it upgrades a prior package" do
|
1008
1258
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
1009
|
-
dnf_package
|
1010
|
-
|
1011
|
-
|
1259
|
+
dnf_package "chef_rpm = 1.10" do
|
1260
|
+
options default_options
|
1261
|
+
action :upgrade
|
1262
|
+
end.should_be_updated
|
1012
1263
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
1013
|
-
dnf_package.
|
1014
|
-
|
1264
|
+
dnf_package "chef_rpm = 1.10" do
|
1265
|
+
options default_options
|
1266
|
+
action :upgrade
|
1267
|
+
end.should_not_be_updated
|
1015
1268
|
end
|
1016
1269
|
|
1017
1270
|
it "with a prco equality pin in the name it downgrades a later package" do
|
1018
1271
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
1019
|
-
dnf_package
|
1020
|
-
|
1021
|
-
|
1272
|
+
dnf_package "chef_rpm = 1.2" do
|
1273
|
+
options default_options
|
1274
|
+
action :upgrade
|
1275
|
+
end.should_be_updated
|
1022
1276
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
1023
|
-
dnf_package.
|
1024
|
-
|
1277
|
+
dnf_package "chef_rpm = 1.2" do
|
1278
|
+
options default_options
|
1279
|
+
action :upgrade
|
1280
|
+
end.should_not_be_updated
|
1025
1281
|
end
|
1026
1282
|
|
1027
1283
|
it "with a > pin in the name and no rpm installed it installs" do
|
1028
1284
|
flush_cache
|
1029
|
-
dnf_package
|
1030
|
-
|
1031
|
-
|
1285
|
+
dnf_package "chef_rpm > 1.2" do
|
1286
|
+
options default_options
|
1287
|
+
action :upgrade
|
1288
|
+
end.should_be_updated
|
1032
1289
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
1033
|
-
dnf_package.
|
1034
|
-
|
1290
|
+
dnf_package "chef_rpm > 1.2" do
|
1291
|
+
options default_options
|
1292
|
+
action :upgrade
|
1293
|
+
end.should_not_be_updated
|
1035
1294
|
end
|
1036
1295
|
|
1037
1296
|
it "with a < pin in the name and no rpm installed it installs" do
|
1038
1297
|
flush_cache
|
1039
|
-
dnf_package
|
1040
|
-
|
1041
|
-
|
1298
|
+
dnf_package "chef_rpm < 1.10" do
|
1299
|
+
options default_options
|
1300
|
+
action :upgrade
|
1301
|
+
end.should_be_updated
|
1042
1302
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
1043
|
-
dnf_package.
|
1044
|
-
|
1303
|
+
dnf_package "chef_rpm < 1.10" do
|
1304
|
+
options default_options
|
1305
|
+
action :upgrade
|
1306
|
+
end.should_not_be_updated
|
1045
1307
|
end
|
1046
1308
|
|
1047
1309
|
it "with a > pin in the name and matching rpm installed it does nothing" do
|
1048
1310
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
1049
|
-
dnf_package
|
1050
|
-
|
1051
|
-
|
1311
|
+
dnf_package "chef_rpm > 1.2" do
|
1312
|
+
options default_options
|
1313
|
+
action :upgrade
|
1314
|
+
end.should_not_be_updated
|
1052
1315
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
1053
1316
|
end
|
1054
1317
|
|
1055
1318
|
it "with a < pin in the name and no rpm installed it installs" do
|
1056
1319
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
1057
|
-
dnf_package
|
1058
|
-
|
1059
|
-
|
1320
|
+
dnf_package "chef_rpm < 1.10" do
|
1321
|
+
options default_options
|
1322
|
+
action :upgrade
|
1323
|
+
end.should_not_be_updated
|
1060
1324
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
1061
1325
|
end
|
1062
1326
|
|
1063
1327
|
it "with a > pin in the name and non-matching rpm installed it upgrades" do
|
1064
1328
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
1065
|
-
dnf_package
|
1066
|
-
|
1067
|
-
|
1329
|
+
dnf_package "chef_rpm > 1.2" do
|
1330
|
+
options default_options
|
1331
|
+
action :upgrade
|
1332
|
+
end.should_be_updated
|
1068
1333
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
1069
|
-
dnf_package.
|
1070
|
-
|
1334
|
+
dnf_package "chef_rpm > 1.2" do
|
1335
|
+
options default_options
|
1336
|
+
action :upgrade
|
1337
|
+
end.should_not_be_updated
|
1071
1338
|
end
|
1072
1339
|
|
1073
1340
|
it "with a < pin in the name and non-matching rpm installed it downgrades" do
|
1074
1341
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
1075
|
-
dnf_package
|
1076
|
-
|
1077
|
-
|
1342
|
+
dnf_package "chef_rpm < 1.10" do
|
1343
|
+
options default_options
|
1344
|
+
action :upgrade
|
1345
|
+
end.should_be_updated
|
1078
1346
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
1079
|
-
dnf_package.
|
1080
|
-
|
1347
|
+
dnf_package "chef_rpm < 1.10" do
|
1348
|
+
options default_options
|
1349
|
+
action :upgrade
|
1350
|
+
end.should_not_be_updated
|
1081
1351
|
end
|
1082
1352
|
end
|
1083
1353
|
end
|
1084
1354
|
|
1085
1355
|
describe ":remove" do
|
1086
1356
|
context "vanilla use case" do
|
1087
|
-
let(:package_name) { "chef_rpm" }
|
1088
1357
|
it "does nothing if the package is not installed" do
|
1089
1358
|
flush_cache
|
1090
|
-
dnf_package
|
1091
|
-
|
1359
|
+
dnf_package "chef_rpm" do
|
1360
|
+
options default_options
|
1361
|
+
action :remove
|
1362
|
+
end.should_not_be_updated
|
1092
1363
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^package chef_rpm is not installed$")
|
1093
1364
|
end
|
1094
1365
|
|
1095
1366
|
it "removes the package if the package is installed" do
|
1096
1367
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
1097
|
-
dnf_package
|
1098
|
-
|
1368
|
+
dnf_package "chef_rpm" do
|
1369
|
+
options default_options
|
1370
|
+
action :remove
|
1371
|
+
end.should_be_updated
|
1099
1372
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^package chef_rpm is not installed$")
|
1100
1373
|
end
|
1101
1374
|
|
1102
1375
|
it "does not remove the package twice" do
|
1103
1376
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
1104
|
-
dnf_package
|
1105
|
-
|
1377
|
+
dnf_package "chef_rpm" do
|
1378
|
+
options default_options
|
1379
|
+
action :remove
|
1380
|
+
end.should_be_updated
|
1106
1381
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^package chef_rpm is not installed$")
|
1107
|
-
dnf_package
|
1108
|
-
|
1382
|
+
dnf_package "chef_rpm" do
|
1383
|
+
options default_options
|
1384
|
+
action :remove
|
1385
|
+
end.should_not_be_updated
|
1109
1386
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^package chef_rpm is not installed$")
|
1110
1387
|
end
|
1111
1388
|
|
1112
1389
|
it "removes the package if the prior version package is installed" do
|
1113
1390
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
1114
|
-
dnf_package
|
1115
|
-
|
1391
|
+
dnf_package "chef_rpm" do
|
1392
|
+
options default_options
|
1393
|
+
action :remove
|
1394
|
+
end.should_be_updated
|
1116
1395
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^package chef_rpm is not installed$")
|
1117
|
-
dnf_package
|
1118
|
-
|
1396
|
+
dnf_package "chef_rpm" do
|
1397
|
+
options default_options
|
1398
|
+
action :remove
|
1399
|
+
end.should_not_be_updated
|
1119
1400
|
end
|
1120
1401
|
|
1121
1402
|
it "removes the package if the i686 package is installed", :intel_64bit do
|
1122
1403
|
skip "FIXME: should this be fixed or is the current behavior correct?"
|
1123
1404
|
preinstall("chef_rpm-1.10-1.i686.rpm")
|
1124
|
-
dnf_package
|
1125
|
-
|
1405
|
+
dnf_package "chef_rpm" do
|
1406
|
+
options default_options
|
1407
|
+
action :remove
|
1408
|
+
end.should_be_updated
|
1126
1409
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^package chef_rpm is not installed$")
|
1127
|
-
dnf_package
|
1128
|
-
|
1410
|
+
dnf_package "chef_rpm" do
|
1411
|
+
options default_options
|
1412
|
+
action :remove
|
1413
|
+
end.should_not_be_updated
|
1129
1414
|
end
|
1130
1415
|
|
1131
1416
|
it "removes the package if the prior version i686 package is installed", :intel_64bit do
|
1132
1417
|
skip "FIXME: should this be fixed or is the current behavior correct?"
|
1133
1418
|
preinstall("chef_rpm-1.2-1.i686.rpm")
|
1134
|
-
dnf_package
|
1135
|
-
|
1419
|
+
dnf_package "chef_rpm" do
|
1420
|
+
options default_options
|
1421
|
+
action :remove
|
1422
|
+
end.should_be_updated
|
1136
1423
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^package chef_rpm is not installed$")
|
1137
|
-
dnf_package
|
1138
|
-
|
1424
|
+
dnf_package "chef_rpm" do
|
1425
|
+
options default_options
|
1426
|
+
action :remove
|
1427
|
+
end.should_not_be_updated
|
1139
1428
|
end
|
1140
1429
|
end
|
1141
1430
|
|
1142
1431
|
context "with 64-bit arch", :intel_64bit do
|
1143
|
-
let(:package_name) { "chef_rpm.#{pkg_arch}" }
|
1144
1432
|
it "does nothing if the package is not installed" do
|
1145
1433
|
flush_cache
|
1146
|
-
dnf_package
|
1147
|
-
|
1434
|
+
dnf_package "chef_rpm.#{pkg_arch}" do
|
1435
|
+
options default_options
|
1436
|
+
action :remove
|
1437
|
+
end.should_not_be_updated
|
1148
1438
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^package chef_rpm is not installed$")
|
1149
1439
|
end
|
1150
1440
|
|
1151
1441
|
it "removes the package if the package is installed" do
|
1152
1442
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
1153
|
-
dnf_package
|
1154
|
-
|
1443
|
+
dnf_package "chef_rpm.#{pkg_arch}" do
|
1444
|
+
options default_options
|
1445
|
+
action :remove
|
1446
|
+
end.should_be_updated
|
1155
1447
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^package chef_rpm is not installed$")
|
1156
|
-
dnf_package
|
1157
|
-
|
1448
|
+
dnf_package "chef_rpm.#{pkg_arch}" do
|
1449
|
+
options default_options
|
1450
|
+
action :remove
|
1451
|
+
end.should_not_be_updated
|
1158
1452
|
end
|
1159
1453
|
|
1160
1454
|
it "removes the package if the prior version package is installed" do
|
1161
1455
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
1162
|
-
dnf_package
|
1163
|
-
|
1456
|
+
dnf_package "chef_rpm.#{pkg_arch}" do
|
1457
|
+
options default_options
|
1458
|
+
action :remove
|
1459
|
+
end.should_be_updated
|
1164
1460
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^package chef_rpm is not installed$")
|
1165
|
-
dnf_package
|
1166
|
-
|
1461
|
+
dnf_package "chef_rpm.#{pkg_arch}" do
|
1462
|
+
options default_options
|
1463
|
+
action :remove
|
1464
|
+
end.should_not_be_updated
|
1167
1465
|
end
|
1168
1466
|
|
1169
1467
|
it "does nothing if the i686 package is installed" do
|
1170
1468
|
preinstall("chef_rpm-1.10-1.i686.rpm")
|
1171
|
-
dnf_package
|
1172
|
-
|
1469
|
+
dnf_package "chef_rpm.#{pkg_arch}" do
|
1470
|
+
options default_options
|
1471
|
+
action :remove
|
1472
|
+
end.should_not_be_updated
|
1173
1473
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.i686$")
|
1174
1474
|
end
|
1175
1475
|
|
1176
1476
|
it "does nothing if the prior version i686 package is installed" do
|
1177
1477
|
preinstall("chef_rpm-1.2-1.i686.rpm")
|
1178
|
-
dnf_package
|
1179
|
-
|
1478
|
+
dnf_package "chef_rpm.#{pkg_arch}" do
|
1479
|
+
options default_options
|
1480
|
+
action :remove
|
1481
|
+
end.should_not_be_updated
|
1180
1482
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.i686$")
|
1181
1483
|
end
|
1182
1484
|
end
|
1183
1485
|
|
1184
1486
|
context "with 32-bit arch", :intel_64bit do
|
1185
|
-
let(:package_name) { "chef_rpm.i686" }
|
1186
1487
|
it "removes only the 32-bit arch if both are installed" do
|
1187
1488
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm", "chef_rpm-1.10-1.i686.rpm")
|
1188
|
-
dnf_package.
|
1189
|
-
|
1489
|
+
dnf_package "chef_rpm.i686" do
|
1490
|
+
options default_options
|
1491
|
+
action :remove
|
1492
|
+
end.should_be_updated
|
1190
1493
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
1191
|
-
dnf_package.
|
1192
|
-
|
1494
|
+
dnf_package "chef_rpm.i686" do
|
1495
|
+
options default_options
|
1496
|
+
action :remove
|
1497
|
+
end.should_not_be_updated
|
1193
1498
|
end
|
1194
1499
|
end
|
1195
1500
|
|
@@ -1197,11 +1502,15 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
1197
1502
|
it "works when a package is installed" do
|
1198
1503
|
FileUtils.rm_f "/etc/yum.repos.d/chef-dnf-localtesting.repo"
|
1199
1504
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
1200
|
-
dnf_package
|
1201
|
-
|
1505
|
+
dnf_package "chef_rpm" do
|
1506
|
+
options "--nogpgcheck --disablerepo=*"
|
1507
|
+
action :remove
|
1508
|
+
end.should_be_updated
|
1202
1509
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^package chef_rpm is not installed$")
|
1203
|
-
dnf_package
|
1204
|
-
|
1510
|
+
dnf_package "chef_rpm" do
|
1511
|
+
options "--nogpgcheck --disablerepo=*"
|
1512
|
+
action :remove
|
1513
|
+
end.should_not_be_updated
|
1205
1514
|
end
|
1206
1515
|
end
|
1207
1516
|
end
|
@@ -1217,61 +1526,75 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
1217
1526
|
|
1218
1527
|
it "locks an rpm" do
|
1219
1528
|
flush_cache
|
1220
|
-
dnf_package
|
1221
|
-
|
1222
|
-
|
1529
|
+
dnf_package "chef_rpm" do
|
1530
|
+
options default_options
|
1531
|
+
action :lock
|
1532
|
+
end.should_be_updated
|
1223
1533
|
expect(shell_out("dnf versionlock list").stdout.chomp).to match("^chef_rpm-0:")
|
1224
|
-
dnf_package
|
1225
|
-
|
1534
|
+
dnf_package "chef_rpm" do
|
1535
|
+
options default_options
|
1536
|
+
action :lock
|
1537
|
+
end.should_not_be_updated
|
1226
1538
|
end
|
1227
1539
|
|
1228
1540
|
it "does not lock if its already locked" do
|
1229
1541
|
flush_cache
|
1230
1542
|
shell_out!("dnf versionlock add chef_rpm")
|
1231
|
-
dnf_package
|
1232
|
-
|
1233
|
-
|
1543
|
+
dnf_package "chef_rpm" do
|
1544
|
+
options default_options
|
1545
|
+
action :lock
|
1546
|
+
end.should_not_be_updated
|
1234
1547
|
expect(shell_out("dnf versionlock list").stdout.chomp).to match("^chef_rpm-0:")
|
1235
1548
|
end
|
1236
1549
|
|
1237
1550
|
it "unlocks an rpm" do
|
1238
1551
|
flush_cache
|
1239
1552
|
shell_out!("dnf versionlock add chef_rpm")
|
1240
|
-
dnf_package
|
1241
|
-
|
1242
|
-
|
1553
|
+
dnf_package "chef_rpm" do
|
1554
|
+
options default_options
|
1555
|
+
action :unlock
|
1556
|
+
end.should_be_updated
|
1243
1557
|
expect(shell_out("dnf versionlock list").stdout.chomp).not_to match("^chef_rpm-0:")
|
1244
|
-
dnf_package
|
1245
|
-
|
1558
|
+
dnf_package "chef_rpm" do
|
1559
|
+
options default_options
|
1560
|
+
action :unlock
|
1561
|
+
end.should_not_be_updated
|
1246
1562
|
end
|
1247
1563
|
|
1248
1564
|
it "does not unlock an already locked rpm" do
|
1249
1565
|
flush_cache
|
1250
|
-
dnf_package
|
1251
|
-
|
1252
|
-
|
1566
|
+
dnf_package "chef_rpm" do
|
1567
|
+
options default_options
|
1568
|
+
action :unlock
|
1569
|
+
end.should_not_be_updated
|
1253
1570
|
expect(shell_out("dnf versionlock list").stdout.chomp).not_to match("^chef_rpm-0:")
|
1254
1571
|
end
|
1255
1572
|
|
1256
1573
|
it "check that we can lock based on provides" do
|
1257
1574
|
flush_cache
|
1258
|
-
dnf_package
|
1259
|
-
|
1260
|
-
|
1575
|
+
dnf_package "chef_rpm_provides" do
|
1576
|
+
options default_options
|
1577
|
+
action :lock
|
1578
|
+
end.should_be_updated
|
1261
1579
|
expect(shell_out("dnf versionlock list").stdout.chomp).to match("^chef_rpm-0:")
|
1262
|
-
dnf_package
|
1263
|
-
|
1580
|
+
dnf_package "chef_rpm_provides" do
|
1581
|
+
options default_options
|
1582
|
+
action :lock
|
1583
|
+
end.should_not_be_updated
|
1264
1584
|
end
|
1265
1585
|
|
1266
1586
|
it "check that we can unlock based on provides" do
|
1267
1587
|
flush_cache
|
1268
1588
|
shell_out!("dnf versionlock add chef_rpm")
|
1269
|
-
dnf_package
|
1270
|
-
|
1271
|
-
|
1589
|
+
dnf_package "chef_rpm_provides" do
|
1590
|
+
options default_options
|
1591
|
+
action :unlock
|
1592
|
+
end.should_be_updated
|
1272
1593
|
expect(shell_out("dnf versionlock list").stdout.chomp).not_to match("^chef_rpm-0:")
|
1273
|
-
dnf_package
|
1274
|
-
|
1594
|
+
dnf_package "chef_rpm_provides" do
|
1595
|
+
options default_options
|
1596
|
+
action :unlock
|
1597
|
+
end.should_not_be_updated
|
1275
1598
|
end
|
1276
1599
|
end
|
1277
1600
|
end
|