.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
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
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