Code

integration/simple_query.sh: Added some more simple queries.
authorSebastian Harl <sh@tokkee.org>
Wed, 30 Apr 2014 21:47:15 +0000 (23:47 +0200)
committerSebastian Harl <sh@tokkee.org>
Wed, 30 Apr 2014 21:47:15 +0000 (23:47 +0200)
t/integration/simple_query.sh

index 76b54d66e840f8333b51bebaff7ec2eb64fc7cbf..9a317d97fa24b4dec000c2049244a6ddf5258146 100755 (executable)
@@ -49,13 +49,36 @@ sysdbd_pid=$!
 wait_for_sysdbd
 sleep 3
 
+output="$( $SYSDB -H "$SOCKET_FILE" -c INVALID )"
+echo "$output" | grep "parse error: syntax error"
+
 output="$( $SYSDB -H "$SOCKET_FILE" -c LIST )"
 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"
+       | grep -F '"host2.example.com"' \
+       | grep -F '"localhost"' \
+       | grep -F '"other.host.name"' \
+       | grep -F '"some.host.name"'
+
+output="$( $SYSDB -H "$SOCKET_FILE" -c "FETCH 'host1.example.com'" )"
+echo "$output" \
+       | grep -F '"host1.example.com"' \
+       | grep -F '"mock service"' \
+       | grep -E '"other attribute".*"special value"'
+echo "$output" | grep -F 'host2.example.com' && exit 1
+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
+
+output="$( $SYSDB -H "$SOCKET_FILE" \
+       -c "LOOKUP hosts WHERE attribute.architecture = 'x42'" )"
+echo "$output" \
+       | grep -F '"host1.example.com"' \
+       | grep -F '"host2.example.com"'
+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
+
 kill $sysdbd_pid
 wait $sysdbd_pid