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