#! /bin/bash echo ${top_srcdir} echo ${top_builddir} echo "2013-06-06T19:13:20.123 Hi" | run_test ${lnav_test} -d /tmp/lnav.err -n -w logfile_stdin.0.log \ -c ':shexec sleep 1 && touch -t 200711030923 logfile_stdin.0.log' check_output "piping to stdin is not working?" < logfile_syslog.1.xz run_test env TMPDIR=tmp ${lnav_test} -n \ -c ':config /tuning/archive-manager/min-free-space 1125899906842624' \ -c ':config /tuning/archive-manager/cache-ttl 1d' \ ${srcdir}/logfile_syslog.0 run_test env TMPDIR=tmp ${lnav_test} -d /tmp/lnav.err -n \ logfile_syslog.1.xz sed -e "s|lnav-user-[0-9]*-work|lnav-user-NNN-work|g" \ -e "s|arc-[0-9a-z]*-logfile|arc-NNN-logfile|g" \ -e "s|space on disk \(.*\) is|space on disk (NNN) is|g" \ -e "s|${builddir}||g" \ `test_err_filename` > test_logfile.big.out mv test_logfile.big.out `test_err_filename` check_error_output "decompression worked?" < test_logfile.trunc.out mv test_logfile.trunc.out `test_err_filename` check_error_output "truncated tgz not reported correctly" <> src/lnav -- truncated gzip input EOF mkdir -p rotmp chmod ugo-w rotmp run_test env TMPDIR=rotmp ${lnav_test} -n test-logs.tgz sed -e "s|lnav-user-[0-9]*-work|lnav-user-NNN-work|g" \ -e "s|arc-[0-9a-z]*-test|arc-NNN-test|g" \ -e "s|${builddir}||g" \ `test_err_filename` | head -1 \ > test_logfile.rotmp.out cp test_logfile.rotmp.out `test_err_filename` check_error_output "archive not unpacked" < test_logfile.unreadable.out mv test_logfile.unreadable.out `test_err_filename` check_error_output "able to read an unreadable log file?" < logfile_syslog.1.gz run_test ./drive_logfile -t -f syslog_log logfile_syslog.1.gz check_output "Syslog timestamp incorrect for gzipped file?" < logfile_syslog.1.bz2 touch -t 200711030923 logfile_syslog.1.bz2 run_test ./drive_logfile -t -f syslog_log logfile_syslog.1.bz2 check_output "bzip2 file not loaded?" <