]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: Adapt regress for new metadata filters
authorEric Bollengier <eric@baculasystems.com>
Wed, 23 Feb 2022 17:49:24 +0000 (18:49 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:58 +0000 (13:56 +0200)
regress/tests/metadata-test

index 9cea40f3565ebee0b6f6927941cb711da076cea3..05df3f34eedaf8ac6c38d2bfeed8a076d1ab8cd2 100755 (executable)
@@ -126,6 +126,14 @@ wait
 messages
 @$out $tmp/log.23.out
 .jlist metadata type=email owner=xxxx tenant=xxxx
+@$out $tmp/log.24.out
+.jlist metadata type=attachment tenant=xxxx owner=xxxx contenttype=application/octet-stream
+@$out $tmp/log.25.out
+.jlist metadata type=attachment tenant=xxxx owner=xxxx contenttype=application/jpg
+@$out $tmp/log.26.out
+.jlist metadata type=attachment tenant=xxxx owner=xxxx isinline=0
+@$out $tmp/log.27.out
+.jlist metadata type=attachment tenant=xxxx owner=xxxx isinline=1
 quit
 END_OF_DATA
 
@@ -421,7 +429,51 @@ $j = JSON::decode_json($l) ;
 exit (scalar(@{$j->{data}}) == 4);'
 
 if [ $? != 1 ]; then
-    print_debug "ERROR: Incorrect data in $tmp/log.21.out"
+    print_debug "ERROR: Incorrect data in $tmp/log.23.out"
+    estat=1
+fi
+
+    # Should find 1 attachment,
+grep '\[' $tmp/log.24.out | perl -MJSON -e '
+$l = <>;
+$j = JSON::decode_json($l) ;
+exit (scalar(@{$j->{data}}) == 2);'
+
+if [ $? != 1 ]; then
+    print_debug "ERROR: Incorrect data in $tmp/log.24.out"
+    estat=1
+fi
+
+    # Should find 0 attachment,
+grep '\[' $tmp/log.25.out | perl -MJSON -e '
+$l = <>;
+$j = JSON::decode_json($l) ;
+exit (scalar(@{$j->{data}}) == 0);'
+
+if [ $? != 1 ]; then
+    print_debug "ERROR: Incorrect data in $tmp/log.25.out"
+    estat=1
+fi
+
+    # Should find 0 attachment,
+grep '\[' $tmp/log.26.out | perl -MJSON -e '
+$l = <>;
+$j = JSON::decode_json($l) ;
+exit (scalar(@{$j->{data}}) == 2);'
+
+if [ $? != 1 ]; then
+    print_debug "ERROR: Incorrect data in $tmp/log.26.out"
+    estat=1
+fi
+
+    # Should find 0 attachment,
+grep '\[' $tmp/log.27.out | perl -MJSON -e '
+$l = <>;
+$j = JSON::decode_json($l) ;
+exit (scalar(@{$j->{data}}) == 0);'
+
+if [ $? != 1 ]; then
+    print_debug "ERROR: Incorrect data in $tmp/log.26.out"
     estat=1
 fi