diff --git a/test/test_sha512backup.sh b/test/test_sha512backup.sh index 9fe15c1dfcb27fdcdeb56d51619d627344bef258..84e2653dd1fa0352908f0a08b28d91adce995684 100755 --- a/test/test_sha512backup.sh +++ b/test/test_sha512backup.sh @@ -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} +