Code

store::memory: Add a plugin providing an in-memory store.
[sysdb.git] / t / integration / matching.sh
index 67b97210058a5e44247f67a873794c5e364ffe42..2c9d8f386395a7da3a63e9630276ce2c35d72a97 100755 (executable)
@@ -38,7 +38,8 @@ Listen "$SOCKET_FILE"
 PluginDir "$PLUGIN_DIR"
 Interval 2
 
-LoadBackend mock_plugin
+LoadPlugin "store::memory"
+LoadBackend "mock_plugin"
 <Backend "mock_plugin">
 </Backend>
 EOF
@@ -49,7 +50,7 @@ wait_for_sysdbd
 sleep 3
 
 output="$( run_sysdb -H "$SOCKET_FILE" \
-       -c "LOOKUP hosts MATCHING metric = 'foo/bar/qux'" )"
+       -c "LOOKUP hosts MATCHING ANY metric.name = 'foo/bar/qux'" )"
 echo "$output" \
        | grep -F '"some.host.name"' \
        | grep -F '"other.host.name"'
@@ -58,7 +59,7 @@ echo "$output" | grep -F 'host1.example.com' && exit 1
 echo "$output" | grep -F 'host2.example.com' && exit 1
 
 output="$( run_sysdb -H "$SOCKET_FILE" \
-       -c "LOOKUP hosts MATCHING service = 'mock service'" )"
+       -c "LOOKUP hosts MATCHING ANY service.name = 'mock service'" )"
 echo "$output" \
        | grep -F '"some.host.name"' \
        | grep -F '"host1.example.com"' \
@@ -76,7 +77,16 @@ echo "$output" | grep -F 'other.host.name' && exit 1
 echo "$output" | grep -F 'some.host.name' && exit 1
 
 output="$( run_sysdb -H "$SOCKET_FILE" \
-       -c "LOOKUP hosts MATCHING attribute != 'architecture'" )"
+       -c "LOOKUP hosts MATCHING ANY attribute.name != 'architecture'" )"
+echo "$output" \
+       | grep -F '"localhost"' \
+       | grep -F '"other.host.name"' \
+       | grep -F '"host1.example.com"' \
+       | grep -F '"host2.example.com"'
+echo "$output" | grep -F 'some.host.name' && exit 1
+
+output="$( run_sysdb -H "$SOCKET_FILE" \
+       -c "LOOKUP hosts MATCHING ALL attribute.name != 'architecture'" )"
 echo "$output" \
        | grep -F '"some.host.name"' \
        | grep -F '"localhost"'
@@ -85,7 +95,7 @@ echo "$output" | grep -F 'host1.example.com' && exit 1
 echo "$output" | grep -F 'host2.example.com' && exit 1
 
 output="$( run_sysdb -H "$SOCKET_FILE" \
-       -c "LOOKUP hosts MATCHING service = 'sysdbd'" )"
+       -c "LOOKUP hosts MATCHING ANY 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
@@ -93,7 +103,7 @@ echo "$output" | grep -F 'host1.example.com' && exit 1
 echo "$output" | grep -F 'host2.example.com' && exit 1
 
 output="$( run_sysdb -H "$SOCKET_FILE" \
-       -c "LOOKUP hosts MATCHING host =~ 'example.com'" )"
+       -c "LOOKUP hosts MATCHING name =~ 'example.com'" )"
 echo "$output" \
        | grep -F '"host1.example.com"' \
        | grep -F '"host2.example.com"'
@@ -108,3 +118,4 @@ echo $output | grep -E '^\[\]$'
 
 stop_sysdbd
 
+# vim: set tw=78 sw=4 ts=4 noexpandtab :