Skip to content
Snippets Groups Projects
Commit a79f4bfa authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Improve backup testing

parent 821d3622
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
set -e set -e
TESTFILE=$(mktemp ./delete.me.XXX)
TESTDIR=$(mktemp -d /var/tmp/$(basename $0).XXX) TESTDIR=$(mktemp -d /var/tmp/$(basename $0).XXX)
cleanup() { cleanup() {
set -x set -x
...@@ -46,8 +47,27 @@ config > "${TESTDIR}/2/TOTALBACKUP.config" ...@@ -46,8 +47,27 @@ config > "${TESTDIR}/2/TOTALBACKUP.config"
#config #config
#../config.py <(config) #../config.py <(config)
../sha512backup --debug --xattr --primary <(config) ../sha512backup --xattr --primary <(config) 2> /dev/null
../sha512backup --debug --xattr --primary <(config) # Check that source and dest are equal
find ${TESTDIR} diff -u <(cd ../test ; find) <(cd ${TESTDIR}/1/test ; find .)
../md5backup --debug --xattr --primary <(config) diff -u <(cd ../.git/refs ; find) <(cd ${TESTDIR}/2/.git/refs ; find .)
find ${TESTDIR}
# 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}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment