@ -99,7 +99,9 @@ EOF
fi
fi
if test x" ${ LIBARCHIVE_LIBS } " != x"" ; then
if test x" ${ LIBARCHIVE_LIBS } " != x"" ; then
run_test env TMPDIR = tmp ${ lnav_test } -n \
rm -rf logfile-tmp
mkdir logfile-tmp
run_test env TMPDIR = logfile-tmp ${ lnav_test } -n \
-c ':config /tuning/archive-manager/min-free-space -1' \
-c ':config /tuning/archive-manager/min-free-space -1' \
${ srcdir } /logfile_syslog.0
${ srcdir } /logfile_syslog.0
@ -113,16 +115,16 @@ if test x"${LIBARCHIVE_LIBS}" != x""; then
The minimum free space, in bytes, to maintain when unpacking archives
The minimum free space, in bytes, to maintain when unpacking archives
EOF
EOF
rm -rf tmp/lnav-*
rm -rf logfile- tmp/lnav-*
if test x" ${ XZ_CMD } " != x"" ; then
if test x" ${ XZ_CMD } " != x"" ; then
${ XZ_CMD } -z -c ${ srcdir } /logfile_syslog.1 > logfile_syslog.1.xz
${ XZ_CMD } -z -c ${ srcdir } /logfile_syslog.1 > logfile_syslog.1.xz
run_test env TMPDIR = tmp ${ lnav_test } -n \
run_test env TMPDIR = logfile- tmp ${ lnav_test } -n \
-c ':config /tuning/archive-manager/min-free-space 1125899906842624' \
-c ':config /tuning/archive-manager/min-free-space 1125899906842624' \
-c ':config /tuning/archive-manager/cache-ttl 1d' \
-c ':config /tuning/archive-manager/cache-ttl 1d' \
${ srcdir } /logfile_syslog.0
${ srcdir } /logfile_syslog.0
run_test env TMPDIR = tmp ${ lnav_test } -d /tmp/lnav.err -n \
run_test env TMPDIR = logfile- tmp ${ lnav_test } -d /tmp/lnav.err -n \
logfile_syslog.1.xz
logfile_syslog.1.xz
sed -e "s|lnav-user-[0-9]*-work|lnav-user-NNN-work|g" \
sed -e "s|lnav-user-[0-9]*-work|lnav-user-NNN-work|g" \
@ -133,14 +135,14 @@ EOF
mv test_logfile.big.out ` test_err_filename`
mv test_logfile.big.out ` test_err_filename`
check_error_output "decompression worked?" <<EOF
check_error_output "decompression worked?" <<EOF
✘ error: unable to open file: /logfile_syslog.1.xz
✘ error: unable to open file: /logfile_syslog.1.xz
reason: available space on disk ( NNN) is below the minimum-free threshold ( 1.0PB) . Unable to unpack 'logfile_syslog.1.xz' to ' tmp/lnav-user-NNN-work/archives/arc-NNN-logfile_syslog.1.xz'
reason: available space on disk ( NNN) is below the minimum-free threshold ( 1.0PB) . Unable to unpack 'logfile_syslog.1.xz' to ' logfile- tmp/lnav-user-NNN-work/archives/arc-NNN-logfile_syslog.1.xz'
EOF
EOF
run_test env TMPDIR = tmp ${ lnav_test } -n \
run_test env TMPDIR = logfile- tmp ${ lnav_test } -n \
-c ':config /tuning/archive-manager/min-free-space 33554432' \
-c ':config /tuning/archive-manager/min-free-space 33554432' \
${ srcdir } /logfile_syslog.0
${ srcdir } /logfile_syslog.0
run_test env TMPDIR = tmp ${ lnav_test } -n \
run_test env TMPDIR = logfile- tmp ${ lnav_test } -n \
logfile_syslog.1.xz
logfile_syslog.1.xz
check_output "decompression not working" <<EOF
check_output "decompression not working" <<EOF
@ -155,8 +157,8 @@ EOF
dd if = test-logs.tgz of = test-logs-trunc.tgz bs = 4096 count = 20
dd if = test-logs.tgz of = test-logs-trunc.tgz bs = 4096 count = 20
mkdir -p tmp
mkdir -p logfile- tmp
run_test env TMPDIR = tmp ${ lnav_test } \
run_test env TMPDIR = logfile- tmp ${ lnav_test } \
-c ':config /tuning/archive-manager/cache-ttl 1d' \
-c ':config /tuning/archive-manager/cache-ttl 1d' \
-n test-logs.tgz
-n test-logs.tgz
@ -167,26 +169,26 @@ EOF
10.112.81.15 - - [ 15/Feb/2013:06:00:31 +0000] "-" 400 0 "-" "-"
10.112.81.15 - - [ 15/Feb/2013:06:00:31 +0000] "-" 400 0 "-" "-"
EOF
EOF
if ! test -f tmp/*/archives/*-test-logs.tgz/test/logfile_access_log.0; then
if ! test -f logfile- tmp/*/archives/*-test-logs.tgz/test/logfile_access_log.0; then
echo "archived file not unpacked"
echo "archived file not unpacked"
exit 1
exit 1
fi
fi
if test -w tmp/*/archives/*-test-logs.tgz/test/logfile_access_log.0; then
if test -w logfile- tmp/*/archives/*-test-logs.tgz/test/logfile_access_log.0; then
echo "archived file is writable"
echo "archived file is writable"
exit 1
exit 1
fi
fi
env TMPDIR = tmp ${ lnav_test } -d /tmp/lnav.err \
env TMPDIR = logfile- tmp ${ lnav_test } -d /tmp/lnav.err \
-c ':config /tuning/archive-manager/cache-ttl 0d' \
-c ':config /tuning/archive-manager/cache-ttl 0d' \
-n -q ${ srcdir } /logfile_syslog.0
-n -q ${ srcdir } /logfile_syslog.0
if test -f tmp/lnav*/archives/*-test-logs.tgz/test/logfile_access_log.0; then
if test -f logfile- tmp/lnav*/archives/*-test-logs.tgz/test/logfile_access_log.0; then
echo "archive cache not deleted?"
echo "archive cache not deleted?"
exit 1
exit 1
fi
fi
run_test env TMPDIR = tmp ${ lnav_test } -n\
run_test env TMPDIR = logfile- tmp ${ lnav_test } -n\
-c ';SELECT view_name, basename(filepath), visible FROM lnav_view_files' \
-c ';SELECT view_name, basename(filepath), visible FROM lnav_view_files' \
test-logs.tgz
test-logs.tgz
@ -196,7 +198,7 @@ log logfile_access_log.0 1
log logfile_access_log.1 1
log logfile_access_log.1 1
EOF
EOF
run_test env TMPDIR = tmp ${ lnav_test } -n \
run_test env TMPDIR = logfile- tmp ${ lnav_test } -n \
test-logs-trunc.tgz
test-logs-trunc.tgz
sed -e " s| ${ builddir } ||g " ` test_err_filename` | head -2 \
sed -e " s| ${ builddir } ||g " ` test_err_filename` | head -2 \