2015-07-20 13:33:52 +00:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
lnav_test="${top_builddir}/src/lnav-test"
|
|
|
|
|
|
|
|
|
2017-04-24 13:18:04 +00:00
|
|
|
run_test ${lnav_test} -C \
|
|
|
|
-I ${test_dir}/bad-config-json
|
|
|
|
|
|
|
|
sed -i "" -e "s|/.*/format|format|g" `test_err_filename`
|
|
|
|
|
|
|
|
check_error_output "invalid format not detected?" <<EOF
|
|
|
|
warning:format.json:line 5
|
2018-05-17 14:06:50 +00:00
|
|
|
warning: unexpected path --
|
|
|
|
warning: /invalid_key_log/value/test/identifiers
|
|
|
|
warning: accepted paths --
|
|
|
|
warning: kind string|integer|float|boolean|json|quoted -- The type of data in the field
|
|
|
|
warning: collate <function> -- The collating function to use for this column
|
2020-05-07 14:08:59 +00:00
|
|
|
warning: unit -- Unit definitions for this field
|
2018-05-17 14:06:50 +00:00
|
|
|
warning: identifier <bool> -- Indicates whether or not this field contains an identifier that should be highlighted
|
|
|
|
warning: foreign-key <bool> -- Indicates whether or not this field should be treated as a foreign key for row in another table
|
|
|
|
warning: hidden <bool> -- Indicates whether or not this field should be hidden
|
2020-05-07 14:08:59 +00:00
|
|
|
warning: action-list <string> -- Actions to execute when this field is clicked on
|
2018-05-17 14:06:50 +00:00
|
|
|
warning: rewriter <command> -- A command that will rewrite this field when pretty-printing
|
|
|
|
warning: description <string> -- A description of the field
|
2017-04-24 13:18:04 +00:00
|
|
|
error:format.json:4:invalid json -- parse error: object key and value must be separated by a colon (':')
|
|
|
|
ar_log": { "abc" } }
|
|
|
|
(right here) ------^
|
2020-12-19 06:35:23 +00:00
|
|
|
error:foobar_log: no regexes specified for format
|
|
|
|
error:foobar_log:no sample logs provided, all formats must have samples
|
|
|
|
error:invalid_key_log: no regexes specified for format
|
|
|
|
error:invalid_key_log:no sample logs provided, all formats must have samples
|
2017-04-24 13:18:04 +00:00
|
|
|
EOF
|
|
|
|
|
2015-07-20 13:33:52 +00:00
|
|
|
run_test ${lnav_test} -C \
|
|
|
|
-I ${test_dir}/bad-config
|
|
|
|
|
2020-12-19 06:35:23 +00:00
|
|
|
sed -i "" -e "s|/.*/init.sql|init.sql|g" \
|
|
|
|
-e "s|/.*/format|format|g" \
|
|
|
|
`test_err_filename`
|
2015-11-27 06:19:53 +00:00
|
|
|
|
2015-07-20 13:33:52 +00:00
|
|
|
check_error_output "invalid format not detected?" <<EOF
|
2020-12-19 06:35:23 +00:00
|
|
|
error:format.json:line 18
|
|
|
|
Invalid value, 'foo', for option:
|
|
|
|
/bad_sample_log/value/pid/kind string|integer|float|boolean|json|quoted -- The type of data in the field
|
|
|
|
Allowed values:
|
|
|
|
string
|
|
|
|
integer
|
|
|
|
float
|
|
|
|
boolean
|
|
|
|
json
|
|
|
|
struct
|
|
|
|
quoted
|
2021-02-07 06:13:08 +00:00
|
|
|
xml
|
2015-07-20 13:33:52 +00:00
|
|
|
error:bad_regex_log.regex[std]:missing )
|
2016-10-21 15:57:51 +00:00
|
|
|
error:bad_regex_log.regex[std]:^(?<timestamp>\d+: (?<body>.*)$
|
|
|
|
error:bad_regex_log.regex[std]: ^
|
2015-08-13 05:34:41 +00:00
|
|
|
error:bad_regex_log.level:missing )
|
2015-07-20 13:33:52 +00:00
|
|
|
error:bad_regex_log:invalid sample -- 1428634687123; foo
|
2017-12-29 14:50:01 +00:00
|
|
|
error:bad_regex_log:highlighters/foobar:missing )
|
|
|
|
error:bad_regex_log:highlighters/foobar:abc(
|
|
|
|
error:bad_regex_log:highlighters/foobar: ^
|
2015-07-20 13:33:52 +00:00
|
|
|
error:bad_sample_log:invalid sample -- 1428634687123; foo bar
|
|
|
|
error:bad_sample_log:partial sample matched -- 1428634687123; foo
|
2020-05-13 16:38:41 +00:00
|
|
|
error: against pattern bad_sample_log/regex/semi -- ^(?<timestamp>\d+); (?<body>\w+)$
|
2015-07-20 13:33:52 +00:00
|
|
|
error:bad_sample_log:partial sample matched -- 1428634687123
|
2020-12-19 06:35:23 +00:00
|
|
|
error: against pattern bad_sample_log/regex/std -- ^(?<timestamp>\d+): (?<pid>\w+) (?<body>.*)$
|
2015-08-13 05:34:41 +00:00
|
|
|
error:no_sample_log:no sample logs provided, all formats must have samples
|
2015-11-27 06:19:53 +00:00
|
|
|
error:init.sql:2:near "TALE": syntax error
|
2015-07-20 13:33:52 +00:00
|
|
|
EOF
|
2016-07-01 04:59:51 +00:00
|
|
|
|
|
|
|
run_test ${lnav_test} -n \
|
|
|
|
-I ${test_dir} \
|
|
|
|
-c ";select * from leveltest_log" \
|
|
|
|
-c ':write-csv-to -' \
|
|
|
|
${test_dir}/logfile_leveltest.0
|
|
|
|
|
|
|
|
check_output "levels are not correct?" <<EOF
|
2019-02-15 06:42:44 +00:00
|
|
|
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_filters
|
2020-04-23 13:42:48 +00:00
|
|
|
0,<NULL>,2016-06-30 12:00:01.000,0,trace,0,<NULL>,<NULL>,<NULL>
|
|
|
|
1,<NULL>,2016-06-30 12:00:02.000,1000,debug,0,<NULL>,<NULL>,<NULL>
|
|
|
|
2,<NULL>,2016-06-30 12:00:03.000,1000,debug2,0,<NULL>,<NULL>,<NULL>
|
|
|
|
3,<NULL>,2016-06-30 12:00:04.000,1000,debug3,0,<NULL>,<NULL>,<NULL>
|
|
|
|
4,<NULL>,2016-06-30 12:00:05.000,1000,info,0,<NULL>,<NULL>,<NULL>
|
|
|
|
5,<NULL>,2016-06-30 12:00:06.000,1000,warning,0,<NULL>,<NULL>,<NULL>
|
|
|
|
6,<NULL>,2016-06-30 12:00:07.000,1000,fatal,0,<NULL>,<NULL>,<NULL>
|
|
|
|
7,<NULL>,2016-06-30 12:00:08.000,1000,info,0,<NULL>,<NULL>,<NULL>
|
2016-07-01 04:59:51 +00:00
|
|
|
EOF
|