From 26d94cd69bef73a7f5ec397f39bf614b2821b60f Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sat, 19 Jul 2014 14:25:55 +0200 Subject: [PATCH] t/integration/simple_query.sh: Pass in queries through stdin as well. This covers some more code. --- t/integration/simple_query.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/t/integration/simple_query.sh b/t/integration/simple_query.sh index 22bd815..a474a52 100755 --- a/t/integration/simple_query.sh +++ b/t/integration/simple_query.sh @@ -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 -- 2.30.2