summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-18 18:18:34 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-18 18:18:34 +0000
commit40eeadbde0d91bf1028bb5e655f1428953ee66dd (patch)
treed29886972965b5e4ae5d0df6885ea9f660406700
parent2a3f56cc91a38cc6046aeb7f301058561d8d55f7 (diff)
downloadpuppet-40eeadbde0d91bf1028bb5e655f1428953ee66dd.tar.gz
puppet-40eeadbde0d91bf1028bb5e655f1428953ee66dd.tar.xz
puppet-40eeadbde0d91bf1028bb5e655f1428953ee66dd.zip
Adding example cron tab from #492 and making the read/write tests ignore whitespace. This cron now parses successfully, as I thought it would with the move to providers.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2291 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r--test/data/providers/cron/examples/openbsd20
-rwxr-xr-xtest/ral/providers/cron/crontab.rb5
2 files changed, 24 insertions, 1 deletions
diff --git a/test/data/providers/cron/examples/openbsd b/test/data/providers/cron/examples/openbsd
new file mode 100644
index 000000000..d77597da0
--- /dev/null
+++ b/test/data/providers/cron/examples/openbsd
@@ -0,0 +1,20 @@
+#
+SHELL=/bin/sh
+PATH=/bin:/sbin:/usr/bin:/usr/sbin
+HOME=/var/log
+#
+#minute hour mday month wday command
+#
+# sendmail clientmqueue runner
+*/30 * * * * /usr/sbin/sendmail -L sm-msp-queue -Ac -q
+#
+# rotate log files every hour, if necessary
+0 * * * * /usr/bin/newsyslog
+# send log file notifications, if necessary
+#1-59 * * * * /usr/bin/newsyslog -m
+#
+# do daily/weekly/monthly maintenance
+30 1 * * * /bin/sh /etc/daily 2>&1 | tee /var/log/daily.out | mail -s "`/bin/hostname` daily output" root
+30 3 * * 6 /bin/sh /etc/weekly 2>&1 | tee /var/log/weekly.out | mail -s "`/bin/hostname` weekly output" root
+30 5 1 * * /bin/sh /etc/monthly 2>&1 | tee /var/log/monthly.out | mail -s "`/bin/hostname` monthly output" root
+#0 * * * * /usr/libexec/spamd-setup
diff --git a/test/ral/providers/cron/crontab.rb b/test/ral/providers/cron/crontab.rb
index 6d0d1e8a9..c28b12ffd 100755
--- a/test/ral/providers/cron/crontab.rb
+++ b/test/ral/providers/cron/crontab.rb
@@ -281,7 +281,10 @@ class TestCronParsedProvider < Test::Unit::TestCase
@provider.flush_target(@me)
end
- assert_equal(text, target.read,
+ # Ignore whitespace differences, since those don't affect function.
+ modtext = text.gsub(/[ \t]+/, " ")
+ modtarget = target.read.gsub(/[ \t]+/, " ")
+ assert_equal(modtext, modtarget,
"File was not rewritten the same")
@provider.clear