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