summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ba731a0)
raw | patch | inline | side by side (parent: ba731a0)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 1 May 2014 14:20:10 +0000 (16:20 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 1 May 2014 14:20:48 +0000 (16:20 +0200) |
t/integration/simple_query.sh | patch | blob | history |
index 232d3e192ef5b42203ee1b7e5cbf4331f92a7506..e7118974fd95b4cbfe4b65800ff19c1017dfbc91 100755 (executable)
wait_for_sysdbd
sleep 3
+# On parse errors, expect a non-zero exit code.
output="$( $SYSDB -H "$SOCKET_FILE" -c INVALID )" && exit 1
echo "$output" | grep "Failed to parse query 'INVALID'"
echo "$output" | grep "parse error: syntax error"
echo "$output" | grep -F 'other.host.name' && exit 1
echo "$output" | grep -F 'some.host.name' && exit 1
+# When requesting information for unknown hosts, expect a non-zero exit code.
output="$( $SYSDB -H "$SOCKET_FILE" -c "FETCH 'does.not.exist'" )" \
&& exit 1
echo "$output" | grep -F 'not found'
echo "$output" | grep -F 'other.host.name' && exit 1
echo "$output" | grep -F 'localhost' && exit 1
+# When querying hosts that don't exist, expect a zero exit code.
+output="$( $SYSDB -H "$SOCKET_FILE" \
+ -c "LOOKUP hosts WHERE attribute.invalid = 'none'" )"
+echo $output | grep -E '^\[\]$'
+
kill $sysdbd_pid
wait $sysdbd_pid