Code

t/integration/simple_query.sh: Pass in queries through stdin as well.
authorSebastian Harl <sh@tokkee.org>
Sat, 19 Jul 2014 12:25:55 +0000 (14:25 +0200)
committerSebastian Harl <sh@tokkee.org>
Sat, 19 Jul 2014 12:25:55 +0000 (14:25 +0200)
This covers some more code.

t/integration/simple_query.sh

index 22bd815a95f4733ef09c52f44b2996b9ca13de13..a474a524367eb213b1e8f614c3ea085b25a0fa64 100755 (executable)
@@ -53,6 +53,7 @@ output="$( run_sysdb -H "$SOCKET_FILE" -c INVALID )" && exit 1
 echo "$output" | grep "Failed to parse query 'INVALID'"
 echo "$output" | grep "parse error: syntax error"
 
+# Simple, successful commands.
 output="$( run_sysdb -H "$SOCKET_FILE" -c LIST )"
 echo "$output" \
        | grep -F '"host1.example.com"' \
@@ -61,6 +62,14 @@ echo "$output" \
        | grep -F '"other.host.name"' \
        | grep -F '"some.host.name"'
 
+output="$( echo 'LIST;' | run_sysdb -H "$SOCKET_FILE" )" || echo $?
+echo "$output" \
+       | grep -F '"host1.example.com"' \
+       | grep -F '"host2.example.com"' \
+       | grep -F '"localhost"' \
+       | grep -F '"other.host.name"' \
+       | grep -F '"some.host.name"'
+
 output="$( run_sysdb -H "$SOCKET_FILE" -c "FETCH 'host1.example.com'" )"
 echo "$output" \
        | grep -F '"host1.example.com"' \
@@ -71,6 +80,9 @@ 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
 
+(echo 'LIST;'; sleep 1; echo "FETCH 'host1.example.com'") \
+       | run_sysdb -H "$SOCKET_FILE"
+
 # When requesting information for unknown hosts, expect a non-zero exit code.
 output="$( run_sysdb -H "$SOCKET_FILE" -c "FETCH 'does.not.exist'" )" \
        && exit 1