]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: Add tests for MetaAttachment
authorEric Bollengier <eric@baculasystems.com>
Thu, 23 Sep 2021 06:59:48 +0000 (08:59 +0200)
committerEric Bollengier <eric@baculasystems.com>
Wed, 6 Sep 2023 07:49:00 +0000 (09:49 +0200)
regress/tests/metadata-test

index d36ca30e8df8c0bcc1c75cba977f05b169255d05..c2e816792fcdd195d42c5dfb62cf777290685406 100755 (executable)
@@ -80,6 +80,10 @@ setdebug level=50 tags=sql trace=1 dir
 .jlist metadata type=email client=$HOST-fd
 @$out $tmp/log17.out
 .jlist metadata type=email tags=important
+@$out $tmp/log18.out
+.jlist metadata type=attachment name=CV
+@$out $tmp/log19.out
+.jlist metadata type=attachment name=CV id=AAMkAGZmZjBlMjI0LTMxMmEtNDFkMi1hM2Yx
 setdebug level=0 tags= dir
 quit
 END_OF_DATA
@@ -237,4 +241,26 @@ if [ $? != 1 ]; then
     estat=1
 fi
 
+# Should find 2 attachments
+grep '{' $tmp/log18.out | perl -MJSON -e '
+$l = <>;
+$j = JSON::decode_json($l) ;
+exit (scalar(@$j) == 2);'
+
+if [ $? != 1 ]; then
+    print_debug "ERROR: Incorrect data in $tmp/log18.out"
+    estat=1
+fi
+
+# Should find 2 attachments
+grep '{' $tmp/log19.out | perl -MJSON -e '
+$l = <>;
+$j = JSON::decode_json($l) ;
+exit (scalar(@$j) == 2);'
+
+if [ $? != 1 ]; then
+    print_debug "ERROR: Incorrect data in $tmp/log19.out"
+    estat=1
+fi
+
 end_test