[augeas-devel] [Augeas] #115: logrotate error not catched by tests
Augeas
trac at fedorahosted.org
Fri Mar 12 10:09:42 UTC 2010
#115: logrotate error not catched by tests
--------------------+-------------------------------------------------------
Reporter: mfo | Owner: lutter
Type: defect | Status: new
Priority: minor | Milestone: next
Component: Augeas | Version: 0.7.0
Keywords: |
--------------------+-------------------------------------------------------
I noticed augeas was unable to parse /etc/logrotate.d/rsyslog on my debian
system. The problem seems to occur when several files are mentioned one
per line (instead of all on one line). NB: I found this problem happens on
redhat too.
{{{
# cat > /etc/logrotate.d/augeasbug
/var/log/test1
/var/log/test2
{
daily
}
# augtool get /augeas/files/etc/logrotate.d/augeasbug/error/message
/augeas/files/etc/logrotate.d/augeasbug/error/message = Iterated lens
matched less than it should
}}}
What puzzles my is that augparse doesn't seem to catch this error:
{{{
marc at lonquimay:~/src/augeas/lenses$ git diff
diff --git lenses/tests/test_logrotate.aug lenses/tests/test_logrotate.aug
index ad78fa1..f773c1c 100644
--- lenses/tests/test_logrotate.aug
+++ lenses/tests/test_logrotate.aug
@@ -129,6 +129,39 @@ include /etc/logrotate.d
/etc/init.d/apache2 restart > /dev/null
fi" } }
+let conf2 = "/var/log/mail.info
+/var/log/mail.warn
+/var/log/mail.err
+/var/log/mail.log
+/var/log/daemon.log
+/var/log/kern.log
+/var/log/auth.log
+/var/log/user.log
+/var/log/lpr.log
+/var/log/cron.log
+/var/log/debug
+/var/log/messages
+{
+ weekly
+}
+"
+ test Logrotate.lns get conf2 =
+ { "rule"
+ { "file" = "/var/log/mail.info" }
+ { "file" = "/var/log/mail.warn" }
+ { "file" = "/var/log/mail.err" }
+ { "file" = "/var/log/mail.log" }
+ { "file" = "/var/log/daemon.log" }
+ { "file" = "/var/log/kern.log" }
+ { "file" = "/var/log/auth.log" }
+ { "file" = "/var/log/user.log" }
+ { "file" = "/var/log/lpr.log" }
+ { "file" = "/var/log/cron.log" }
+ { "file" = "/var/log/debug" }
+ { "file" = "/var/log/messages" }
+ { "schedule" = "weekly" }
+ }
+
test Logrotate.lns get "/var/log/file {\n dateext\n}\n" =
{ "rule"
{ "file" = "/var/log/file" }
marc at lonquimay:~/src/augeas/lenses$ augparse -I. tests/test_logrotate.aug
marc at lonquimay:~/src/augeas/lenses$ echo $?
0
}}}
--
Ticket URL: <https://fedorahosted.org/augeas/ticket/115>
Augeas <http://augeas.net/>
a configuration API
More information about the augeas-devel
mailing list