summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2021-04-29 14:27:59 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2021-04-29 14:27:59 -0700
commit237fa8e6e1d59a873517e9938012e28a8a31dca7 (patch)
tree5078426ee4ff5b5181fd9d804cf9672487c12e56
parenta7060f2fc9d7a73415cba1537b18884bc8ea7274 (diff)
downloadchef-lcg/yum-spec-modernization.tar.gz
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--spec/functional/resource/yum_package_spec.rb38
1 files changed, 19 insertions, 19 deletions
diff --git a/spec/functional/resource/yum_package_spec.rb b/spec/functional/resource/yum_package_spec.rb
index 0d16ef34dd..47bad8158f 100644
--- a/spec/functional/resource/yum_package_spec.rb
+++ b/spec/functional/resource/yum_package_spec.rb
@@ -622,7 +622,7 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
it "should fail with the repo disabled" do
flush_cache
expect {
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options "--nogpgcheck --disablerepo=chef-yum-localtesting"
end
}.to raise_error(Chef::Exceptions::Package, /No candidate version available/)
@@ -630,7 +630,7 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
it "should work with disablerepo first" do
flush_cache
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options "--nogpgcheck --disablerepo=* --enablerepo=chef-yum-localtesting"
end.should_be_updated
expect_matching_installed_version("^chef_rpm-1.10-1.#{pkg_arch}$")
@@ -640,12 +640,12 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
shell_out!("yum-config-manager --disable chef-yum-localtesting")
flush_cache
expect {
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options "--nogpgcheck"
end
}.to raise_error(Chef::Exceptions::Package, /No candidate version available/)
flush_cache
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options "--nogpgcheck --enablerepo=chef-yum-localtesting"
end.should_be_updated
expect_matching_installed_version("^chef_rpm-1.10-1.#{pkg_arch}$")
@@ -658,7 +658,7 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
# accomplishes both those goals (it would be easier if we had other rpms in this repo, but with
# one rpm we need to do this).
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options "--nogpgcheck --disablerepo=chef-yum-localtesting"
action :upgrade
end.should_not_be_updated
@@ -847,7 +847,7 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
let(:package_name) { "chef_rpm" }
it "does nothing if the package is not installed" do
flush_cache
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options default_options
action :remove
end.should_not_be_updated
@@ -856,7 +856,7 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
it "removes the package if the package is installed" do
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options default_options
action :remove
end.should_be_updated
@@ -865,12 +865,12 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
it "does not remove the package twice" do
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options default_options
action :remove
end.should_be_updated
expect_matching_installed_version("^package chef_rpm is not installed$")
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options default_options
action :remove
end.should_not_be_updated
@@ -879,7 +879,7 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
it "removes the package if the prior version package is installed" do
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options default_options
action :remove
end.should_be_updated
@@ -889,7 +889,7 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
it "removes the package if the i686 package is installed", :intel_64bit do
skip "FIXME: should this be fixed or is the current behavior correct?"
preinstall("chef_rpm-1.10-1.i686.rpm")
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options default_options
action :remove
end.should_be_updated
@@ -899,7 +899,7 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
it "removes the package if the prior version i686 package is installed", :intel_64bit do
skip "FIXME: should this be fixed or is the current behavior correct?"
preinstall("chef_rpm-1.2-1.i686.rpm")
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options default_options
action :remove
end.should_be_updated
@@ -911,7 +911,7 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
let(:package_name) { "chef_rpm.#{pkg_arch}" }
it "does nothing if the package is not installed" do
flush_cache
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options default_options
action :remove
end.should_not_be_updated
@@ -920,7 +920,7 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
it "removes the package if the package is installed" do
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options default_options
action :remove
end.should_be_updated
@@ -929,7 +929,7 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
it "removes the package if the prior version package is installed" do
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options default_options
action :remove
end.should_be_updated
@@ -938,7 +938,7 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
it "does nothing if the i686 package is installed" do
preinstall("chef_rpm-1.10-1.i686.rpm")
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options default_options
action :remove
end.should_not_be_updated
@@ -947,7 +947,7 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
it "does nothing if the prior version i686 package is installed" do
preinstall("chef_rpm-1.2-1.i686.rpm")
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options default_options
action :remove
end.should_not_be_updated
@@ -959,7 +959,7 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
let(:package_name) { "chef_rpm.i686" }
it "removes only the 32-bit arch if both are installed" do
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm", "chef_rpm-1.10-1.i686.rpm")
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options default_options
action :remove
end.should_be_updated
@@ -971,7 +971,7 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
it "works when a package is installed" do
FileUtils.rm_f "/etc/yum.repos.d/chef-yum-localtesting.repo"
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
- yum_package "chef_repo" do
+ yum_package "chef_rpm" do
options default_options
action :remove
end.should_be_updated