From: Sebastian Harl Date: Wed, 30 Apr 2014 21:47:15 +0000 (+0200) Subject: integration/simple_query.sh: Added some more simple queries. X-Git-Tag: sysdb-0.1.0~56 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=207733966fd98ae95c2ebd1a35b6737df5751936;p=sysdb.git integration/simple_query.sh: Added some more simple queries. --- 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