From ce29b78233f6b20c84df5103bc97b31d724626dd Mon Sep 17 00:00:00 2001 From: Anders Blomdell <anders.blomdell@control.lth.se> Date: Thu, 21 Jan 2021 14:21:01 +0100 Subject: [PATCH] A little bit more quiet --- primary.py | 1 - test/test_sha512backup.sh | 19 +++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/primary.py b/primary.py index ee3fda5..aeeed9a 100644 --- a/primary.py +++ b/primary.py @@ -147,7 +147,6 @@ class Server: writer.close() self.failed = False finally: - self.log.MESSAGE('shutting down tar_socket') tar_socket.shutdown(socket.SHUT_RDWR) pass diff --git a/test/test_sha512backup.sh b/test/test_sha512backup.sh index d0a14d1..d33376b 100755 --- a/test/test_sha512backup.sh +++ b/test/test_sha512backup.sh @@ -37,6 +37,13 @@ secondary { EOF } +run() { + if [ -z "${VERBOSE}" ] ; then + $@ 2> /dev/null + else + $@ + fi +} mkdir -p "${TESTDIR}/1/test" mkdir -p "${TESTDIR}/1/TRASH" mkdir -p "${TESTDIR}/2/.git/refs" @@ -48,7 +55,7 @@ config > "${TESTDIR}/2/TOTALBACKUP.config" #../config.py <(config) cp ../sha512backup "${TESTDIR}/" -${TESTDIR}/sha512backup --xattr --primary <(config) 2> /dev/null +run ${TESTDIR}/sha512backup --xattr --primary <(config) # Check that source and dest are equal diff -u \ <(cd ../test ; find | sort) \ @@ -61,10 +68,10 @@ diff -u \ rm ${TESTFILE} # Make sure source and dest differs -! \ - diff -u \ - <(cd ../test ; find | sort) \ - <(cd ${TESTDIR}/1/test ; find | sort) +[ $(diff -u \ + <(cd ../test ; find | sort) \ + <(cd ${TESTDIR}/1/test ; find | sort) \ + | egrep '^[+-][^+-]') == "+${TESTFILE}" ] diff -u \ <(cd ../test ; find | sort) \ <(cd ${TESTDIR}/1/test ; find | grep -v "${TESTFILE}" | sort) @@ -73,7 +80,7 @@ diff -u \ <(cd ${TESTDIR}/2/.git/refs ; find | sort) # Bring dest to sync -${TESTDIR}/sha512backup --xattr --primary <(config) 2> /dev/null +run ${TESTDIR}/sha512backup --xattr --primary <(config) # Check that source and dest are equal diff -u \ -- GitLab