2014-03-03 04:52:18 +04:00
|
|
|
#! /bin/bash
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
export YES_COLOR=1
|
|
|
|
|
|
|
|
run_cap_test ${lnav_test} -n \
|
|
|
|
-c ":switch-to-view help" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-08-19 02:09:45 +03:00
|
|
|
run_cap_test env TZ=UTC ${lnav_test} -n \
|
|
|
|
-c ":goto 2011-11-03 00:19:39" \
|
2022-08-18 23:27:49 +03:00
|
|
|
-c ";SELECT log_top_line()" \
|
|
|
|
${test_dir}/logfile_bro_http.log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2021-06-03 07:09:50 +03:00
|
|
|
-c ":goto 1" \
|
|
|
|
-c ":mark" \
|
|
|
|
-c ":hide-unmarked-lines" \
|
|
|
|
-c ":goto 0" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2021-01-31 09:24:11 +03:00
|
|
|
-c ":unix-time" \
|
|
|
|
"${test_dir}/logfile_access_log.*"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2021-01-31 09:50:57 +03:00
|
|
|
-c ":unix-time abc" \
|
|
|
|
"${test_dir}/logfile_access_log.*"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test env TZ=UTC ${lnav_test} -n \
|
2021-01-31 09:24:11 +03:00
|
|
|
-c ":unix-time 1612072409" \
|
|
|
|
"${test_dir}/logfile_access_log.*"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test env TZ=UTC ${lnav_test} -n \
|
2021-02-01 08:59:48 +03:00
|
|
|
-c ":current-time" \
|
|
|
|
"${test_dir}/logfile_access_log.*"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
|
2021-02-01 08:59:48 +03:00
|
|
|
-c ":write-to" \
|
|
|
|
"${test_dir}/logfile_access_log.*"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
|
2020-12-29 09:31:11 +03:00
|
|
|
-c ";SELECT 1 AS c1, 'Hello ' || char(10) || 'World!' AS c2" \
|
|
|
|
-c ":write-csv-to -" \
|
|
|
|
"${test_dir}/logfile_access_log.*"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
|
2021-02-01 08:59:48 +03:00
|
|
|
-c ";SELECT 1 AS c1, 'Hello, World!' AS c2" \
|
2021-02-26 02:47:36 +03:00
|
|
|
-c ":write-table-to -" \
|
2021-02-01 08:59:48 +03:00
|
|
|
"${test_dir}/logfile_access_log.*"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
|
2021-02-01 08:59:48 +03:00
|
|
|
-c ";SELECT 1 AS c1, 'Hello, World!' AS c2" \
|
|
|
|
-c ":write-raw-to -" \
|
|
|
|
"${test_dir}/logfile_access_log.*"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
|
2021-05-14 23:31:19 +03:00
|
|
|
-c ":write-view-to -" \
|
2021-02-01 08:59:48 +03:00
|
|
|
"${test_dir}/logfile_access_log.0"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
|
2021-06-18 19:04:53 +03:00
|
|
|
-c ":filter-expr timeslice(:log_time_msecs, 'bad') is not null" \
|
|
|
|
"${test_dir}/logfile_multiline.0"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
|
2020-11-30 00:20:07 +03:00
|
|
|
-c ":filter-expr :log_text LIKE '%How are%'" \
|
|
|
|
"${test_dir}/logfile_multiline.0"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
|
2021-09-28 01:54:10 +03:00
|
|
|
-c ":filter-expr not json_contains(:log_tags, '#bad')" \
|
|
|
|
-c ":goto 0" \
|
|
|
|
-c ":tag #bad" \
|
|
|
|
"${test_dir}/logfile_access_log.0"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
|
2020-11-30 00:20:07 +03:00
|
|
|
-c ":filter-expr :sc_bytes > 2000" \
|
|
|
|
"${test_dir}/logfile_access_log.*"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
|
2020-11-30 00:20:07 +03:00
|
|
|
-c ":filter-expr :sc_bytes # ff" \
|
|
|
|
"${test_dir}/logfile_access_log.*"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
|
2020-10-29 07:22:56 +03:00
|
|
|
-c ":goto 0" \
|
|
|
|
-c ":close" \
|
|
|
|
-c ":goto 0" \
|
|
|
|
"${test_dir}/logfile_access_log.*"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
|
2020-10-29 07:18:57 +03:00
|
|
|
-c ":goto 0" \
|
|
|
|
-c ":hide-file" \
|
|
|
|
${test_dir}/logfile_access_log.*
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
|
2018-12-14 17:18:31 +03:00
|
|
|
-c ":goto 0" \
|
|
|
|
-c ":next-mark error" \
|
|
|
|
-c ":prev-location" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
|
2018-12-14 17:18:31 +03:00
|
|
|
-c ":goto 0" \
|
|
|
|
-c ":next-mark error" \
|
|
|
|
-c ":prev-location" \
|
|
|
|
-c ":next-location" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
|
2021-02-01 08:59:48 +03:00
|
|
|
-c ":filter-in vmk" \
|
|
|
|
-c ":disable-filter vmk" \
|
2022-06-11 16:43:55 +03:00
|
|
|
-c ":goto 0" \
|
2021-02-01 08:59:48 +03:00
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
|
2018-10-08 17:43:08 +03:00
|
|
|
-c ":filter-in vmk" \
|
|
|
|
-c ":rebuild" \
|
|
|
|
-c ":reset-session" \
|
|
|
|
-c ":rebuild" \
|
2022-06-11 16:43:55 +03:00
|
|
|
-c ":goto 0" \
|
2018-10-08 17:43:08 +03:00
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
|
2020-10-03 07:17:52 +03:00
|
|
|
-c ":goto 0" \
|
|
|
|
-c ":filter-out vmk" \
|
|
|
|
-c ":toggle-filtering" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2017-02-23 17:15:44 +03:00
|
|
|
-c ":hide-fields foobar" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2017-02-23 17:15:44 +03:00
|
|
|
-c ":hide-fields cs_uri_stem" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2017-04-16 07:11:11 +03:00
|
|
|
-c ":hide-fields access_log.c_ip access_log.cs_uri_stem" \
|
2017-02-23 17:15:44 +03:00
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -f- -n < ${test_dir}/formats/scripts/multiline-echo.lnav
|
2016-12-23 22:37:23 +03:00
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2016-01-05 17:18:58 +03:00
|
|
|
-c ":config /bad/option" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -nvq \
|
2016-01-05 17:18:58 +03:00
|
|
|
-c ":config /ui/clock-format" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -nv \
|
2016-01-05 17:18:58 +03:00
|
|
|
-c ":config /ui/clock-format" \
|
|
|
|
-c ":config /ui/clock-format abc" \
|
|
|
|
-c ":config /ui/clock-format" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -nv \
|
2016-01-05 17:18:58 +03:00
|
|
|
-c ":config /ui/clock-format abc" \
|
|
|
|
-c ":reset-config /ui/clock-format" \
|
|
|
|
-c ":config /ui/clock-format" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-12-25 23:03:44 +03:00
|
|
|
-c "|${test_dir}/toplevel.lnav 123 456 789" \
|
2015-12-19 09:39:27 +03:00
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-12-19 09:39:27 +03:00
|
|
|
-f "nonexistent.lnav" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-03-03 04:52:18 +04:00
|
|
|
-c ":adjust-log-time 2010-01-01T00:00:00" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2019-03-12 17:03:32 +03:00
|
|
|
-c ":adjust-log-time -1h" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-06-22 08:16:57 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
|
|
|
-c ':goto 2022-06-16Tabc'
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-03-03 04:52:18 +04:00
|
|
|
-c ":goto 1" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-03-03 04:52:18 +04:00
|
|
|
-c ":goto -1" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-09-14 18:56:42 +03:00
|
|
|
-c ":goto 0" \
|
|
|
|
-c ":goto 2 hours later" \
|
|
|
|
${test_dir}/logfile_syslog_with_mixed_times.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-09-14 18:56:42 +03:00
|
|
|
-c ":goto 0" \
|
|
|
|
-c ":goto 3:45" \
|
|
|
|
${test_dir}/logfile_syslog_with_mixed_times.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-03-13 08:19:23 +04:00
|
|
|
-c ":goto invalid" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-03-25 09:07:47 +03:00
|
|
|
-c ":goto 1" \
|
|
|
|
-c ":relative-goto -1" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-03-30 00:50:34 +03:00
|
|
|
-c ":goto 0" \
|
|
|
|
-c ":next-mark error" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-03-30 00:50:34 +03:00
|
|
|
-c ":goto -1" \
|
|
|
|
-c ":prev-mark error" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-03-30 00:50:34 +03:00
|
|
|
-c ":goto 0" \
|
|
|
|
-c ":next-mark foobar" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-03-03 04:52:18 +04:00
|
|
|
-c ":filter-in vmk" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2016-02-25 10:42:02 +03:00
|
|
|
-c ":filter-in vmk" \
|
|
|
|
-c ":reset-session" \
|
|
|
|
-c ":filter-in cgi" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-03-03 04:52:18 +04:00
|
|
|
-c ":filter-in today" \
|
|
|
|
${test_dir}/logfile_multiline.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-03-03 04:52:18 +04:00
|
|
|
-c ":filter-out vmk" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-03-03 04:52:18 +04:00
|
|
|
-c ":filter-out today" \
|
|
|
|
${test_dir}/logfile_multiline.0
|
|
|
|
|
2014-11-06 17:40:32 +03:00
|
|
|
cp ${test_dir}/logfile_multiline.0 logfile_append.0
|
2014-11-07 07:36:09 +03:00
|
|
|
chmod ug+w logfile_append.0
|
2014-11-06 17:40:32 +03:00
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-11-06 17:40:32 +03:00
|
|
|
-c ";update generic_log set log_mark=1" \
|
|
|
|
-c ":filter-in Goodbye" \
|
|
|
|
-c ":append-to logfile_append.0" \
|
|
|
|
-c ":rebuild" \
|
|
|
|
logfile_append.0
|
|
|
|
|
|
|
|
cp ${test_dir}/logfile_multiline.0 logfile_append.0
|
2014-11-07 07:36:09 +03:00
|
|
|
chmod ug+w logfile_append.0
|
2014-11-06 17:40:32 +03:00
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav-search.err \
|
2017-12-04 19:52:40 +03:00
|
|
|
-c "/goodbye" \
|
|
|
|
-c ";update generic_log set log_mark=1" \
|
|
|
|
-c ":filter-in Goodbye" \
|
|
|
|
-c ":append-to logfile_append.0" \
|
|
|
|
-c ":rebuild" \
|
|
|
|
-c ":next-mark search" \
|
|
|
|
logfile_append.0
|
|
|
|
|
|
|
|
cp ${test_dir}/logfile_multiline.0 logfile_append.0
|
|
|
|
chmod ug+w logfile_append.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-11-06 17:40:32 +03:00
|
|
|
-c ":filter-out Goodbye" \
|
|
|
|
-c ":shexec echo '2009-07-20 22:59:30,221:ERROR:Goodbye, World!' >> logfile_append.0" \
|
|
|
|
-c ":rebuild" \
|
|
|
|
logfile_append.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-08-25 08:09:33 +03:00
|
|
|
-c ":filter-in avahi" \
|
|
|
|
-c ":delete-filter avahi" \
|
2014-12-10 18:03:01 +03:00
|
|
|
-c ":filter-in avahi" \
|
|
|
|
-c ":filter-in dnsmasq" \
|
|
|
|
${test_dir}/logfile_filter.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-03-28 16:30:30 +03:00
|
|
|
-c ":switch-to-view text" \
|
|
|
|
-c ":filter-in World" \
|
|
|
|
${test_dir}/logfile_plain.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-03-28 16:30:30 +03:00
|
|
|
-c ":switch-to-view text" \
|
|
|
|
-c ":filter-out World" \
|
|
|
|
${test_dir}/logfile_plain.0
|
|
|
|
|
2015-08-25 08:09:33 +03:00
|
|
|
TOO_MANY_FILTERS=""
|
2020-11-30 00:20:07 +03:00
|
|
|
for i in `seq 1 32`; do
|
2015-08-25 08:09:33 +03:00
|
|
|
TOO_MANY_FILTERS="$TOO_MANY_FILTERS -c ':filter-out $i'"
|
|
|
|
done
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test eval ${lnav_test} -d /tmp/lnav.err -n \
|
2015-08-25 08:09:33 +03:00
|
|
|
$TOO_MANY_FILTERS \
|
|
|
|
${test_dir}/logfile_filter.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-03-03 04:52:18 +04:00
|
|
|
-c ":close" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-03-13 10:20:18 +04:00
|
|
|
-c ":close" \
|
|
|
|
-c ":close" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2021-02-01 08:59:48 +03:00
|
|
|
-c ":open" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-03-03 04:52:18 +04:00
|
|
|
-c ":close" \
|
|
|
|
-c ":open ${test_dir}/logfile_multiline.0" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-03-12 19:44:02 +04:00
|
|
|
-c ":close" \
|
2014-03-12 20:22:30 +04:00
|
|
|
-c ":open /non-existent" \
|
2014-03-12 19:44:02 +04:00
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2018-05-19 08:11:40 +03:00
|
|
|
-c ":goto 1" \
|
2019-01-29 18:30:37 +03:00
|
|
|
-c ":write-screen-to -" \
|
2018-05-19 08:11:40 +03:00
|
|
|
"${test_dir}/logfile_access_log.0"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-03-11 16:37:13 +04:00
|
|
|
-c ";select * from access_log" \
|
|
|
|
-c ':write-json-to -' \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2020-08-22 09:18:51 +03:00
|
|
|
-c ";select * from access_log" \
|
|
|
|
-c ':write-jsonlines-to -' \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2016-04-23 05:48:17 +03:00
|
|
|
# By setting the LNAVSECURE mode before executing the command, we will disable
|
|
|
|
# the access to the write-json-to command and the output would just be the
|
|
|
|
# actual display of select query rather than json output.
|
|
|
|
export LNAVSECURE=1
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test env TEST_COMMENT="secure mode write test" ${lnav_test} -n \
|
2016-04-23 05:48:17 +03:00
|
|
|
-c ";select * from access_log" \
|
2022-07-20 09:48:25 +03:00
|
|
|
-c ':write-json-to /tmp/bad' \
|
2016-04-23 05:48:17 +03:00
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
|
|
|
unset LNAVSECURE
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-03-16 19:16:49 +03:00
|
|
|
-c ";update generic_log set log_mark=1" \
|
2016-03-07 10:58:37 +03:00
|
|
|
-c ":pipe-to sed -e 's/World!/Bork!/g' -e 's/2009//g'" \
|
2015-03-16 19:16:49 +03:00
|
|
|
${test_dir}/logfile_multiline.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2018-10-11 17:09:52 +03:00
|
|
|
-c ":echo Hello, World!" \
|
2015-03-16 19:16:49 +03:00
|
|
|
-c ":goto 2" \
|
2016-03-07 10:58:37 +03:00
|
|
|
-c ":pipe-line-to sed -e 's/World!/Bork!/g' -e 's/2009//g'" \
|
2015-03-16 19:16:49 +03:00
|
|
|
${test_dir}/logfile_multiline.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-03-20 08:16:55 +03:00
|
|
|
-c ":goto 0" \
|
|
|
|
-c ":pipe-line-to echo \$cs_uri_stem \$sc_status" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
2015-03-16 19:16:49 +03:00
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-08-19 06:58:20 +03:00
|
|
|
-c ":switch-to-view pretty" \
|
|
|
|
${test_dir}/textfile_json_one_line.0
|
2022-05-23 06:44:18 +03:00
|
|
|
|
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-08-19 06:58:20 +03:00
|
|
|
-c ":switch-to-view pretty" \
|
|
|
|
${test_dir}/textfile_json_one_line.0
|
2022-05-23 06:44:18 +03:00
|
|
|
|
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-08-27 07:28:30 +03:00
|
|
|
-c ":switch-to-view pretty" \
|
|
|
|
${test_dir}/textfile_quoted_json.0
|
2022-05-23 06:44:18 +03:00
|
|
|
|
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-04-05 21:00:13 +03:00
|
|
|
-c ":switch-to-view pretty" \
|
|
|
|
${test_dir}/logfile_vami.0
|
2022-05-23 06:44:18 +03:00
|
|
|
|
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-04-08 07:25:01 +03:00
|
|
|
-c ":goto 0" \
|
|
|
|
-c ":switch-to-view pretty" \
|
|
|
|
${test_dir}/logfile_pretty.0
|
2022-05-23 06:44:18 +03:00
|
|
|
|
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-03-16 13:46:17 +04:00
|
|
|
-c ":set-min-log-level error" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-10-30 06:53:23 +03:00
|
|
|
-c ":highlight foobar" \
|
|
|
|
-c ":clear-highlight foobar" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-10-30 06:53:23 +03:00
|
|
|
-c ":clear-highlight foobar" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2016-08-26 07:20:48 +03:00
|
|
|
-c ":zoom-to 4-hour" \
|
|
|
|
${test_dir}/textfile_json_indented.0
|
|
|
|
|
2017-04-24 17:29:55 +03:00
|
|
|
cp ${test_dir}/logfile_rollover.1 logfile_rollover.1.live
|
|
|
|
chmod ug+w logfile_rollover.1.live
|
|
|
|
touch -t 200711030923 logfile_rollover.1.live
|
2017-04-24 17:03:46 +03:00
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2017-04-24 17:29:55 +03:00
|
|
|
-c ":shexec echo 'Jan 3 09:23:38 veridian automount[16442]: attempting to mount entry /auto/opt' >> logfile_rollover.1.live" \
|
2017-04-24 17:03:46 +03:00
|
|
|
-c ":rebuild" \
|
|
|
|
-c ":switch-to-view histogram" \
|
2018-10-08 17:43:08 +03:00
|
|
|
-c ":goto 0" \
|
2017-04-24 17:29:55 +03:00
|
|
|
logfile_rollover.1.live
|
2017-04-24 17:03:46 +03:00
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2018-08-12 18:37:16 +03:00
|
|
|
-c ":goto 0" \
|
|
|
|
-c ":goto next year" \
|
|
|
|
logfile_rollover.1.live
|
|
|
|
|
2015-04-05 00:06:32 +03:00
|
|
|
touch -t 200711030923 ${srcdir}/logfile_syslog.0
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-04-04 23:36:53 +03:00
|
|
|
-c ":switch-to-view histogram" \
|
|
|
|
-c ":zoom-to 4-hour" \
|
|
|
|
${test_dir}/logfile_syslog.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-04-04 23:36:53 +03:00
|
|
|
-c ":switch-to-view histogram" \
|
2016-03-21 01:15:50 +03:00
|
|
|
-c ":zoom-to 1-day" \
|
2015-04-04 23:36:53 +03:00
|
|
|
${test_dir}/logfile_syslog.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-04-04 23:36:53 +03:00
|
|
|
-c ":filter-in sudo" \
|
|
|
|
-c ":switch-to-view histogram" \
|
|
|
|
-c ":zoom-to 4-hour" \
|
|
|
|
${test_dir}/logfile_syslog.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2021-05-14 08:00:26 +03:00
|
|
|
-c ":mark-expr" \
|
|
|
|
${test_dir}/logfile_syslog.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2021-05-14 08:00:26 +03:00
|
|
|
-c ":mark-expr :log_procname lik" \
|
|
|
|
${test_dir}/logfile_syslog.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2021-05-14 08:00:26 +03:00
|
|
|
-c ":mark-expr :cs_uri_stem LIKE '%vmk%'" \
|
|
|
|
-c ":write-to -" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2017-04-11 17:25:54 +03:00
|
|
|
-c ":goto 0" \
|
|
|
|
-c ":mark" \
|
|
|
|
-c ":switch-to-view histogram" \
|
|
|
|
${test_dir}/logfile_syslog.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-04-04 23:36:53 +03:00
|
|
|
-c ":zoom-to bad" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-04-08 08:13:44 +03:00
|
|
|
-f ${test_dir}/multiline.lnav \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
printf "Hello, World!" | run_cap_test env TEST_COMMENT="text view" ${lnav_test} -n \
|
2015-04-22 08:25:54 +03:00
|
|
|
-c ":switch-to-view text"
|
2015-12-06 07:38:21 +03:00
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -Nnv \
|
2021-06-03 07:09:50 +03:00
|
|
|
-c ":hide-lines-before 2009-07-20T22:59:29" \
|
|
|
|
-c ":hide-lines-before"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -Nnv \
|
2021-06-03 07:09:50 +03:00
|
|
|
-c ":hide-lines-after 2009-07-20T22:59:29" \
|
|
|
|
-c ":hide-lines-after"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -Nnv \
|
2021-06-03 07:09:50 +03:00
|
|
|
-c ":hide-lines-before 2009-07-20T22:00:29" \
|
|
|
|
-c ":hide-lines-after 2009-07-20T22:59:29" \
|
|
|
|
-c ":hide-lines-before"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-12-06 07:38:21 +03:00
|
|
|
-c ":hide-lines-before 2009-07-20T22:59:29" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-12-06 07:38:21 +03:00
|
|
|
-c ":hide-lines-after 2009-07-20T22:59:26" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-12-06 07:38:21 +03:00
|
|
|
-c ":hide-lines-after 2009-07-20T22:59:26" \
|
|
|
|
-c ":show-lines-before-and-after" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2015-12-19 09:39:27 +03:00
|
|
|
export XYZ="World"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2021-02-26 02:47:36 +03:00
|
|
|
-c ':echo Hello, \$XYZ!' \
|
2015-12-19 09:39:27 +03:00
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
|
|
|
export XYZ="World"
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2015-12-19 09:39:27 +03:00
|
|
|
-c ':echo -n Hello, ' \
|
|
|
|
-c ':echo World!' \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-05-23 06:44:18 +03:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2021-02-26 02:47:36 +03:00
|
|
|
-c ':echo Hello, $XYZ!' \
|
2015-12-19 09:39:27 +03:00
|
|
|
${test_dir}/logfile_access_log.0
|