inspec/test/unit/mock/cmd/dpkg-s-held-package
Adam Leff 367d42fb3a Properly handle held packages on dpkg-flavored OS (#2087)
* check the proper field for dpkg installation state fixes #2006

Signed-off-by: Mathieu Sauve-Frankel <msf@kisoku.net>

* Properly handle held packages on dpkg-flavored OS

InSpec was looking at the wrong field in `dpkg -s` output to determine
whether a package was installed or not. An installed, held package was
incorrectly reported as uninstalled.

This adds the proper unit tests and also adds a `be_held` matcher.

Thanks to @kisoku for the initial work in #2007.

Signed-off-by: Adam Leff <adam@leff.co>
2017-08-18 17:29:23 +02:00

14 lines
371 B
Text

Package: held-package
Status: hold ok installed
Priority: optional
Section: web
Installed-Size: 306
Maintainer: Fake User <fake@user.biz)
Architecture: amd64
Multi-Arch: foreign
Version: 1.2.3-1
Depends: libc6 (>= 2.17), libcurl3 (= 7.35.0-1ubuntu2), zlib1g (>= 1:1.1.4)
Description: Totally a fake package
Can you believe this is fake?
I can.
Homepage: http://chef.io