summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/functional/dsl/reboot_pending_spec.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/functional/dsl/reboot_pending_spec.rb b/spec/functional/dsl/reboot_pending_spec.rb
index 89701802b3..4e1ad858ad 100644
--- a/spec/functional/dsl/reboot_pending_spec.rb
+++ b/spec/functional/dsl/reboot_pending_spec.rb
@@ -17,10 +17,13 @@
#
require "chef/dsl/reboot_pending"
+require "chef/dsl/registry_helper"
require "chef/win32/registry"
require "spec_helper"
describe Chef::DSL::RebootPending, :windows_only do
+ include Chef::DSL::RegistryHelper
+
def run_ohai
node.consume_external_attrs(OHAI_SYSTEM.data, {})
end
@@ -79,7 +82,9 @@ describe Chef::DSL::RebootPending, :windows_only do
describe "when there is nothing to indicate a reboot is pending" do
it "should return false" do
- skip "reboot pending" if @any_flag.any? { |_, v| v == true }
+ skip "reboot pending" if registry_value_exists?('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager', { name: "PendingFileRenameOperations" }) ||
+ registry_key_exists?('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired') ||
+ registry_key_exists?('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending')
expect(recipe.reboot_pending?).to be_falsey
end
end