Skip to content

Commit

Permalink
Merge pull request #389 from raniemi/windows-hotfixes
Browse files Browse the repository at this point in the history
Basic Windows Hot Fix Support
  • Loading branch information
mizzy committed Apr 24, 2014
2 parents 21fbb84 + 4fc98e0 commit 42c80cb
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/serverspec/helper/type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Type
base cgroup command cron default_gateway file group host iis_website iis_app_pool interface
ipfilter ipnat iptables kernel_module linux_kernel_parameter lxc mail_alias
package php_config port process routing_table selinux service user yumrepo
windows_feature windows_registry_key zfs
windows_feature windows_hot_fix windows_registry_key zfs
)

types.each {|type| require "serverspec/type/#{type}" }
Expand Down
9 changes: 9 additions & 0 deletions lib/serverspec/type/windows_hot_fix.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Serverspec
module Type
class WindowsHotFix < Base
def installed?(provider, version)
backend.check_windows_hot_fix_installed(@name, version)
end
end
end
end
25 changes: 25 additions & 0 deletions spec/windows/windows_hot_fix_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
require 'spec_helper'

include SpecInfra::Helper::Cmd
include SpecInfra::Helper::Windows

describe windows_hot_fix('DESCRIPTION-OR-KB-ID') do
it { should be_installed }
its(:command) { should == "(FindInstalledHotFix -description 'DESCRIPTION-OR-KB-ID' -hotFixId 'DESCRIPTION-OR-KB-ID') -eq $true" }
end

describe windows_hot_fix('DESCRIPTION') do
it { should be_installed.with_version('KB-ID') }
its(:command) { should == "(FindInstalledHotFix -description 'DESCRIPTION' -hotFixId 'KB-ID') -eq $true" }
end

describe windows_hot_fix('DESCRIPTION_WITH_KB123456789_INLINED') do
it { should be_installed }
its(:command) { should == "(FindInstalledHotFix -description 'DESCRIPTION_WITH_KB123456789_INLINED' -hotFixId 'KB123456789') -eq $true" }
end

describe windows_hot_fix('DESCRIPTION_WITH_SUFFIX_KB123456789') do
it { should be_installed }
its(:command) { should == "(FindInstalledHotFix -description 'DESCRIPTION_WITH_SUFFIX_KB123456789' -hotFixId 'KB123456789') -eq $true" }
end

0 comments on commit 42c80cb

Please sign in to comment.