summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-07-13 10:01:52 -0700
committerTim Smith <tsmith84@gmail.com>2020-07-27 11:03:07 -0700
commit82fffd509b5c7462f0fb1c5677b601000d47bf91 (patch)
tree364ab77b7ae42cba822df2869115b912c1fa9385
parent61ba4f6432593f4f594eb38526503b19d66a6ba3 (diff)
downloadchef-82fffd509b5c7462f0fb1c5677b601000d47bf91.tar.gz
Add end-to-end hostname testing
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/windows.rb4
-rw-r--r--lib/chef/resource/hostname.rb2
2 files changed, 5 insertions, 1 deletions
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
index 22f78db319..df176e8751 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
@@ -68,3 +68,7 @@ locale "set system locale" do
end
include_recipe "::_ohai_hint"
+
+hostname "new-hostname" do
+ windows_reboot false
+end \ No newline at end of file
diff --git a/lib/chef/resource/hostname.rb b/lib/chef/resource/hostname.rb
index dcf7354446..793006096d 100644
--- a/lib/chef/resource/hostname.rb
+++ b/lib/chef/resource/hostname.rb
@@ -248,8 +248,8 @@ class Chef
# reboot because $windows
reboot "setting hostname" do
reason "#{Chef::Dist::PRODUCT} updated system hostname"
- action :nothing
only_if { new_resource.windows_reboot }
+ action :request_reboot
end
end
end