From: Sebastian Harl Date: Thu, 1 May 2014 14:20:10 +0000 (+0200) Subject: integration/simple_query: More explicitly document expected exit codes. X-Git-Tag: sysdb-0.1.0~50 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7e9fee5e2cb1e191f91b5fae2381ccddabb6c418;p=sysdb.git integration/simple_query: More explicitly document expected exit codes. --- diff --git a/t/integration/simple_query.sh b/t/integration/simple_query.sh index 232d3e1..e711897 100755 --- a/t/integration/simple_query.sh +++ b/t/integration/simple_query.sh @@ -49,6 +49,7 @@ sysdbd_pid=$! 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" @@ -71,6 +72,7 @@ echo "$output" | grep -F 'localhost' && exit 1 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' @@ -110,6 +112,11 @@ echo "$output" | grep -F 'some.host.name' && exit 1 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