#!/bin/bash
set -e
set -o pipefail
set -u

# run bls and make sure it works (with autoxflate plugin)
TestName="$(basename "$(pwd)")"
export TestName

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

#shellcheck source=../../scripts/functions
. "${BAREOS_SCRIPTS_DIR}"/functions
start_test

JobName=backup-bareos-fd

run_bls -vv -V TestVolume001 FileStorage
ret=$?
if [ $ret -ne 0 ]; then
  echo "bls exit code: $ret"
  stop_bareos
  exit $ret
fi

FILE="weird-files/softlinkee"

if ! grep -q "${FILE}" "$tmp/bls.out"; then
  echo "Expected string \"${FILE}\" not found in bls output"
  exit 1
fi

end_test
