summaryrefslogtreecommitdiff
path: root/kitchen-tests
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-07-21 09:20:40 -0700
committerTim Smith <tsmith84@gmail.com>2020-07-21 09:20:40 -0700
commit135d99c2f1daa01982340aa1cf076d16f9a45cdd (patch)
tree6857076bc52c9fd66680c502a0df00a30b424bdd /kitchen-tests
parentfdce8208a5e1768fc055a6fa18c9a5a1e16f5d30 (diff)
downloadchef-135d99c2f1daa01982340aa1cf076d16f9a45cdd.tar.gz
Add additional Test Kitchen tests
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'kitchen-tests')
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/_macos_userdefaults.rb31
1 files changed, 30 insertions, 1 deletions
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/_macos_userdefaults.rb b/kitchen-tests/cookbooks/end_to_end/recipes/_macos_userdefaults.rb
index 107a9fb867..9d61ee5df6 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/_macos_userdefaults.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/_macos_userdefaults.rb
@@ -5,12 +5,14 @@
# Copyright:: Copyright (c) Chef Software Inc.
#
+# test that we can autodetect the type
mac_os_x_userdefaults "Disable fast user switching" do
domain "/Library/Preferences/.GlobalPreferences"
key "MultipleSessionEnabled"
value 0
end
+# test full path to the domain
macos_userdefaults "Enable macOS firewall" do
domain "/Library/Preferences/com.apple.alf"
key "globalstate"
@@ -18,15 +20,42 @@ macos_userdefaults "Enable macOS firewall" do
type "int"
end
+# test short domain name
macos_userdefaults "Set the dock size" do
domain "com.apple.dock"
- type "integer"
+ type "int"
key "tilesize"
value "20"
end
+# test that we can properly handle spaces
macos_userdefaults "Value with space" do
domain "/Library/Preferences/ManagedInstalls"
+ type "string"
key "LogFile"
value "/Library/Managed Installs/Logs/ManagedSoftwareUpdate2.log"
end
+
+# test that we can set an array
+macos_userdefaults "Bogus key with array value" do
+ domain "/Library/Preferences/ManagedInstalls"
+ type "array"
+ key "LogFileArray"
+ value [ '/Library/Managed Installs/fake.log', '/Library/Managed Installs/also_fake.log']
+end
+
+# test that we can set a dict
+macos_userdefaults "Bogus key with dict value" do
+ domain "/Library/Preferences/ManagedInstalls"
+ type "dict"
+ key "LogFileDict"
+ value "User": '/Library/Managed Installs/way_fake.log'
+end
+
+# test that we can set a bool
+macos_userdefaults 'Bogus key with boolean value' do
+ domain "/Library/Preferences/ManagedInstalls"
+ key 'LoggingIsTheThingToDoRight'
+ value "yes"
+ type "bool"
+end