Add a sysinfo hook that gets called before a test so that we can do
some pre-test examining of /var/log/messages. This allows us to
remember how large /var/log/messages was at the test start so that
we can then just grab new logs.

The /var/log/messages handling basically does two things before the
test:
  - it remembers how large the file is
  - it remembers the inode of the file
We then use the remembered size and skip over that many bytes when
grabbing the logs after the test. The inode is remembered so that we
can do a quick check to see if the final /var/log/messages is really
the "same" file; if the log gets rotated during the test we just
grab everything from the start. We still don't really handle that case
properly since the rotated logs that happened during the test still
won't be grabbed, but it's not easy to grab rotated logs in a
standard way.

Risk: Low
Visibility: Grab any new /var/log/messages that happen during the test.

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2198 592f7852-d20e-0410-864c-8624ca9c26a4
3 files changed