From 0df0f951daf96ad8c80d5915cf83d281ccd5e862 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Wed, 11 Apr 2018 22:58:16 -0700 Subject: add a test Signed-off-by: Lamont Granquist --- spec/functional/resource/yum_package_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/functional/resource/yum_package_spec.rb b/spec/functional/resource/yum_package_spec.rb index b06bbe686a..7c45a64ae5 100644 --- a/spec/functional/resource/yum_package_spec.rb +++ b/spec/functional/resource/yum_package_spec.rb @@ -590,6 +590,14 @@ gpgcheck=0 expect { yum_package.run_action(:install) }.to raise_error(Chef::Exceptions::Package, /No candidate version available/) end + it "should work with disablerepo first" do + flush_cache + yum_package.options(["--disablerepo=*", "--enablerepo=chef-yum-localtesting"]) + yum_package.run_action(:install) + expect(yum_package.updated_by_last_action?).to be true + expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$") + end + it "should work to enable a disabled repo", not_rhel5: true do shell_out!("yum-config-manager --disable chef-yum-localtesting") flush_cache -- cgit v1.2.1