From: Jonathan Dieter Date: Thu, 26 Jul 2018 13:56:02 +0000 (+0100) Subject: Add new test script for running a program and checking the ouput checksum X-Git-Tag: archive/raspbian/1.1.9+ds1-1+rpi1~1^2~164 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=633c3fa933f10fb2c4b5ead435d93bb309ea6210;p=zchunk.git Add new test script for running a program and checking the ouput checksum Signed-off-by: Jonathan Dieter --- diff --git a/test/shacheck.sh b/test/shacheck.sh new file mode 100755 index 0000000..3690b15 --- /dev/null +++ b/test/shacheck.sh @@ -0,0 +1,13 @@ +#!/bin/sh +"$1" "$2" +if [ "$?" -ne 0 ]; then + exit 1 +fi + +ls -l + +CHKSUM=$(sha256sum "$3" | awk '{ print $1 }') +if [ "$CHKSUM" != "$4" ]; then + echo "Checksum doesn't match" + exit 1 +fi