#! /usr/bin/env bash
# Copyright © 2011, 2012 Richard Kettlewell.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
set -e
. ${srcdir:-.}/setup.sh

setup

mv store1 store3

echo "| Create backup with overridden store"
RUN=store RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --backup --store `pwd`/store3 --text got/14.txt --html got/14.html
exists store-pre.ran
exists store-post.ran
compare volume1 store3/host1/volume1/1980-01-01
compare volume2 store3/host1/volume2/1980-01-01
absent store1/host1/volume1
absent store1/host1/volume2
absent store2/host1/volume1
absent store2/host1/volume2
compare ${srcdir:-.}/expect/14.txt got/14.txt
compare ${srcdir:-.}/expect/14.html got/14.html

cleanup
