summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dcae4c1)
raw | patch | inline | side by side (parent: dcae4c1)
author | Sebastian Harl <sh@tokkee.org> | |
Sat, 25 Oct 2014 19:41:16 +0000 (21:41 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sat, 25 Oct 2014 19:41:16 +0000 (21:41 +0200) |
The old behavior no longer makes sense when thinking about matching *any*
object.
object.
src/core/store_lookup.c | patch | blob | history | |
t/integration/filter.sh | patch | blob | history | |
t/integration/matching.sh | patch | blob | history | |
t/unit/core/store_lookup_test.c | patch | blob | history |
index f95f8ca0bc6a0a4fec8cb724e56304290ab57c78..11d85fea0a5ead05b42f6fffd089b6b135b0bcb9 100644 (file)
--- a/src/core/store_lookup.c
+++ b/src/core/store_lookup.c
if (obj->type != SDB_HOST)
return 0;
- /* negated matchers should only match if the respective positive matchers
- * do not match; that is if the negated matcher matchers *all* children */
- if ((ITER_M(m)->m->type == MATCHER_NE)
- || (ITER_M(m)->m->type == MATCHER_NREGEX))
- all = 1;
-
if (ITER_M(m)->type == SDB_SERVICE)
iter = sdb_avltree_get_iter(HOST(obj)->services);
else if (ITER_M(m)->type == SDB_METRIC)
index 9c9fb0cf17de6c5b08d60010abac317bd04b12e0..b4930b4e04ddf279d4c29de555193391c5c1eedb 100755 (executable)
--- a/t/integration/filter.sh
+++ b/t/integration/filter.sh
-c "LOOKUP hosts MATCHING ANY attribute != 'architecture'
FILTER .age >= 0s" )"
echo "$output" \
- | grep -F '"some.host.name"' \
| grep -F '"localhost"'
-echo "$output" | grep -F 'other.host.name' && exit 1
-echo "$output" | grep -F 'host1.example.com' && exit 1
-echo "$output" | grep -F 'host2.example.com' && exit 1
+echo "$output" | grep -F 'some.host.name' && exit 1
+#echo "$output" | grep -F 'other.host.name' && exit 1
+#echo "$output" | grep -F 'host1.example.com' && exit 1
+#echo "$output" | grep -F 'host2.example.com' && exit 1
output="$( run_sysdb -H "$SOCKET_FILE" \
-c "LOOKUP hosts MATCHING ANY attribute != 'architecture'
index 751b22ba9c00f58325bc2956bd5180278fb2eb13..21a730ff8da647c91b06555224efa35fa40db59d 100755 (executable)
output="$( run_sysdb -H "$SOCKET_FILE" \
-c "LOOKUP hosts MATCHING ANY attribute != 'architecture'" )"
echo "$output" \
- | grep -F '"some.host.name"' \
| grep -F '"localhost"'
-echo "$output" | grep -F 'other.host.name' && exit 1
-echo "$output" | grep -F 'host1.example.com' && exit 1
-echo "$output" | grep -F 'host2.example.com' && exit 1
+echo "$output" | grep -F 'some.host.name' && exit 1
+#echo "$output" | grep -F 'other.host.name' && exit 1
+#echo "$output" | grep -F 'host1.example.com' && exit 1
+#echo "$output" | grep -F 'host2.example.com' && exit 1
output="$( run_sysdb -H "$SOCKET_FILE" \
-c "LOOKUP hosts MATCHING ANY service = 'sysdbd'" )"
index 3c99bb15553d64f0407489b21a3db56334977935..d532757d1d9e6044528f396282617a8f916986d9 100644 (file)
{ "ANY metric = 'm1'",
"NOT attribute['x'] = ''", 2 }, /* filter always matches */
{ "ANY metric =~ 'm'", NULL, 2 },
- { "ANY metric !~ 'm'", NULL, 1 },
+ { "ANY metric !~ 'm'", NULL, 0 },
{ "ANY metric =~ 'x'", NULL, 0 },
{ "ANY service = 's1'", NULL, 2 },
{ "ANY service = 's1'", "host = 'x'", 0 }, /* filter never matches */
{ "ANY service = 's1'",
"NOT attribute['x'] = ''", 2 }, /* filter always matches */
{ "ANY service =~ 's'", NULL, 2 },
- { "ANY service !~ 's'", NULL, 1 },
+ { "ANY service !~ 's'", NULL, 0 },
{ "ANY attribute = 'k1'", NULL, 2 },
{ "ANY attribute = 'k1'", "host = 'x'",0 }, /* filter never matches */
{ "ANY attribute = 'k1'",
{ "attribute['k1'] != 'v1'", NULL, 1 },
{ "attribute['k1'] != 'v2'", NULL, 1 },
{ "ANY attribute != 'x' "
- "AND attribute['y'] !~ 'x'", NULL, 3 },
+ "AND attribute['y'] !~ 'x'", NULL, 2 },
};
int check, n;