summaryrefslogtreecommitdiffstats
path: root/test/test_json_format.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:01:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:01:36 +0000
commit62e4c68907d8d33709c2c1f92a161dff00b3d5f2 (patch)
treeadbbaf3acf88ea08f6eeec4b75ee98ad3b07fbdc /test/test_json_format.sh
parentInitial commit. (diff)
downloadlnav-62e4c68907d8d33709c2c1f92a161dff00b3d5f2.tar.xz
lnav-62e4c68907d8d33709c2c1f92a161dff00b3d5f2.zip
Adding upstream version 0.11.2.upstream/0.11.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/test_json_format.sh')
-rw-r--r--test/test_json_format.sh156
1 files changed, 156 insertions, 0 deletions
diff --git a/test/test_json_format.sh b/test/test_json_format.sh
new file mode 100644
index 0000000..435e8e3
--- /dev/null
+++ b/test/test_json_format.sh
@@ -0,0 +1,156 @@
+#! /bin/bash
+
+export YES_COLOR=1
+
+# journald json log format is not working"
+run_cap_test env TZ=UTC ${lnav_test} -n \
+ -I ${test_dir} \
+ ${test_dir}/logfile_journald.json
+
+# json log format is not working"
+run_cap_test ${lnav_test} -n \
+ -I ${test_dir} \
+ ${test_dir}/logfile_json.json
+
+run_cap_test ${lnav_test} -n \
+ -I ${test_dir} \
+ -c ':filter-in up service' \
+ ${test_dir}/logfile_json.json
+
+# json log format is not working"
+run_cap_test ${lnav_test} -n -I ${test_dir} \
+ -c ':switch-to-view pretty' \
+ -c ':switch-to-view log' \
+ -c ':switch-to-view pretty' \
+ ${test_dir}/logfile_json.json
+
+# multi-line-format json log format is not working"
+run_cap_test ${lnav_test} -n \
+ -I ${test_dir} \
+ ${test_dir}/log.clog
+
+# log levels not working"
+run_cap_test ${lnav_test} -n \
+ -I ${test_dir} \
+ -c ';select * from test_log' \
+ -c ':write-csv-to -' \
+ ${test_dir}/logfile_json.json
+
+# log levels not working" < ${test_dir}/logfile_jso
+run_cap_test ${lnav_test} -n \
+ -I ${test_dir} \
+ -c ';select log_raw_text from test_log' \
+ -c ':write-raw-to -' \
+ ${test_dir}/logfile_json.json
+
+# write-raw-to with json is not working" <
+run_cap_test ${lnav_test} -n \
+ -I ${test_dir} \
+ -c ':goto 0' \
+ -c ':mark' \
+ -c ':goto 1' \
+ -c ':mark' \
+ -c ':goto 2' \
+ -c ':mark' \
+ -c ':write-raw-to -' \
+ ${test_dir}/log.clog
+
+# json output not working"
+run_cap_test ${lnav_test} -n \
+ -I ${test_dir} \
+ -c ';select * from test_log' \
+ -c ':write-json-to -' \
+ ${test_dir}/logfile_json.json
+
+# timestamp-format not working"
+run_cap_test ${lnav_test} -n \
+ -I ${test_dir} \
+ ${test_dir}/logfile_json2.json
+
+# log levels not working"
+run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
+ -I ${test_dir} \
+ -c ';select * from json_log2' \
+ -c ':write-csv-to -' \
+ ${test_dir}/logfile_json2.json
+
+# pipe-line-to is not working"
+run_cap_test ${lnav_test} -n \
+ -I ${test_dir} \
+ -c ":goto 4" \
+ -c ":pipe-line-to sed -e 's/2013//g'" \
+ -c ":switch-to-view text" \
+ ${test_dir}/logfile_json.json
+
+# json log format is not working"
+run_cap_test ${lnav_test} -n \
+ -I ${test_dir} \
+ ${test_dir}/logfile_nested_json.json
+
+# log levels not working"
+run_cap_test ${lnav_test} -n \
+ -I ${test_dir} \
+ -c ';select * from ntest_log' \
+ -c ':write-csv-to -' \
+ ${test_dir}/logfile_nested_json.json
+
+# pipe-line-to is not working"
+run_cap_test ${lnav_test} -n \
+ -I ${test_dir} \
+ -c ":goto 4" \
+ -c ":pipe-line-to sed -e 's/2013//g'" \
+ -c ":switch-to-view text" \
+ ${test_dir}/logfile_nested_json.json
+
+# json log3 format is not working"
+run_cap_test env TZ=UTC ${lnav_test} -n \
+ -I ${test_dir} \
+ ${test_dir}/logfile_json3.json
+
+# json log3 format is not working"
+run_cap_test env TZ=UTC ${lnav_test} -n \
+ -I ${test_dir} \
+ -c ';select * from json_log3' \
+ -c ':write-csv-to -' \
+ ${test_dir}/logfile_json3.json
+
+run_cap_test env TZ=America/New_York ${lnav_test} -n \
+ -I ${test_dir} \
+ ${test_dir}/logfile_json3.json
+
+# json log3 format is not working"
+run_cap_test env TZ=America/New_York ${lnav_test} -n \
+ -I ${test_dir} \
+ -c ';select * from json_log3' \
+ -c ':write-csv-to -' \
+ ${test_dir}/logfile_json3.json
+
+# json log format is not working"
+run_cap_test ${lnav_test} -n \
+ -d /tmp/lnav.err \
+ -I ${test_dir} \
+ ${test_dir}/logfile_invalid_json.json
+
+# json log format is not working"
+run_cap_test ${lnav_test} -n \
+ -d /tmp/lnav.err \
+ -I ${test_dir} \
+ ${test_dir}/logfile_invalid_json2.json
+
+run_cap_test ${lnav_test} -n \
+ -I ${test_dir} \
+ ${test_dir}/logfile_mixed_json2.json
+
+run_cap_test ${lnav_test} -n \
+ -I ${test_dir} \
+ ${test_dir}/logfile_json_subsec.json
+
+run_cap_test ${lnav_test} -n \
+ ${test_dir}/logfile_bunyan.0
+
+run_cap_test ${lnav_test} -n \
+ ${test_dir}/logfile_cloudflare.json
+
+run_cap_test ${lnav_test} -n \
+ -c ':show-fields RayID' \
+ ${test_dir}/logfile_cloudflare.json