Commit a79f4bfa authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Improve backup testing

parent 821d3622
......@@ -2,6 +2,7 @@
set -e
TESTFILE=$(mktemp ./delete.me.XXX)
TESTDIR=$(mktemp -d /var/tmp/$(basename $0).XXX)
cleanup() {
set -x
......@@ -46,8 +47,27 @@ config > "${TESTDIR}/2/TOTALBACKUP.config"
#config
#../config.py <(config)
../sha512backup --debug --xattr --primary <(config)
../sha512backup --debug --xattr --primary <(config)
find ${TESTDIR}
../md5backup --debug --xattr --primary <(config)
find ${TESTDIR}
../sha512backup --xattr --primary <(config) 2> /dev/null
# Check that source and dest are equal
diff -u <(cd ../test ; find) <(cd ${TESTDIR}/1/test ; find .)
diff -u <(cd ../.git/refs ; find) <(cd ${TESTDIR}/2/.git/refs ; find .)
# Delete temporary file
rm ${TESTFILE}
# Make sure source and dest differs
! diff -u <(cd ../test ; find) <(cd ${TESTDIR}/1/test ; find .)
diff -u <(cd ../.git/refs ; find) <(cd ${TESTDIR}/2/.git/refs ; find .)
# Bring dest to sync
../sha512backup --xattr --primary <(config) 2> /dev/null
# Check that source and dest are equal
diff -u <(cd ../test ; find) <(cd ${TESTDIR}/1/test ; find .)
diff -u <(cd ../.git/refs ; find) <(cd ${TESTDIR}/2/.git/refs ; find .)
# Check that deleted file exists in TRASH
[ -f ${TESTDIR}/1/TRASH/*/${TESTFILE} ]
# ../md5backup --xattr --primary <(config)
# find ${TESTDIR}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment