aboutsummaryrefslogtreecommitdiff
path: root/spec/fixtures/unit
diff options
context:
space:
mode:
Diffstat (limited to 'spec/fixtures/unit')
-rw-r--r--spec/fixtures/unit/provider/cron/crontab/single_line.yaml272
-rw-r--r--spec/fixtures/unit/provider/cron/crontab/vixie_header.txt3
-rw-r--r--spec/fixtures/unit/provider/cron/parsed/managed6
-rw-r--r--spec/fixtures/unit/provider/cron/parsed/simple9
4 files changed, 290 insertions, 0 deletions
diff --git a/spec/fixtures/unit/provider/cron/crontab/single_line.yaml b/spec/fixtures/unit/provider/cron/crontab/single_line.yaml
new file mode 100644
index 0000000..da2853e
--- /dev/null
+++ b/spec/fixtures/unit/provider/cron/crontab/single_line.yaml
@@ -0,0 +1,272 @@
+---
+:longcommment:
+ :text: "# This is a comment"
+ :record:
+ :line: "# This is a comment"
+ :record_type: :comment
+:special:
+ :text: "@hourly /bin/date"
+ :record:
+ :special: hourly
+ :command: /bin/date
+ :record_type: :crontab
+:long_name:
+ :text: "# Puppet Name: long_name"
+ :record:
+ :line: "# Puppet Name: long_name"
+ :name: long_name
+ :record_type: :comment
+:multiple_minutes:
+ :text: 5,15 * * * * /bin/date
+ :record:
+ :minute:
+ - "5"
+ - "15"
+ :command: /bin/date
+ :record_type: :crontab
+:environment:
+ :text: ONE=TWO
+ :record:
+ :line: ONE=TWO
+ :record_type: :environment
+:empty:
+ :text: ""
+ :record:
+ :line: ""
+ :record_type: :blank
+:simple:
+ :text: "* * * * * /bin/date"
+ :record:
+ :command: /bin/date
+ :record_type: :crontab
+:whitespace:
+ :text: " "
+ :record:
+ :line: " "
+ :record_type: :blank
+:minute_and_hour:
+ :text: 5 15 * * * /bin/date
+ :record:
+ :minute:
+ - "5"
+ :hour:
+ - "15"
+ :command: /bin/date
+ :record_type: :crontab
+:lowercase_environment:
+ :text: a=b
+ :record:
+ :line: a=b
+ :record_type: :environment
+:special_with_spaces:
+ :text: "@daily /bin/echo testing"
+ :record:
+ :special: daily
+ :command: /bin/echo testing
+ :record_type: :crontab
+:tabs:
+ :text: !binary |
+ CQ==
+
+ :record:
+ :line: !binary |
+ CQ==
+
+ :record_type: :blank
+:multiple_minute_and_hour:
+ :text: 5,10 15,20 * * * /bin/date
+ :record:
+ :minute:
+ - "5"
+ - "10"
+ :hour:
+ - "15"
+ - "20"
+ :command: /bin/date
+ :record_type: :crontab
+:name:
+ :text: "# Puppet Name: testing"
+ :record:
+ :line: "# Puppet Name: testing"
+ :name: testing
+ :record_type: :comment
+:another_env:
+ :text: Testing=True
+ :record:
+ :line: Testing=True
+ :record_type: :environment
+:shortcomment:
+ :text: "#"
+ :record:
+ :line: "#"
+ :record_type: :comment
+:spaces_in_command:
+ :text: "* * * * * /bin/echo testing"
+ :record:
+ :command: /bin/echo testing
+ :record_type: :crontab
+:fourth_env:
+ :text: True=False
+ :record:
+ :line: True=False
+ :record_type: :environment
+:simple_with_minute:
+ :text: 5 * * * * /bin/date
+ :record:
+ :minute:
+ - "5"
+ :command: /bin/date
+ :record_type: :crontab
+:spaces_in_command_with_times:
+ :text: 5,10 15,20 * * * /bin/echo testing
+ :record:
+ :minute:
+ - "5"
+ - "10"
+ :hour:
+ - "15"
+ - "20"
+ :command: /bin/echo testing
+ :record_type: :crontab
+:name_with_spaces:
+ :text: "# Puppet Name: another name"
+ :record:
+ :line: "# Puppet Name: another name"
+ :name: another name
+ :record_type: :comment
+---
+:longcommment:
+ :text: "# This is a comment"
+ :record:
+ :line: "# This is a comment"
+ :record_type: :comment
+:special:
+ :text: "@hourly /bin/date"
+ :record:
+ :special: hourly
+ :command: /bin/date
+ :record_type: :crontab
+:long_name:
+ :text: "# Puppet Name: long_name"
+ :record:
+ :line: "# Puppet Name: long_name"
+ :name: long_name
+ :record_type: :comment
+:multiple_minutes:
+ :text: 5,15 * * * * /bin/date
+ :record:
+ :minute:
+ - "5"
+ - "15"
+ :command: /bin/date
+ :record_type: :crontab
+:environment:
+ :text: ONE=TWO
+ :record:
+ :line: ONE=TWO
+ :record_type: :environment
+:empty:
+ :text: ""
+ :record:
+ :line: ""
+ :record_type: :blank
+:simple:
+ :text: "* * * * * /bin/date"
+ :record:
+ :command: /bin/date
+ :record_type: :crontab
+:whitespace:
+ :text: " "
+ :record:
+ :line: " "
+ :record_type: :blank
+:minute_and_hour:
+ :text: 5 15 * * * /bin/date
+ :record:
+ :minute:
+ - "5"
+ :hour:
+ - "15"
+ :command: /bin/date
+ :record_type: :crontab
+:lowercase_environment:
+ :text: a=b
+ :record:
+ :line: a=b
+ :record_type: :environment
+:special_with_spaces:
+ :text: "@daily /bin/echo testing"
+ :record:
+ :special: daily
+ :command: /bin/echo testing
+ :record_type: :crontab
+:tabs:
+ :text: !binary |
+ CQ==
+
+ :record:
+ :line: !binary |
+ CQ==
+
+ :record_type: :blank
+:multiple_minute_and_hour:
+ :text: 5,10 15,20 * * * /bin/date
+ :record:
+ :minute:
+ - "5"
+ - "10"
+ :hour:
+ - "15"
+ - "20"
+ :command: /bin/date
+ :record_type: :crontab
+:name:
+ :text: "# Puppet Name: testing"
+ :record:
+ :line: "# Puppet Name: testing"
+ :name: testing
+ :record_type: :comment
+:another_env:
+ :text: Testing=True
+ :record:
+ :line: Testing=True
+ :record_type: :environment
+:shortcomment:
+ :text: "#"
+ :record:
+ :line: "#"
+ :record_type: :comment
+:spaces_in_command:
+ :text: "* * * * * /bin/echo testing"
+ :record:
+ :command: /bin/echo testing
+ :record_type: :crontab
+:fourth_env:
+ :text: True=False
+ :record:
+ :line: True=False
+ :record_type: :environment
+:simple_with_minute:
+ :text: 5 * * * * /bin/date
+ :record:
+ :minute:
+ - "5"
+ :command: /bin/date
+ :record_type: :crontab
+:spaces_in_command_with_times:
+ :text: 5,10 15,20 * * * /bin/echo testing
+ :record:
+ :minute:
+ - "5"
+ - "10"
+ :hour:
+ - "15"
+ - "20"
+ :command: /bin/echo testing
+ :record_type: :crontab
+:name_with_spaces:
+ :text: "# Puppet Name: another name"
+ :record:
+ :line: "# Puppet Name: another name"
+ :name: another name
+ :record_type: :comment
diff --git a/spec/fixtures/unit/provider/cron/crontab/vixie_header.txt b/spec/fixtures/unit/provider/cron/crontab/vixie_header.txt
new file mode 100644
index 0000000..7ccfc37
--- /dev/null
+++ b/spec/fixtures/unit/provider/cron/crontab/vixie_header.txt
@@ -0,0 +1,3 @@
+# DO NOT EDIT THIS FILE - edit the master and reinstall.
+# (- installed on Thu Apr 12 12:16:01 2007)
+# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
diff --git a/spec/fixtures/unit/provider/cron/parsed/managed b/spec/fixtures/unit/provider/cron/parsed/managed
new file mode 100644
index 0000000..c48d20a
--- /dev/null
+++ b/spec/fixtures/unit/provider/cron/parsed/managed
@@ -0,0 +1,6 @@
+# Puppet Name: real_job
+* * * * * /bin/true
+# Puppet Name: complex_job
+MAILTO=foo@example.com
+SHELL=/bin/sh
+@reboot /bin/true >> /dev/null 2>&1
diff --git a/spec/fixtures/unit/provider/cron/parsed/simple b/spec/fixtures/unit/provider/cron/parsed/simple
new file mode 100644
index 0000000..477553e
--- /dev/null
+++ b/spec/fixtures/unit/provider/cron/parsed/simple
@@ -0,0 +1,9 @@
+# use /bin/sh to run commands, no matter what /etc/passwd says
+SHELL=/bin/sh
+# mail any output to `paul', no matter whose crontab this is
+MAILTO=paul
+#
+# run five minutes after midnight, every day
+5 0 * * * $HOME/bin/daily.job >> $HOME/tmp/out 2>&1
+# run at 2:15pm on the first of every month -- output mailed to paul
+15 14 1 * * $HOME/bin/monthly