index d42044ba9e0b26899f4be3c9a5f1bf5c73e7dea7..8b25ed3cc062627115f32bdb45e62abde3a54b66 100755 (executable)
sleep 3
output="$( run_sysdb -H "$SOCKET_FILE" \
- -c "LOOKUP hosts MATCHING metric = 'foo/bar/qux'" )"
+ -c "LOOKUP hosts MATCHING ANY metric = 'foo/bar/qux'" )"
echo "$output" \
| grep -F '"some.host.name"' \
| grep -F '"other.host.name"'
echo "$output" | grep -F 'host2.example.com' && exit 1
output="$( run_sysdb -H "$SOCKET_FILE" \
- -c "LOOKUP hosts MATCHING service = 'mock service'" )"
+ -c "LOOKUP hosts MATCHING ANY service = 'mock service'" )"
echo "$output" \
| grep -F '"some.host.name"' \
| grep -F '"host1.example.com"' \
echo "$output" | grep -F 'other.host.name' && exit 1
output="$( run_sysdb -H "$SOCKET_FILE" \
- -c "LOOKUP hosts MATCHING attribute[architecture] = 'x42'" )"
+ -c "LOOKUP hosts MATCHING attribute['architecture'] = 'x42'" )"
echo "$output" \
| grep -F '"host1.example.com"' \
| grep -F '"host2.example.com"'
echo "$output" | grep -F 'some.host.name' && exit 1
output="$( run_sysdb -H "$SOCKET_FILE" \
- -c "LOOKUP hosts MATCHING attribute != 'architecture'" )"
+ -c "LOOKUP hosts MATCHING ANY attribute != 'architecture'" )"
+echo "$output" \
+ | grep -F '"localhost"' \
+ | grep -F '"other.host.name"' \
+ | grep -F '"host1.example.com"' \
+ | grep -F '"host2.example.com"'
+echo "$output" | grep -F 'some.host.name' && exit 1
+
+output="$( run_sysdb -H "$SOCKET_FILE" \
+ -c "LOOKUP hosts MATCHING ALL attribute != 'architecture'" )"
echo "$output" \
| grep -F '"some.host.name"' \
| grep -F '"localhost"'
echo "$output" | grep -F 'host2.example.com' && exit 1
output="$( run_sysdb -H "$SOCKET_FILE" \
- -c "LOOKUP hosts MATCHING service = 'sysdbd'" )"
+ -c "LOOKUP hosts MATCHING ANY service = 'sysdbd'" )"
echo "$output" | grep -F '"localhost"'
echo "$output" | grep -F 'some.host.name' && exit 1
echo "$output" | grep -F 'other.host.name' && exit 1
echo "$output" | grep -F 'host2.example.com' && exit 1
output="$( run_sysdb -H "$SOCKET_FILE" \
- -c "LOOKUP hosts MATCHING host =~ 'example.com'" )"
+ -c "LOOKUP hosts MATCHING name =~ 'example.com'" )"
echo "$output" \
| grep -F '"host1.example.com"' \
| grep -F '"host2.example.com"'
# When querying hosts that don't exist, expect a zero exit code.
output="$( run_sysdb -H "$SOCKET_FILE" \
- -c "LOOKUP hosts MATCHING attribute[invalid] = 'none'" )"
+ -c "LOOKUP hosts MATCHING attribute['invalid'] = 'none'" )"
echo $output | grep -E '^\[\]$'
stop_sysdbd