summaryrefslogtreecommitdiffstats
path: root/test/data
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-08-06 17:59:37 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-08-06 17:59:37 +0000
commit5e419cf750dc1ac9572616b7318d7501d9d366ed (patch)
treedb2044b548adf4af668698fcd6fbada37a2f5cfe /test/data
parentd121b1f06e40067c499a1a8ef9e805298c20c9a2 (diff)
downloadpuppet-5e419cf750dc1ac9572616b7318d7501d9d366ed.tar.gz
puppet-5e419cf750dc1ac9572616b7318d7501d9d366ed.tar.xz
puppet-5e419cf750dc1ac9572616b7318d7501d9d366ed.zip
Fixing #749 -- environment settings no longer accumulate. Significantly adding to the cron tests at the same time, such that hopefully we will no longer have these recurring bugs. I now do every combinatorial of multi-line cron jobs, including doing them all in one file. There are, unfortunately, still edge cases, but maybe we will have some peace in cron space for a while, anyway.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2750 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/data')
-rw-r--r--test/data/providers/cron/crontab_collections.yaml44
-rw-r--r--test/data/providers/cron/crontab_multiple_with_env.yaml54
-rw-r--r--test/data/providers/cron/crontab_sample_records.yaml272
3 files changed, 370 insertions, 0 deletions
diff --git a/test/data/providers/cron/crontab_collections.yaml b/test/data/providers/cron/crontab_collections.yaml
new file mode 100644
index 000000000..45c8eaf65
--- /dev/null
+++ b/test/data/providers/cron/crontab_collections.yaml
@@ -0,0 +1,44 @@
+---
+:with_name:
+- :name
+- :spaces_in_command_with_times
+:with_env:
+- :environment
+- :spaces_in_command_with_times
+:simple:
+- :spaces_in_command_with_times
+:with_multiple_envs:
+- :environment
+- :lowercase_environment
+- :spaces_in_command_with_times
+:with_name_and_env:
+- :name_with_spaces
+- :another_env
+- :spaces_in_command_with_times
+:with_name_and_multiple_envs:
+- :long_name
+- :another_env
+- :fourth_env
+- :spaces_in_command_with_times
+---
+:with_name:
+- :name
+- :spaces_in_command_with_times
+:with_env:
+- :environment
+- :spaces_in_command_with_times
+:simple:
+- :spaces_in_command_with_times
+:with_multiple_envs:
+- :environment
+- :lowercase_environment
+- :spaces_in_command_with_times
+:with_name_and_env:
+- :name_with_spaces
+- :another_env
+- :spaces_in_command_with_times
+:with_name_and_multiple_envs:
+- :long_name
+- :another_env
+- :fourth_env
+- :spaces_in_command_with_times
diff --git a/test/data/providers/cron/crontab_multiple_with_env.yaml b/test/data/providers/cron/crontab_multiple_with_env.yaml
new file mode 100644
index 000000000..8573bd467
--- /dev/null
+++ b/test/data/providers/cron/crontab_multiple_with_env.yaml
@@ -0,0 +1,54 @@
+---
+- |
+ # comment 1
+ # Puppet Name: name2
+ env3=val
+ * * * * * command4
+ # Puppet Name: name with spaces
+ env3=val
+ env4=other
+ * * * * * command5
+ # comment 5
+
+- - :record_type: :comment
+ :line: "# comment 1"
+ - :command: command4
+ :environment:
+ - env3=val
+ :name: name2
+ :record_type: :crontab
+ - :command: command5
+ :environment:
+ - env3=val
+ - env4=other
+ :name: name with spaces
+ :record_type: :crontab
+ - :record_type: :comment
+ :line: "# comment 5"
+---
+- |
+ # comment 1
+ # Puppet Name: name2
+ env3=val
+ * * * * * command4
+ # Puppet Name: name with spaces
+ env3=val
+ env4=other
+ * * * * * command5
+ # comment 5
+
+- - :record_type: :comment
+ :line: "# comment 1"
+ - :command: command4
+ :environment:
+ - env3=val
+ :name: name2
+ :record_type: :crontab
+ - :command: command5
+ :environment:
+ - env3=val
+ - env4=other
+ :name: name with spaces
+ :record_type: :crontab
+ - :record_type: :comment
+ :line: "# comment 5"
diff --git a/test/data/providers/cron/crontab_sample_records.yaml b/test/data/providers/cron/crontab_sample_records.yaml
new file mode 100644
index 000000000..cafe9de25
--- /dev/null
+++ b/test/data/providers/cron/crontab_sample_records.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: :freebsd_special
+: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: :freebsd_special
+: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: :freebsd_special
+: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: :freebsd_special
+: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