summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher A. Snapp <csnapp@chef.io>2020-05-28 08:59:20 -0600
committerChristopher A. Snapp <csnapp@chef.io>2020-05-29 18:02:44 -0600
commit66cb0f6970c3e7f5838a67029f1c0c5b32ee6f85 (patch)
treedf13a5d37ed6db71be98c7fc4acbadadc162c0aa
parent233fb3c4cf1feef79db5274b6a96c91135324f65 (diff)
downloadchef-66cb0f6970c3e7f5838a67029f1c0c5b32ee6f85.tar.gz
Add macos support to end_to_end::default
Signed-off-by: Christopher A. Snapp <csnapp@chef.io>
-rw-r--r--kitchen-tests/cookbooks/end_to_end/attributes/default.rb1
-rw-r--r--kitchen-tests/cookbooks/end_to_end/files/io.chef.testing.fake.plist25
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/_launchd.rb13
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/default.rb1
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/macos.rb65
5 files changed, 105 insertions, 0 deletions
diff --git a/kitchen-tests/cookbooks/end_to_end/attributes/default.rb b/kitchen-tests/cookbooks/end_to_end/attributes/default.rb
index 8c95e888fe..e910b9e7d4 100644
--- a/kitchen-tests/cookbooks/end_to_end/attributes/default.rb
+++ b/kitchen-tests/cookbooks/end_to_end/attributes/default.rb
@@ -1,5 +1,6 @@
puts "CHEF UTILS THINKS WE ARE ON UBUNTU" if ubuntu?
puts "CHEF UTILS THINKS WE ARE ON RHEL" if rhel?
+puts "CHEF UTILS THINKS WE ARE ON MACOS" if macos?
puts "CHEF UTILS THINKS WE ARE ON WINDOWS" if windows?
#
diff --git a/kitchen-tests/cookbooks/end_to_end/files/io.chef.testing.fake.plist b/kitchen-tests/cookbooks/end_to_end/files/io.chef.testing.fake.plist
new file mode 100644
index 0000000000..570c736041
--- /dev/null
+++ b/kitchen-tests/cookbooks/end_to_end/files/io.chef.testing.fake.plist
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+
+<plist version="1.0">
+ <dict>
+ <key>Label</key>
+
+ <string>io.chef.testing.fake</string>
+
+ <key>ProgramArguments</key>
+
+ <array>
+ <string>/bin/sleep</string>
+ <string>60</string>
+ </array>
+
+ <key>StartCalendarInterval</key>
+
+ <dict>
+ <key>Hour</key>
+ <integer>1</integer>
+ </dict>
+ </dict>
+</plist>
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/_launchd.rb b/kitchen-tests/cookbooks/end_to_end/recipes/_launchd.rb
new file mode 100644
index 0000000000..4a1e910b51
--- /dev/null
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/_launchd.rb
@@ -0,0 +1,13 @@
+#
+# Cookbook:: end_to_end
+# Recipe:: launchd
+#
+
+file "/Library/LaunchDaemons/io.chef.testing.fake.plist" do
+ path "io.chef.testing.fake.plist"
+ mode "644"
+end
+
+launchd "io.chef.testing.fake" do
+ source "io.chef.testing.fake"
+end
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/default.rb b/kitchen-tests/cookbooks/end_to_end/recipes/default.rb
index eae5cfd3ad..c353e181e9 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/default.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/default.rb
@@ -6,4 +6,5 @@
#
include_recipe "::linux" if platform_family?("rhel", "debian")
+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
new file mode 100644
index 0000000000..f1250fb7a1
--- /dev/null
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb
@@ -0,0 +1,65 @@
+#
+# Cookbook:: end_to_end
+# Recipe:: macos
+#
+# Copyright:: Copyright (c) Chef Software Inc.
+#
+
+chef_sleep "2"
+
+execute "sleep 1"
+
+execute "sleep 1 second" do
+ command "sleep 1"
+ live_stream true
+end
+
+execute "sensitive sleep" do
+ command "sleep 1"
+ sensitive true
+end
+
+timezone "GMT"
+
+include_recipe "ntp"
+
+include_recipe "resolver"
+
+users_manage "remove sysadmin" do
+ group_name "sysadmin"
+ group_id 2300
+ action [:remove]
+end
+
+users_manage "create sysadmin" do
+ group_name "sysadmin"
+ group_id 2300
+ action [:create]
+end
+
+ssh_known_hosts_entry "github.com"
+
+include_recipe "chef-client::delete_validation"
+include_recipe "chef-client::config"
+
+include_recipe "git"
+
+# test various archive formats in the archive_file resource
+%w{tourism.tar.gz tourism.tar.xz tourism.zip}.each do |archive|
+ cookbook_file File.join(Chef::Config[:file_cache_path], archive) do
+ source archive
+ end
+
+ archive_file archive do
+ path File.join(Chef::Config[:file_cache_path], archive)
+ extract_to File.join(Chef::Config[:file_cache_path], archive.tr(".", "_"))
+ end
+end
+
+launchd "io.chef.testing.fake" do
+ source "io.chef.testing.fake.plist"
+ action "enable"
+end
+
+include_recipe "::_ohai_hint"
+include_recipe "::_openssl"