From: Eric Bollengier Date: Thu, 23 Sep 2021 06:59:48 +0000 (+0200) Subject: regress: Add tests for MetaAttachment X-Git-Tag: Beta-15.0.0~869 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=995fa4056aed2fc0784208f67657fda6884df7da;p=thirdparty%2Fbacula.git regress: Add tests for MetaAttachment --- diff --git a/regress/tests/metadata-test b/regress/tests/metadata-test index d36ca30e8..c2e816792 100755 --- a/regress/tests/metadata-test +++ b/regress/tests/metadata-test @@ -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