From 207733966fd98ae95c2ebd1a35b6737df5751936 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Wed, 30 Apr 2014 23:47:15 +0200 Subject: [PATCH] integration/simple_query.sh: Added some more simple queries. --- t/integration/simple_query.sh | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/t/integration/simple_query.sh b/t/integration/simple_query.sh index 76b54d6..9a317d9 100755 --- a/t/integration/simple_query.sh +++ b/t/integration/simple_query.sh @@ -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 -- 2.30.2