diff options
author | Tim Smith <tsmith@chef.io> | 2018-03-19 09:57:06 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-03-19 15:27:20 -0700 |
commit | 2955a93b0f35b1b89ec50b92be4e5127b1e9c12f (patch) | |
tree | d12a00189ac48b9617137c1ffb25a1ee6555bd5a /spec | |
parent | 4e6c7972620e68753946abe109895762a6301efd (diff) | |
download | chef-2955a93b0f35b1b89ec50b92be4e5127b1e9c12f.tar.gz |
Detect new "automatically" installed string in Zypper
This resolves issue #6836 which explains the issue in great detail.
TLDR: Packages that are installed as deps on another package have a
different string when you get info on them now. This updates the regex
to detect both. Based on the zypper changelog I believe this was
introduced in 1.13.17.
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/provider/package/zypper_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/unit/provider/package/zypper_spec.rb b/spec/unit/provider/package/zypper_spec.rb index 598fedc9fa..3f172dc370 100644 --- a/spec/unit/provider/package/zypper_spec.rb +++ b/spec/unit/provider/package/zypper_spec.rb @@ -88,6 +88,14 @@ describe Chef::Provider::Package::Zypper do provider.load_current_resource end + it "should set the installed version if zypper info has one (zypper version >= 1.13.17)" do + status = double(:stdout => "Version : 1.0\nInstalled : Yes (automatically)\n", :exitstatus => 0) + + allow(provider).to receive(:shell_out!).and_return(status) + expect(current_resource).to receive(:version).with(["1.0"]).and_return(true) + provider.load_current_resource + end + it "should set the candidate version if zypper info has one (zypper version < 1.13.0)" do status = double(:stdout => "Version: 1.0\nInstalled: No\nStatus: out-of-date (version 0.9 installed)", :exitstatus => 0) |