diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-05-29 18:52:07 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-05-29 18:52:07 -0700 |
commit | bf40875cf634714f4effb06c984c875ec3738f09 (patch) | |
tree | a2d29cf98f6cc29762b54e1447c9b2988a60b82b /kitchen-tests | |
parent | 2b686a4fe118079a389f0b8b185a67333886b09a (diff) | |
download | chef-bf40875cf634714f4effb06c984c875ec3738f09.tar.gz |
Add additional testing for macOS hosts
Test dmg_package and macos_userdefaults
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'kitchen-tests')
7 files changed, 60 insertions, 4 deletions
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/_cron.rb b/kitchen-tests/cookbooks/end_to_end/recipes/_cron.rb index 545d895869..b2575923ea 100644 --- a/kitchen-tests/cookbooks/end_to_end/recipes/_cron.rb +++ b/kitchen-tests/cookbooks/end_to_end/recipes/_cron.rb @@ -64,4 +64,4 @@ end cron "remove_a_job" do action :delete -end
\ No newline at end of file +end diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/_dmg_package.rb b/kitchen-tests/cookbooks/end_to_end/recipes/_dmg_package.rb new file mode 100644 index 0000000000..100787524e --- /dev/null +++ b/kitchen-tests/cookbooks/end_to_end/recipes/_dmg_package.rb @@ -0,0 +1,21 @@ +# +# Cookbook:: end_to_end +# Recipe:: _dmg_package +# +# Copyright:: Copyright (c) Chef Software Inc. +# + +dmg_package "Tunnelblick" do + source "https://tunnelblick.net/release/Tunnelblick_3.8.2a_build_5481.dmg" + checksum "3857f395f2c0026943bc76d46cb8bb97f5655e9ea0d9a8d2bdca1e5d82a7325b" + action :install +end + +dmg_package "virtualbox" do + app "virtualbox" + source "http://download.virtualbox.org/virtualbox/6.1.8/VirtualBox-6.1.8-137981-OSX.dmg" + checksum "569e91eb3c7cb002d407b236a7aa71ac610cf2ad1afa03730dab11fbd4b89e7c" + type "pkg" + accept_eula true + allow_untrusted true +end diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/_macos_userdefaults.rb b/kitchen-tests/cookbooks/end_to_end/recipes/_macos_userdefaults.rb new file mode 100644 index 0000000000..090bf1c725 --- /dev/null +++ b/kitchen-tests/cookbooks/end_to_end/recipes/_macos_userdefaults.rb @@ -0,0 +1,33 @@ +# +# Cookbook:: end_to_end +# Recipe:: _macos_userdefaults +# +# Copyright:: Copyright (c) Chef Software Inc. +# + +mac_os_x_userdefaults "Disable fast user switching" do + domain "/Library/Preferences/.GlobalPreferences" + key "MultipleSessionEnabled" + value 0 +end + +macos_userdefaults "enable macOS firewall" do + domain "/Library/Preferences/com.apple.alf" + key "globalstate" + value "1" + type "int" +end + +macos_userdefaults "set dock size" do + domain "com.apple.dock" + type "integer" + key "tilesize" + value "20" +end + +macos_userdefaults "disable time machine normal schedule" do + domain "/System/Library/LaunchDaemons/com.apple.backupd-auto" + key "Disabled" + value "TRUE" + sudo true +end diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/_sysctl.rb b/kitchen-tests/cookbooks/end_to_end/recipes/_sysctl.rb index b5943180d0..7bc3ae84d2 100644 --- a/kitchen-tests/cookbooks/end_to_end/recipes/_sysctl.rb +++ b/kitchen-tests/cookbooks/end_to_end/recipes/_sysctl.rb @@ -18,4 +18,4 @@ end sysctl_param "bogus.sysctl_val" do value 9000 action :remove -end
\ No newline at end of file +end diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/_yum.rb b/kitchen-tests/cookbooks/end_to_end/recipes/_yum.rb index f6f48a89c9..af36038ca7 100644 --- a/kitchen-tests/cookbooks/end_to_end/recipes/_yum.rb +++ b/kitchen-tests/cookbooks/end_to_end/recipes/_yum.rb @@ -13,4 +13,4 @@ yum_repository "epel" do gpgcheck true mirrorlist "https://mirrors.fedoraproject.org/metalink?repo=epel-#{node["platform_version"].to_i}&arch=$basearch" only_if { rhel? } -end
\ No newline at end of file +end diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/default.rb b/kitchen-tests/cookbooks/end_to_end/recipes/default.rb index c353e181e9..20971a0333 100644 --- a/kitchen-tests/cookbooks/end_to_end/recipes/default.rb +++ b/kitchen-tests/cookbooks/end_to_end/recipes/default.rb @@ -5,6 +5,6 @@ # Copyright:: Copyright (c) Chef Software Inc. # -include_recipe "::linux" if platform_family?("rhel", "debian") +include_recipe "::linux" if linux? include_recipe "::macos" if macos? include_recipe "::windows" if windows? diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb b/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb index f1250fb7a1..30b674620b 100644 --- a/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb +++ b/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb @@ -61,5 +61,7 @@ launchd "io.chef.testing.fake" do action "enable" end +include_recipe "::_dmg_package" +include_recipe "::_macos_userdefaults" include_recipe "::_ohai_hint" include_recipe "::_openssl" |