summaryrefslogtreecommitdiff
path: root/kitchen-tests
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-06-05 23:50:28 -0700
committerTim Smith <tsmith@chef.io>2021-06-06 00:45:24 -0700
commit67f88486ac155be0e02bb2081489a829a20f8961 (patch)
treedee74cb7de1456ebf9df1e64247ce1f36d516ebb /kitchen-tests
parent49fb31b21290c7f58026b472b1ae04e6bc8718a0 (diff)
downloadchef-67f88486ac155be0e02bb2081489a829a20f8961.tar.gz
Modernize windows_printer_port
Load the state fully / remove the exists? method Delete the power with the powershell cmdlet Add updating to the create action Deprecate the description property which never did anything Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'kitchen-tests')
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/_windows_printer.rb24
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/windows.rb2
2 files changed, 26 insertions, 0 deletions
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/_windows_printer.rb b/kitchen-tests/cookbooks/end_to_end/recipes/_windows_printer.rb
new file mode 100644
index 0000000000..9b7f5c91d8
--- /dev/null
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/_windows_printer.rb
@@ -0,0 +1,24 @@
+#
+# Cookbook:: end_to_end
+# Recipe:: _windows_printer
+#
+# Copyright:: Copyright (c) Chef Software Inc.
+#
+
+windows_printer_port "10.4.64.39" do
+ port_name "My awesome port"
+ snmp_enabled true
+ port_protocol 2
+end
+
+# change the port above
+windows_printer_port "10.4.64.39" do
+ port_name "My awesome port"
+ snmp_enabled false
+ port_protocol 2
+end
+
+# delete a port that doesn't exist
+windows_printer_port "10.4.64.37" do
+ action :delete
+end
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
index e04396783b..f4cd74e3bf 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
@@ -176,3 +176,5 @@ end
windows_certificate "c:/mordor/ca.cert.pem" do
store_name "ROOT"
end
+
+include_recipe "::_windows_printer"