summaryrefslogtreecommitdiffstats
path: root/test/test_events.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:44:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:44:55 +0000
commit5068d34c08f951a7ea6257d305a1627b09a95817 (patch)
tree08213e2be853396a3b07ce15dbe222644dcd9a89 /test/test_events.sh
parentInitial commit. (diff)
downloadlnav-5068d34c08f951a7ea6257d305a1627b09a95817.tar.xz
lnav-5068d34c08f951a7ea6257d305a1627b09a95817.zip
Adding upstream version 0.11.1.upstream/0.11.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/test_events.sh')
-rw-r--r--test/test_events.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/test_events.sh b/test/test_events.sh
new file mode 100644
index 0000000..2266c4b
--- /dev/null
+++ b/test/test_events.sh
@@ -0,0 +1,31 @@
+#! /bin/bash
+
+rm -rf events-home
+mkdir -p events-home
+export HOME=events-home
+export YES_COLOR=1
+
+run_cap_test ${lnav_test} -n \
+ -c ';SELECT json(content) as content FROM lnav_events' \
+ -c ':write-jsonlines-to -' \
+ ${test_dir}/logfile_access_log.0
+
+run_cap_test ${lnav_test} -nN \
+ -c ':config /log/watch-expressions/http-errors/expr sc_status >= 400 AND bad'
+
+run_cap_test ${lnav_test} -nN \
+ -c ':config /log/watch-expressions/http-errors/expr :sc_status >= 400'
+
+run_cap_test env TEST_COMMENT="watch expression generate detect event" ${lnav_test} -n \
+ -c ';SELECT json(content) as content FROM lnav_events' \
+ -c ':write-jsonlines-to -' \
+ ${test_dir}/logfile_access_log.0
+
+run_cap_test env TEST_COMMENT="show the configuration" ${lnav_test} -nN \
+ -c ':config /log/watch-expressions'
+
+run_cap_test env TEST_COMMENT="delete the configuration" ${lnav_test} -nN \
+ -c ':reset-config /log/watch-expressions/http-errors/'
+
+run_cap_test env TEST_COMMENT="config should be gone now" ${lnav_test} -nN \
+ -c ':config /log/watch-expressions'