diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-05-04 19:08:00 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-05-04 19:18:29 -0700 |
commit | ef16c85f47cb1fc5684cc7731c32c161626fee6d (patch) | |
tree | 5ed757da9ced6238b2611208f32e011873a23424 /kitchen-tests/cookbooks | |
parent | 3eef7a1befa2ef5883f047fea5d2a2c5eee36948 (diff) | |
download | chef-ef16c85f47cb1fc5684cc7731c32c161626fee6d.tar.gz |
Fix failurs in the cron_d resource :remove action
Add kitchen testing for the cron resources
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'kitchen-tests/cookbooks')
-rw-r--r-- | kitchen-tests/cookbooks/end_to_end/recipes/_cron.rb | 65 | ||||
-rw-r--r-- | kitchen-tests/cookbooks/end_to_end/recipes/default.rb | 15 |
2 files changed, 66 insertions, 14 deletions
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/_cron.rb b/kitchen-tests/cookbooks/end_to_end/recipes/_cron.rb new file mode 100644 index 0000000000..af55c15090 --- /dev/null +++ b/kitchen-tests/cookbooks/end_to_end/recipes/_cron.rb @@ -0,0 +1,65 @@ +# +# Cookbook:: end_to_end +# Recipe:: cron +# + +# +# cron_d resource +# + +cron_d "noop" do + hour "5" + minute "0" + command "/bin/true" +end + +cron_d "name_of_cron_entry" do + minute "0" + hour "8" + weekday "6" + mailto "admin@example.com" + action :create +end + +cron_d "name_of_cron_entry" do + minute "0" + hour "20" + day "*" + month "11" + weekday "1-5" + action :create +end + +cron_d "job_to_remove" do + action :delete +end + +# +# cron_access resource +# + +cron_access "alice" do + action :allow +end + +cron_access "bob" + +# legacy resource name +cron_manage "Bill breaks things. Take away cron" do + user "bill" + action :deny +end + +# +# cron resource +# + +cron "some random cron job" do + minute 0 + hour 23 + command "/usr/bin/true" +end + +cron "remove_a_job" do + action :delete +end
\ No newline at end of file diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/default.rb b/kitchen-tests/cookbooks/end_to_end/recipes/default.rb index 494d48ec06..8f7d068df5 100644 --- a/kitchen-tests/cookbooks/end_to_end/recipes/default.rb +++ b/kitchen-tests/cookbooks/end_to_end/recipes/default.rb @@ -76,20 +76,6 @@ include_recipe "git" directory "/etc/ssl" -cron_access "bob" - -cron "some random cron job" do - minute 0 - hour 23 - command "/usr/bin/true" -end - -cron_d "another random cron job" do - minute 0 - hour 23 - command "/usr/bin/true" -end - # Generate new key and certificate openssl_dhparam "/etc/ssl/dhparam.pem" do key_length 1024 @@ -160,4 +146,5 @@ include_recipe "::_chef-vault" unless includes_recipe?("end_to_end::chef-vault") include_recipe "::_sysctl" include_recipe "::_apt_preference" include_recipe "::_alternatives" +include_recipe "::_cron" include_recipe "::_tests" |