Add pkg.installed tests
Merge pull request #7981 from terminalmage/tests

Add pkg.installed tests