X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Fintegration%2Fsimple_query.sh;h=9a317d97fa24b4dec000c2049244a6ddf5258146;hb=207733966fd98ae95c2ebd1a35b6737df5751936;hp=76b54d66e840f8333b51bebaff7ec2eb64fc7cbf;hpb=2e614bb5b95f81f5cc2f1f561ba070505c23f461;p=sysdb.git 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