#!/bin/bash
set -e
set -o pipefail
set -u
#
# Run a simple backup
#   then restore it.
#
TestName="$(basename "$(pwd)")"
export TestName

bstat=0
dstat=0
estat=0
rstat=0
zstat=0

#shellcheck source=../environment.in
. ./environment

#shellcheck source=../scripts/functions
. "${rscripts}"/functions
setup_data

testfind_log=$tmp/testfind.out

rm -f $testfind_log
./sbin/testfind-testfind -c etc/bareos | tee  "$testfind_log"

expect_grep "Total files    : 68" \
            "$testfind_log" \
            "Number of files is incorrect."

expect_grep "Max file length: 148" \
            "$testfind_log" \
            "Max file length is incorrect."

expect_grep "Hard links     : 2" \
            "$testfind_log" \
            "Number of hard links is incorrect."

end_test
