diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-12-02 13:37:27 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-12-13 13:31:51 -0800 |
commit | d07e27dad9d5e9a72341053a12f42416fcffb873 (patch) | |
tree | 6950ca342f257199c78d86c2b297c0c47db54109 /spec/functional | |
parent | 1bd371a0d4345060545fe91fb8d5ea2e56a09788 (diff) | |
download | chef-d07e27dad9d5e9a72341053a12f42416fcffb873.tar.gz |
fix and test :install and :upgrade source arg idempotency
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/functional')
-rw-r--r-- | spec/functional/resource/dnf_package_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/functional/resource/dnf_package_spec.rb b/spec/functional/resource/dnf_package_spec.rb index edebc5d48b..6acde8a61d 100644 --- a/spec/functional/resource/dnf_package_spec.rb +++ b/spec/functional/resource/dnf_package_spec.rb @@ -266,6 +266,14 @@ gpgcheck=0 expect(dnf_package.updated_by_last_action?).to be true expect(shell_out("rpm -q chef_rpm").stdout.chomp).to eql("chef_rpm-1.2-1.fc24.x86_64") end + + it "is idempotent when the package is already installed" do + preinstall("chef_rpm-1.2-1.fc24.x86_64.rpm") + dnf_package.package_name("#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.fc24.x86_64.rpm") + dnf_package.run_action(:install) + expect(dnf_package.updated_by_last_action?).to be false + expect(shell_out("rpm -q chef_rpm").stdout.chomp).to eql("chef_rpm-1.2-1.fc24.x86_64") + end end end @@ -317,6 +325,14 @@ gpgcheck=0 expect(dnf_package.updated_by_last_action?).to be true expect(shell_out("rpm -q chef_rpm").stdout.chomp).to eql("chef_rpm-1.2-1.fc24.x86_64") end + + it "is idempotent when the package is already installed" do + preinstall("chef_rpm-1.2-1.fc24.x86_64.rpm") + dnf_package.package_name("#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.fc24.x86_64.rpm") + dnf_package.run_action(:upgrade) + expect(dnf_package.updated_by_last_action?).to be false + expect(shell_out("rpm -q chef_rpm").stdout.chomp).to eql("chef_rpm-1.2-1.fc24.x86_64") + end end end |