]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: Adapt metadata-test for new JSON output in .jlist command
authorEric Bollengier <eric@baculasystems.com>
Thu, 7 Oct 2021 16:25:55 +0000 (18:25 +0200)
committerEric Bollengier <eric@baculasystems.com>
Wed, 6 Sep 2023 07:49:01 +0000 (09:49 +0200)
regress/tests/metadata-test

index 986526c4f7bf1170644b64838963a0cd3cfcb731..73e8c58fd21991659dbf615d69b2d5f9fe96a8cf 100755 (executable)
@@ -182,7 +182,7 @@ do
     grep '{' $tmp/log_$mode.4.out | perl -MJSON -e '
 $l = <>;
 $j = JSON::decode_json($l) ;
-exit (scalar(@$j) == 1);'
+exit (scalar(@{$j->{data}}) == 1);'
 
     if [ $? != 1 ]; then
         print_debug "ERROR: Incorrect data in $tmp/log_$mode.4.out"
@@ -194,7 +194,7 @@ exit (scalar(@$j) == 1);'
         grep '\[' $tmp/log_$mode.5.out | perl -MJSON -e '
 $l = <>;
 $j = JSON::decode_json($l) ;
-exit (scalar(@$j) == 0);'
+exit (scalar(@{$j->{data}}) == 0);'
 
         if [ $? != 1 ]; then
             print_debug "ERROR: Incorrect data in $tmp/log_$mode.5.out"
@@ -213,7 +213,7 @@ exit (scalar(@$j) == 0);'
     grep '{' $tmp/log_$mode.6.out | perl -MJSON -e '
 $l = <>; 
 $j = JSON::decode_json($l) ;
-exit (scalar(@$j) == 1);'
+exit (scalar(@{$j->{data}}) == 1);'
 
     if [ $? != 1 ]; then
         print_debug "ERROR: Incorrect data in $tmp/log_$mode.6.out"
@@ -224,7 +224,7 @@ exit (scalar(@$j) == 1);'
     grep '{' $tmp/log_$mode.8.out | perl -MJSON -e '
 $l = <>;
 $j = JSON::decode_json($l) ;
-exit (scalar(@$j) == 2 && $j->[0]->{emailtime} eq "2021-09-15 12:39:19");'
+exit (scalar(@{$j->{data}}) == 2 && $j->[0]->{emailtime} eq "2021-09-15 12:39:19");'
 
     if [ $? != 1 ]; then
         print_debug "ERROR: Incorrect data in $tmp/log_$mode.8.out"
@@ -235,7 +235,7 @@ exit (scalar(@$j) == 2 && $j->[0]->{emailtime} eq "2021-09-15 12:39:19");'
     grep '{' $tmp/log_$mode.9.out | perl -MJSON -e '
 $l = <>;
 $j = JSON::decode_json($l) ;
-exit (scalar(@$j) == 2 && $j->[0]->{emailtime} eq "2021-09-15 12:40:19");'
+exit (scalar(@{$j->{data}}) == 2 && $j->[0]->{emailtime} eq "2021-09-15 12:40:19");'
 
     if [ $? != 1 ]; then
         print_debug "ERROR: Incorrect data in $tmp/log_$mode.9.out"
@@ -246,7 +246,7 @@ exit (scalar(@$j) == 2 && $j->[0]->{emailtime} eq "2021-09-15 12:40:19");'
     grep '{' $tmp/log_$mode.10.out | perl -MJSON -e '
 $l = <>;
 $j = JSON::decode_json($l) ;
-exit (scalar(@$j) == 1);'
+exit (scalar(@{$j->{data}}) == 1);'
 
     if [ $? != 1 ]; then
         print_debug "ERROR: Incorrect data in $tmp/log_$mode.10.out"
@@ -257,7 +257,7 @@ exit (scalar(@$j) == 1);'
     grep '{' $tmp/log_$mode.11.out | perl -MJSON -e '
 $l = <>;
 $j = JSON::decode_json($l) ;
-exit (scalar(@$j) == 1);'
+exit (scalar(@{$j->{data}}) == 1);'
 
     if [ $? != 1 ]; then
         print_debug "ERROR: Incorrect data in $tmp/log_$mode.11.out"
@@ -268,7 +268,7 @@ exit (scalar(@$j) == 1);'
     grep '{' $tmp/log_$mode.12.out | perl -MJSON -e '
 $l = <>;
 $j = JSON::decode_json($l) ;
-exit (scalar(@$j) == 1);'
+exit (scalar(@{$j->{data}}) == 1);'
 
     if [ $? != 1 ]; then
         print_debug "ERROR: Incorrect data in $tmp/log_$mode.12.out"
@@ -279,7 +279,7 @@ exit (scalar(@$j) == 1);'
     grep '{' $tmp/log_$mode.13.out | perl -MJSON -e '
 $l = <>; 
 $j = JSON::decode_json($l) ;
-exit (scalar(@$j) == 2 && $j->[0]->{emailsize} < 100000);'
+exit (scalar(@{$j->{data}}) == 2 && $j->[0]->{emailsize} < 100000);'
 
     if [ $? != 1 ]; then
         print_debug "ERROR: Incorrect data in $tmp/log_$mode.13.out"
@@ -290,7 +290,7 @@ exit (scalar(@$j) == 2 && $j->[0]->{emailsize} < 100000);'
     grep '\[' $tmp/log_$mode.14.out | perl -MJSON -e '
 $l = <>;
 $j = JSON::decode_json($l) ;
-exit (scalar(@$j) == 0);'
+exit (scalar(@{$j->{data}}) == 0);'
 
     if [ $? != 1 ]; then
         print_debug "ERROR: Incorrect data in $tmp/log_$mode.14.out"
@@ -302,7 +302,7 @@ exit (scalar(@$j) == 0);'
         grep '\[' $tmp/log_$mode.15.out | perl -MJSON -e '
 $l = <>; 
 $j = JSON::decode_json($l) ;
-exit (scalar(@$j) == 0);'
+exit (scalar(@{$j->{data}}) == 0);'
 
         if [ $? != 1 ]; then
             print_debug "ERROR: Incorrect data in $tmp/log_$mode.15.out"
@@ -323,7 +323,7 @@ exit (scalar(@$j) == 0);'
         grep '{' $tmp/log_$mode.16.out | perl -MJSON -e '
 $l = <>;
 $j = JSON::decode_json($l) ;
-exit (scalar(@$j) == 2);'
+exit (scalar(@{$j->{data}}) == 2);'
 
         if [ $? != 1 ]; then
             print_debug "ERROR: Incorrect data in $tmp/log_$mode.16.out"
@@ -343,7 +343,7 @@ exit (scalar(@$j) == 2);'
     grep '{' $tmp/log_$mode.17.out | perl -MJSON -e '
 $l = <>;
 $j = JSON::decode_json($l) ;
-exit (scalar(@$j) == 1);'
+exit (scalar(@{$j->{data}}) == 1);'
 
     if [ $? != 1 ]; then
         print_debug "ERROR: Incorrect data in $tmp/log_$mode.17.out"
@@ -354,7 +354,7 @@ exit (scalar(@$j) == 1);'
     grep '{' $tmp/log_$mode.18.out | perl -MJSON -e '
 $l = <>;
 $j = JSON::decode_json($l) ;
-exit (scalar(@$j) == 1);'
+exit (scalar(@{$j->{data}}) == 1);'
 
     if [ $? != 1 ]; then
         print_debug "ERROR: Incorrect data in $tmp/log_$mode.18.out"
@@ -365,7 +365,7 @@ exit (scalar(@$j) == 1);'
     grep '{' $tmp/log_$mode.19.out | perl -MJSON -e '
 $l = <>;
 $j = JSON::decode_json($l) ;
-exit (scalar(@$j) == 1);'
+exit (scalar(@{$j->{data}}) == 1);'
 
     if [ $? != 1 ]; then
         print_debug "ERROR: Incorrect data in $tmp/log_$mode.19.out"
@@ -376,7 +376,7 @@ exit (scalar(@$j) == 1);'
     grep '\[' $tmp/log_$mode.20.out | perl -MJSON -e '
 $l = <>;
 $j = JSON::decode_json($l) ;
-exit (scalar(@$j) == 0);'
+exit (scalar(@{$j->{data}}) == 0);'
 
     if [ $? != 1 ]; then
         print_debug "ERROR: Incorrect data in $tmp/log_$mode.20.out"
@@ -388,7 +388,7 @@ done
 grep '\[' $tmp/log.21.out | perl -MJSON -e '
 $l = <>;
 $j = JSON::decode_json($l) ;
-exit (scalar(@$j) == 4);'
+exit (scalar(@{$j->{data}}) == 4);'
 
 if [ $? != 1 ]; then
     print_debug "ERROR: Incorrect data in $tmp/log.21.out"