summaryrefslogtreecommitdiff
path: root/spec/functional
diff options
context:
space:
mode:
authorKapil Chouhan <kapil.chouhan@msystechnologies.com>2018-11-19 10:00:25 +0000
committerKapil Chouhan <kapil.chouhan@msystechnologies.com>2018-11-27 08:33:39 +0000
commita322f0cb65dc0d8f8b7ba5bc25a882df8d5e6023 (patch)
treed71bb7adfcdef1a8a41915656611583dc1eccc11 /spec/functional
parenta97e5da2e9dc3218da8df80eb905013effc85ca9 (diff)
downloadchef-a322f0cb65dc0d8f8b7ba5bc25a882df8d5e6023.tar.gz
Chef client should be fail appropriately when specified package is not applicable to image
Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com>
Diffstat (limited to 'spec/functional')
-rw-r--r--spec/functional/resource/msu_package_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/functional/resource/msu_package_spec.rb b/spec/functional/resource/msu_package_spec.rb
index 23342be6ae..d6811d99e7 100644
--- a/spec/functional/resource/msu_package_spec.rb
+++ b/spec/functional/resource/msu_package_spec.rb
@@ -76,6 +76,20 @@ describe Chef::Resource::MsuPackage, :win2012r2_only do
end
end
+ context "when an msu package is not applicable to the image." do
+ def package_name
+ "Package_for_KB4019990"
+ end
+
+ def package_source
+ "http://download.windowsupdate.com/c/msdownload/update/software/updt/2017/05/windows8-rt-kb4019990-x64_a77f4e3e1f2d47205824763e7121bb11979c2716.msu"
+ end
+
+ it "raises error while installing" do
+ expect { subject.run_action(:install) }.to raise_error(Chef::Exceptions::Package, /The specified package is not applicable to this image./)
+ end
+ end
+
def remove_package
pkg_to_remove = Chef::Resource::MsuPackage.new(package_name, run_context)
pkg_to_remove.source = package_source