[PATCH] test: verify test database v1 checksum in more portable way

Tomi Ollila tomi.ollila at iki.fi
Sun Mar 12 11:31:55 PDT 2017


Replaced use of sha256 (gnu coreutils binary) with more portable
openssl sha256 execution.
---

Works on Linux and also on my FreeBSD KVM environment.

 test/T530-upgrade.sh                          | 6 ++++--
 test/test-databases/database-v1.tar.xz.sha256 | 1 -
 2 files changed, 4 insertions(+), 3 deletions(-)
 delete mode 100644 test/test-databases/database-v1.tar.xz.sha256

diff --git a/test/T530-upgrade.sh b/test/T530-upgrade.sh
index f0fd151..bda3f98 100755
--- a/test/T530-upgrade.sh
+++ b/test/T530-upgrade.sh
@@ -12,8 +12,10 @@ fi
 
 test_begin_subtest "database checksum"
 test_expect_success \
-    '( cd $TEST_DIRECTORY/test-databases &&
-       sha256sum --quiet --check --status ${dbtarball}.sha256 )'
+    'case `openssl sha256 $TEST_DIRECTORY/test-databases/${dbtarball}` in
+	*4299e051b10e1fa7b33ea2862790a09ebfe96859681804e5251e130f800e69d2*) ;;
+	*) false ;;
+     esac'
 
 tar xf $TEST_DIRECTORY/test-databases/${dbtarball} -C ${MAIL_DIR} --strip-components=1
 
diff --git a/test/test-databases/database-v1.tar.xz.sha256 b/test/test-databases/database-v1.tar.xz.sha256
deleted file mode 100644
index 2cc4f96..0000000
--- a/test/test-databases/database-v1.tar.xz.sha256
+++ /dev/null
@@ -1 +0,0 @@
-4299e051b10e1fa7b33ea2862790a09ebfe96859681804e5251e130f800e69d2  database-v1.tar.xz
-- 
2.9.3



More information about the notmuch mailing list