X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=t%2Fintegration%2Fquery.sh;h=46568569a57c307d9672a66472ce5f5456679ded;hp=c9b21b6063d001ae29bd92d302259dc41671c043;hb=80cb24f5015433b3d63084bb4c230b10d1c33652;hpb=139f6d14855388073ae047b37ea9a1f92f76682a diff --git a/t/integration/query.sh b/t/integration/query.sh index c9b21b6..4656856 100755 --- a/t/integration/query.sh +++ b/t/integration/query.sh @@ -77,6 +77,10 @@ output="$( run_sysdb -H "$SOCKET_FILE" -c INVALID 2>&1 )" && exit 1 echo "$output" | grep "Failed to parse query 'INVALID'" echo "$output" | grep "parse error: syntax error" +# Empty query. +output="$( run_sysdb -H "$SOCKET_FILE" -c '' )" +test -z "$output" + # Simple, successful commands. output="$( run_sysdb -H "$SOCKET_FILE" -c 'LIST hosts' )" echo "$output" \ @@ -118,13 +122,17 @@ echo "$output" | grep -F 'other.host.name' && exit 1 echo "$output" | grep -F 'some.host.name' && exit 1 output="$( run_sysdb -H "$SOCKET_FILE" \ - -c "FETCH host 'host1.example.com' FILTER last_update < 0" 2>&1 )" \ + -c "FETCH host 'host1.example.com' FILTER last_update < 0s" 2>&1 )" \ && exit 1 echo "$output" | grep -F 'not found' (echo 'LIST hosts;'; sleep 1; echo "FETCH host 'host1.example.com'") \ | run_sysdb -H "$SOCKET_FILE" +output="$( run_sysdb -H "$SOCKET_FILE" \ + -c "FETCH host 'host1.example.com' FILTER age < 0s" 2>&1 )" && exit 1 +echo "$output" | grep -F 'not found' + # When requesting information for unknown hosts, expect a non-zero exit code. output="$( run_sysdb -H "$SOCKET_FILE" \ -c "FETCH host 'does.not.exist'" 2>&1 )" && exit 1