Code

integration/simple_query: Added more types of simple queries.
authorSebastian Harl <sh@tokkee.org>
Thu, 1 May 2014 14:15:43 +0000 (16:15 +0200)
committerSebastian Harl <sh@tokkee.org>
Thu, 1 May 2014 14:15:43 +0000 (16:15 +0200)
t/integration/simple_query.sh

index ec83f20199f3195b4c83f055a4cb9132b346dae4..232d3e192ef5b42203ee1b7e5cbf4331f92a7506 100755 (executable)
@@ -84,6 +84,32 @@ 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.name != 'architecture'" )"
+echo "$output" \
+       | grep -F '"some.host.name"' \
+       | grep -F '"localhost"'
+echo "$output" | grep -F 'other.host.name' && exit 1
+echo "$output" | grep -F 'host1.example.com' && exit 1
+echo "$output" | grep -F 'host2.example.com' && exit 1
+
+output="$( $SYSDB -H "$SOCKET_FILE" \
+       -c "LOOKUP hosts WHERE service.name = 'sysdbd'" )"
+echo "$output" | grep -F '"localhost"'
+echo "$output" | grep -F 'some.host.name' && exit 1
+echo "$output" | grep -F 'other.host.name' && exit 1
+echo "$output" | grep -F 'host1.example.com' && exit 1
+echo "$output" | grep -F 'host2.example.com' && exit 1
+
+output="$( $SYSDB -H "$SOCKET_FILE" \
+       -c "LOOKUP hosts WHERE host.name =~ 'example.com'" )"
+echo "$output" \
+       | grep -F '"host1.example.com"' \
+       | grep -F '"host2.example.com"'
+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
+
 kill $sysdbd_pid
 wait $sysdbd_pid