2018-05-17 14:06:50 +00:00
|
|
|
#! /bin/bash
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
export YES_COLOR=1
|
2018-05-17 14:06:50 +00:00
|
|
|
|
|
|
|
export HOME="./meta-sessions"
|
2021-08-29 14:35:55 +00:00
|
|
|
export XDG_CONFIG_HOME="./meta-sessions/.config"
|
2018-05-17 14:06:50 +00:00
|
|
|
rm -rf "./meta-sessions"
|
2019-08-01 14:14:47 +00:00
|
|
|
mkdir -p $HOME/.config
|
2018-05-17 14:06:50 +00:00
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
# add comment/tag
|
|
|
|
run_cap_test ${lnav_test} -n -dln.dbg \
|
2018-05-17 14:06:50 +00:00
|
|
|
-c ":comment Hello, World!" \
|
|
|
|
-c ":tag foo" \
|
|
|
|
-c ":save-session" \
|
2019-01-29 15:30:37 +00:00
|
|
|
-c ":write-screen-to -" \
|
2018-05-17 14:06:50 +00:00
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2021-08-29 05:50:52 +00:00
|
|
|
ls -lha meta-sessions
|
|
|
|
find meta-sessions
|
2022-04-12 23:07:13 +00:00
|
|
|
# cat ln.dbg
|
2019-08-01 14:14:47 +00:00
|
|
|
if test ! -d meta-sessions/.config/lnav; then
|
|
|
|
echo "error: configuration not stored in .config/lnav?"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -d meta-sessions/.lnav; then
|
|
|
|
echo "error: configuration stored in .lnav?"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
# tag was saved and :write-to displays the comments/tags
|
|
|
|
run_cap_test ${lnav_test} -n \
|
2018-05-17 14:06:50 +00:00
|
|
|
-c ":load-session" \
|
2018-11-22 01:00:28 +00:00
|
|
|
-c ";UPDATE access_log SET log_mark = 1" \
|
|
|
|
-c ":write-to -" \
|
2018-05-17 14:06:50 +00:00
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2018-05-17 14:06:50 +00:00
|
|
|
-c ":load-session" \
|
|
|
|
-c ":untag #foo" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2018-05-17 14:06:50 +00:00
|
|
|
-c ":load-session" \
|
|
|
|
-c ":clear-comment" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
# search for a tag
|
|
|
|
run_cap_test ${lnav_test} -n \
|
2018-05-17 14:06:50 +00:00
|
|
|
-c ":goto 2" \
|
|
|
|
-c "/foo" \
|
|
|
|
-c ":tag #foo" \
|
|
|
|
-c ":goto 0" \
|
|
|
|
-c ":next-mark search" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
# query meta columns
|
|
|
|
run_cap_test ${lnav_test} -n \
|
2018-05-17 14:06:50 +00:00
|
|
|
-c ":load-session" \
|
|
|
|
-c ";SELECT log_line, log_comment, log_tags FROM access_log" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2019-02-01 21:31:28 +00:00
|
|
|
-c ";UPDATE access_log SET log_tags = json_array('#foo', '#foo') WHERE log_line = 1" \
|
|
|
|
-c ":save-session" \
|
2018-05-17 14:06:50 +00:00
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
run_cap_test ${lnav_test} -n \
|
|
|
|
-c ";UPDATE access_log SET log_comment = 'Goodbye, World!' WHERE log_line = 1" \
|
2018-05-17 14:06:50 +00:00
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2018-05-17 14:06:50 +00:00
|
|
|
-c ";UPDATE access_log SET log_tags = 1 WHERE log_line = 1" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2019-02-01 21:31:28 +00:00
|
|
|
-c ";UPDATE access_log SET log_tags = json_array('foo') WHERE log_line = 1" \
|
|
|
|
-c ":save-session" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2019-02-01 21:31:28 +00:00
|
|
|
-c ":load-session" \
|
|
|
|
-c ";SELECT log_tags FROM access_log WHERE log_line = 1" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2021-02-01 05:59:48 +00:00
|
|
|
-c ":tag foo" \
|
|
|
|
-c ":delete-tags #foo" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2018-05-17 14:06:50 +00:00
|
|
|
-c ":tag foo" \
|
|
|
|
-c ";UPDATE access_log SET log_tags = null" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
|
|
|
|
2022-04-30 20:05:42 +00:00
|
|
|
run_cap_test ${lnav_test} -n \
|
2018-05-17 14:06:50 +00:00
|
|
|
-c ":comment foo" \
|
|
|
|
-c ";UPDATE access_log SET log_comment = null" \
|
|
|
|
${test_dir}/logfile_access_log.0
|
2022-08-20 03:01:25 +00:00
|
|
|
|
|
|
|
run_cap_test ${lnav_test} -d /tmp/lnav.err -n \
|
|
|
|
-I ${test_dir} \
|
|
|
|
${test_dir}/logfile_xml_msg.0
|
2022-08-29 01:55:32 +00:00
|
|
|
|
|
|
|
run_cap_test ${lnav_test} -n -f- \
|
|
|
|
${test_dir}/logfile_access_log.0 <<'EOF'
|
|
|
|
:comment Hello, **World**!
|
|
|
|
|
|
|
|
This is `markdown` now!
|
|
|
|
EOF
|