]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: Test new bvfs_restore fileindex option
authorEric Bollengier <eric@baculasystems.com>
Thu, 3 Mar 2022 10:31:26 +0000 (11:31 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:58 +0000 (13:56 +0200)
regress/tests/bvfs-restore-test

index 640676821d0e1c0e11028328e0d2ce6a3a4dbd2c..9e405178407373a4a1be94f9c563bc3e42119217 100755 (executable)
@@ -64,6 +64,10 @@ cat <<EOF >$tmp/bconcmds
 .bvfs_lsfiles jobid=1,2,3,4 path=$tmp/hl/ pattern=verify.c
 @$out $tmp/log4.out
 .bvfs_lsdirs path=$tmp/ jobid=1 pattern=hl
+@$out $tmp/log5.out
+sql
+select FileIndex,Filename from File WHERE JobId=1 and FileIndex > 0 and FileIndex < 4;
+
 quit
 EOF
 
@@ -87,6 +91,16 @@ wait
 restore file=?b211$$ where=$tmp/bacula-restore2 yes
 wait
 messages
+.bvfs_cleanup path=b211$$
+.bvfs_restore path=b211$$  jobid=1,2 fileindex=1,1,1,2,1,3
+restore file=?b211$$ where=$tmp/bacula-restore3 yes
+wait
+messages
+@$out $tmp/log22.out
+@# Will not work due to the filter
+.bvfs_cleanup path=b211$$
+.bvfs_restore path=b211$$  jobid=3 fileindex=1,1,1,2,1,3
+messages
 quit
 EOF
 
@@ -111,4 +125,16 @@ fi
 mode=`awk -F= '/Inserting hardlinks method=/ { print $2 ; exit}' $cwd/working/*trace`
 print_debug "INFO: Was using $mode method"
 
+nb=`find $tmp/bacula-restore3/ -type f | wc -l`
+if [ $nb != 3 ]; then
+    print_debug "ERROR: found difference after fileindex restore"
+    estat=1
+fi
+
+grep "Can't create restore list" $tmp/log22.out > /dev/null
+if [ $? != 0 ]; then
+    print_debug "ERROR: found difference after fileindex restore 2"
+    estat=1
+fi
+
 end_test