mirror of
https://github.com/inspec/inspec
synced 2024-11-27 15:10:44 +00:00
e23249d635
* Add hotfix resource for Windows Signed-off-by: Matt Ray <matthewhray@gmail.com> * Renamed hotfix to windows_hotfix Added additional unit test checking for KB that is not present on a box Signed-off-by: Matt Ray <matthewhray@gmail.com> * Integration test to spot-check for hotfixes Queries the Windows operating system via Powershell for a list of all installed hotfixes and spot-checks every 10th one with the windows_hotfix resource. Checking hundreds is time-consuming. Also checks to ensure a non-installed hotfix is not present. Signed-off-by: Matt Ray <matthewhray@gmail.com>
26 lines
755 B
Ruby
26 lines
755 B
Ruby
# encoding: utf-8
|
|
# author: Matt Ray
|
|
|
|
require 'helper'
|
|
require 'inspec/resource'
|
|
|
|
describe 'Inspec::Resources::WindowsHotfix' do
|
|
|
|
# ubuntu 14.04
|
|
it 'fail windows_hotfix fails on ubuntu' do
|
|
resource = MockLoader.new(:ubuntu1404).load_resource('windows_hotfix', 'KB4019215')
|
|
_(resource.installed?).must_equal false
|
|
end
|
|
|
|
# windows
|
|
it 'verify windows_hotfix installed on windows' do
|
|
resource = MockLoader.new(:windows).load_resource('windows_hotfix', 'KB4019215')
|
|
_(resource.installed?).must_equal true
|
|
end
|
|
|
|
# windows missing hotfix
|
|
it 'verify windows_hotfix not installed on windows' do
|
|
resource = MockLoader.new(:windows).load_resource('windows_hotfix', 'KB9999999')
|
|
_(resource.installed?).must_equal false
|
|
end
|
|
end
|