From 20cf783bdbdfa7bbee8c703ac0af76a2e50cf4db Mon Sep 17 00:00:00 2001 From: deajan Date: Sun, 4 Sep 2016 21:37:24 +0200 Subject: [PATCH] Added gpg unit test --- dev/tests/run_tests.sh | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/dev/tests/run_tests.sh b/dev/tests/run_tests.sh index d1bf36e..381a0fd 100755 --- a/dev/tests/run_tests.sh +++ b/dev/tests/run_tests.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -## obackup basic tests suite 2016090402 +## obackup basic tests suite 2016090403 #TODO: Must recreate files before each test set @@ -62,6 +62,7 @@ CRYPT_EXTENSION=".obackup.gpg" ROTATE_1_EXTENSION=".obackup.1" PASSFILE="passfile" +CRYPT_TEST_FILE="testfile" function SetStableToYes () { if grep "^IS_STABLE=YES" "$OBACKUP_DIR/$OBACKUP_EXECUTABLE" > /dev/null; then @@ -95,16 +96,14 @@ function SetEncryption () { function SetupGPG { if type gpg2 > /dev/null; then - GPG=gpg2 - echo "USING GPG2" + CRYPT_TOOL=gpg2 elif type gpg > /dev/null; then - echo "USING GPG" - GPG=gpg + CRYPT_TOOL=gpg else echo "No gpg support" fi - if ! $GPG --list-keys | grep "John Doe" ; then + if ! $CRYPT_TOOL --list-keys | grep "John Doe" > /dev/null; then cat >gpgcommand <