From 3c10b1f34bde06ace9be8f97bc8b8e853187b189 Mon Sep 17 00:00:00 2001 From: Timothy Stack Date: Fri, 19 Mar 2021 21:29:18 -0700 Subject: [PATCH] [build] try to fix some tests --- test/Makefile.am | 1 + test/test_logfile.sh | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 713cd974..702ae604 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -308,6 +308,7 @@ dist_noinst_DATA = \ formats/scripts/nested-redirecting.lnav \ formats/sqldir/init.sql \ formats/timestamp/format.json \ + formats/xmlmsg/format.json \ log-samples/sample-27353a72ba4025448f261dcfa6ea16e474187795.txt \ log-samples/sample-70c906b3c1a1cf03f15bde92ee78edfa6f9b7960.txt \ log-samples/sample-ad31f12d2adabd07e3ddda3ad5b0dbf6b49c4c99.txt \ diff --git a/test/test_logfile.sh b/test/test_logfile.sh index 223080e5..b246deb2 100644 --- a/test/test_logfile.sh +++ b/test/test_logfile.sh @@ -1,5 +1,7 @@ #! /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' @@ -83,7 +85,7 @@ Jan 3 09:47:02 veridian sudo: timstack : TTY=pts/6 ; PWD=/auto/wstimstack/rpms/ EOF fi - (cd ${srcdir} && tar cfz ${builddir}/test-logs.tgz logfile_access_log.* logfile_empty.0 -C ${builddir} ../src/lnav) + tar cfz ${builddir}/test-logs.tgz -C ${top_srcdir} test/logfile_access_log.0 test/logfile_access_log.1 test/logfile_empty.0 -C ${builddir}/.. src/lnav dd if=test-logs.tgz of=test-logs-trunc.tgz bs=4096 count=20 @@ -99,12 +101,12 @@ EOF 10.112.81.15 - - [15/Feb/2013:06:00:31 +0000] "-" 400 0 "-" "-" EOF - if ! test -f tmp/*/*-test-logs.tgz/logfile_access_log.0; then + if ! test -f tmp/*/*-test-logs.tgz/test/logfile_access_log.0; then echo "archived file not unpacked" exit 1 fi - if test -w tmp/*/*-test-logs.tgz/logfile_access_log.0; then + if test -w tmp/*/*-test-logs.tgz/test/logfile_access_log.0; then echo "archived file is writable" exit 1 fi @@ -113,7 +115,7 @@ EOF -c ':config /tuning/archive-manager/cache-ttl 0d' \ -n -q ${srcdir}/logfile_syslog.0 - if test -f tmp/lnav*/*-test-logs.tgz/logfile_access_log.0; then + if test -f tmp/lnav*/*-test-logs.tgz/test/logfile_access_log.0; then echo "archive cache not deleted?" exit 1 fi @@ -135,7 +137,7 @@ EOF > 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 +error: unable to open file: /test-logs-trunc.tgz -- failed to read file: /test-logs-trunc.tgz >> src/lnav -- truncated gzip input EOF mkdir -p rotmp @@ -149,7 +151,7 @@ EOF > test_logfile.rotmp.out mv test_logfile.rotmp.out `test_err_filename` check_error_output "archive not unpacked" <