From 7e9fee5e2cb1e191f91b5fae2381ccddabb6c418 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Thu, 1 May 2014 16:20:10 +0200 Subject: [PATCH] integration/simple_query: More explicitly document expected exit codes. --- t/integration/simple_query.sh | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.30.2