#! /bin/bash 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/cache-ttl 1d' \ logfile_syslog.1.xz check_output "decompression not working" < 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-[0-9]*-archives|lnav-NNN-archives|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 mv 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?" <