2014-03-07 13:20:49 +00:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
export HOME="./sessions"
|
2021-08-29 15:46:10 +00:00
|
|
|
unset XDG_CONFIG_HOME
|
2020-04-25 14:32:05 +00:00
|
|
|
rm -rf "./sessions"
|
2014-03-07 13:20:49 +00:00
|
|
|
mkdir -p $HOME
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2020-10-29 04:23:25 +00:00
|
|
|
-c ":reset-session" \
|
|
|
|
-c ":goto 0" \
|
|
|
|
-c ":hide-file" \
|
|
|
|
-c ":save-session" \
|
|
|
|
${test_dir}/logfile_access_log.*
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
# hidden file saved in session
|
|
|
|
run_cap_test ${lnav_test} -n \
|
2020-10-29 04:23:25 +00:00
|
|
|
-c ":load-session" \
|
|
|
|
${test_dir}/logfile_access_log.*
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
# setting log_mark
|
|
|
|
run_cap_test ${lnav_test} -nq \
|
2019-03-21 14:46:51 +00:00
|
|
|
-c ":reset-session" \
|
2014-03-07 13:20:49 +00:00
|
|
|
-c ";update access_log set log_mark = 1 where sc_bytes > 60000" \
|
|
|
|
-c ":goto 1" \
|
|
|
|
-c ":partition-name middle" \
|
2014-03-15 19:32:29 +00:00
|
|
|
-c ":save-session" \
|
2014-03-07 13:20:49 +00:00
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-07-21 05:01:17 +00:00
|
|
|
run_cap_test ${lnav_test} -nq \
|
|
|
|
-c ";update access_log set log_mark = 1 where sc_bytes > 60000" \
|
|
|
|
-c ":goto 1" \
|
|
|
|
-c ":export-session-to -" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-07-22 22:31:08 +00:00
|
|
|
run_cap_test ${lnav_test} -nq \
|
|
|
|
-c ";update access_log set log_mark = 1 where sc_bytes > 60000" \
|
|
|
|
-c ":set-min-log-level debug" \
|
|
|
|
-c ":hide-lines-before 2005" \
|
|
|
|
-c ":hide-lines-after 2030" \
|
|
|
|
-c ":filter-out blah" \
|
|
|
|
-c "/foobar" \
|
|
|
|
-c ":goto 1" \
|
|
|
|
-c ":export-session-to exported-session.0.lnav" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
|
|
|
run_cap_test ${lnav_test} -n \
|
|
|
|
-c "|exported-session.0.lnav" \
|
|
|
|
-c ";SELECT * FROM lnav_view_filters" \
|
|
|
|
-c ":write-screen-to -" \
|
|
|
|
-c ";SELECT name,search FROM lnav_views" \
|
|
|
|
-c ":write-screen-to -" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
# log mark was not saved in session
|
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-03-15 19:32:29 +00:00
|
|
|
-c ":load-session" \
|
2014-03-07 13:20:49 +00:00
|
|
|
-c ':write-to -' \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
# file was not closed
|
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-03-19 05:47:36 +00:00
|
|
|
-c ":load-session" \
|
|
|
|
-c ":close" \
|
|
|
|
-c ":save-session" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
# partition name was not saved in session
|
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-03-15 19:32:29 +00:00
|
|
|
-c ":load-session" \
|
2014-03-07 13:20:49 +00:00
|
|
|
-c ';select log_line,log_part from access_log' \
|
|
|
|
-c ':write-csv-to -' \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
# adjust time is not working
|
|
|
|
run_cap_test ${lnav_test} -nq \
|
2014-03-09 09:29:28 +00:00
|
|
|
-c ":adjust-log-time 2010-01-01T00:00:00" \
|
2014-03-15 19:32:29 +00:00
|
|
|
-c ":save-session" \
|
2014-03-09 09:29:28 +00:00
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
# adjust time is not saved in session
|
|
|
|
run_cap_test ${lnav_test} -n \
|
2014-03-15 19:32:29 +00:00
|
|
|
-c ":load-session" \
|
2022-04-30 20:05:42 +00:00
|
|
|
-c ":test-comment adjust time in session" \
|
2014-03-09 09:29:28 +00:00
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
# hiding fields failed
|
2017-04-16 04:11:11 +00:00
|
|
|
rm -rf ./sessions
|
|
|
|
mkdir -p $HOME
|
2022-04-30 20:05:42 +00:00
|
|
|
run_cap_test ${lnav_test} -nq -d /tmp/lnav.err \
|
2017-04-16 04:11:11 +00:00
|
|
|
-c ":hide-fields c_ip" \
|
|
|
|
-c ":save-session" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
# restoring hidden fields failed
|
|
|
|
run_cap_test ${lnav_test} -n \
|
2017-04-16 04:11:11 +00:00
|
|
|
-c ":load-session" \
|
2022-04-30 20:05:42 +00:00
|
|
|
-c ":test-comment restoring hidden fields" \
|
2017-04-16 04:11:11 +00:00
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
# hiding fields failed
|
2017-04-16 04:11:11 +00:00
|
|
|
rm -rf ./sessions
|
|
|
|
mkdir -p $HOME
|
2022-04-30 20:05:42 +00:00
|
|
|
run_cap_test ${lnav_test} -nq -d /tmp/lnav.err \
|
2017-04-16 04:11:11 +00:00
|
|
|
-c ":hide-lines-before 2009-07-20 22:59:29" \
|
|
|
|
-c ":save-session" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
# XXX we don't actually check
|
|
|
|
# restoring hidden fields failed
|
|
|
|
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
|
2017-04-16 04:11:11 +00:00
|
|
|
-c ":load-session" \
|
2022-04-30 20:05:42 +00:00
|
|
|
-c ":test-comment restore hidden lines" \
|
2017-04-16 04:11:11 +00:00
|
|
|
${test_dir}/logfile_access_log.0
|