summaryrefslogtreecommitdiffstats
path: root/test/bad-config
diff options
context:
space:
mode:
Diffstat (limited to 'test/bad-config')
-rw-r--r--test/bad-config/formats/invalid-json-format/format.json17
-rw-r--r--test/bad-config/formats/invalid-properties/format.json45
-rw-r--r--test/bad-config/formats/invalid-regex/format.json29
-rw-r--r--test/bad-config/formats/invalid-sample/format.json45
-rw-r--r--test/bad-config/formats/invalid-schema/format.json3
-rw-r--r--test/bad-config/formats/invalid-sql/init.sql5
-rw-r--r--test/bad-config/formats/invalid-sql/init2.sql2
-rw-r--r--test/bad-config/formats/no-regexes/format.json7
-rw-r--r--test/bad-config/formats/no-samples/format.json17
9 files changed, 170 insertions, 0 deletions
diff --git a/test/bad-config/formats/invalid-json-format/format.json b/test/bad-config/formats/invalid-json-format/format.json
new file mode 100644
index 0000000..0e06a9e
--- /dev/null
+++ b/test/bad-config/formats/invalid-json-format/format.json
@@ -0,0 +1,17 @@
+{
+ "$schema": "https://lnav.org/schemas/format-v1.schema.json",
+ "bad_json_log": {
+ "json": true,
+ "line-format": [
+ {
+ "field": ""
+ },
+ {
+ "field": "__timestamp__",
+ "timestamp-format": ""
+ }
+ ],
+ "value": {
+ }
+ }
+} \ No newline at end of file
diff --git a/test/bad-config/formats/invalid-properties/format.json b/test/bad-config/formats/invalid-properties/format.json
new file mode 100644
index 0000000..a69a179
--- /dev/null
+++ b/test/bad-config/formats/invalid-properties/format.json
@@ -0,0 +1,45 @@
+{
+ "$schema": "https://lnav.org/schemas/format-v1.schema.json",
+ "invalid_props_log": {
+ "title": "invalid properties",
+ "regex": {
+ "std": {
+ "pattern": "^(?<timestamp>\\d+): (?<pid>\\w+) (?<body>.*)$"
+ }
+ },
+ "timestamp-field": "ts",
+ "subsecond-field": "ts-sub",
+ "sample": [
+ {
+ "line": "1428634687123: 1234 abc"
+ }
+ ],
+ "value": {
+ "non-existent": {
+ "kind": "string"
+ }
+ },
+ "highlights": {
+ "hl1": {
+ "color": "not a color",
+ "background-color": "also not a color"
+ }
+ },
+ "tags": {
+ "badtag": {
+ "paths": []
+ },
+ "badtag2": {
+ "pattern": ""
+ },
+ "badtag3": {
+ "pattern": "invalid(abc"
+ }
+ },
+ "search-table": {
+ "bad_table_regex": {
+ "pattern": "abc(def"
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/test/bad-config/formats/invalid-regex/format.json b/test/bad-config/formats/invalid-regex/format.json
new file mode 100644
index 0000000..33807a5
--- /dev/null
+++ b/test/bad-config/formats/invalid-regex/format.json
@@ -0,0 +1,29 @@
+{
+ "bad_regex_log": {
+ "title": "invalid regex test",
+ "regex": {
+ "std": {
+ "pattern": "^(?<timestamp>\\d+: (?<body>.*)$"
+ },
+ "incomplete-match": {
+ "pattern": "^(?<timestamp>\\d+);"
+ }
+ },
+ "level": {
+ "error": "(foo"
+ },
+ "timestamp-format": [
+ "%i"
+ ],
+ "sample": [
+ {
+ "line": "1428634687123; foo"
+ }
+ ],
+ "highlights": {
+ "foobar": {
+ "pattern": "abc("
+ }
+ }
+ }
+}
diff --git a/test/bad-config/formats/invalid-sample/format.json b/test/bad-config/formats/invalid-sample/format.json
new file mode 100644
index 0000000..c3509bb
--- /dev/null
+++ b/test/bad-config/formats/invalid-sample/format.json
@@ -0,0 +1,45 @@
+{
+ "$schema": "https://lnav.org/schemas/format-v1.schema.json",
+ "bad_sample_log": {
+ "title": "invalid sample test",
+ "regex": {
+ "std": {
+ "pattern": "^(?<timestamp>\\d+): (?<pid>\\w+) (?<body>.*)$"
+ },
+ "semi": {
+ "pattern": "^(?<timestamp>\\d+); (?<body>\\w+)$"
+ },
+ "bad-time": {
+ "pattern": "^(?<timestamp>\\w+): (?<body>\\w+)$"
+ },
+ "with-level": {
+ "pattern": "^(?<timestamp>\\d+)\\| (?<level>\\w+) (?<body>\\w+)$"
+ }
+ },
+ "timestamp-format": [
+ "%i"
+ ],
+ "value": {
+ "pid": {
+ "kind": "foo"
+ }
+ },
+ "level-field": "level",
+ "sample": [
+ {
+ "line": "abc: foo"
+ },
+ {
+ "line": "1428634687123| debug hello",
+ "level": "info"
+ },
+ {
+ "line": "1428634687123| debug hello\ngoodbye",
+ "level": "debug"
+ },
+ {
+ "line": "1428634687123; foo bar"
+ }
+ ]
+ }
+}
diff --git a/test/bad-config/formats/invalid-schema/format.json b/test/bad-config/formats/invalid-schema/format.json
new file mode 100644
index 0000000..b011164
--- /dev/null
+++ b/test/bad-config/formats/invalid-schema/format.json
@@ -0,0 +1,3 @@
+{
+ "$schema": "bad"
+} \ No newline at end of file
diff --git a/test/bad-config/formats/invalid-sql/init.sql b/test/bad-config/formats/invalid-sql/init.sql
new file mode 100644
index 0000000..341e675
--- /dev/null
+++ b/test/bad-config/formats/invalid-sql/init.sql
@@ -0,0 +1,5 @@
+
+SELECT * FROM sqlite_master;
+
+-- comment test
+CREATE TALE invalid (x y z);
diff --git a/test/bad-config/formats/invalid-sql/init2.sql b/test/bad-config/formats/invalid-sql/init2.sql
new file mode 100644
index 0000000..9810ea0
--- /dev/null
+++ b/test/bad-config/formats/invalid-sql/init2.sql
@@ -0,0 +1,2 @@
+SELECT regexp_match('abc(', '123')
+FROM sqlite_master;
diff --git a/test/bad-config/formats/no-regexes/format.json b/test/bad-config/formats/no-regexes/format.json
new file mode 100644
index 0000000..f20cde1
--- /dev/null
+++ b/test/bad-config/formats/no-regexes/format.json
@@ -0,0 +1,7 @@
+{
+ "$schema": "https://lnav.org/schemas/format-v1.schema.json",
+ "no_regexes_log": {
+ "value": {
+ }
+ }
+} \ No newline at end of file
diff --git a/test/bad-config/formats/no-samples/format.json b/test/bad-config/formats/no-samples/format.json
new file mode 100644
index 0000000..5c06294
--- /dev/null
+++ b/test/bad-config/formats/no-samples/format.json
@@ -0,0 +1,17 @@
+{
+ "$schema": "https://lnav.org/schemas/format-v1.schema.json",
+ "no_sample_log": {
+ "title": "invalid sample test",
+ "regex": {
+ "std": {
+ "pattern": "^(?<timestamp>\\d+): (?<body>.*)$"
+ },
+ "semi": {
+ "pattern": "^(?<timestamp>\\d+); (?<body>\\w+)$"
+ }
+ },
+ "timestamp-format": [
+ "%i"
+ ]
+ }
+}