Skip to content

Commit

Permalink
Fix importing of test key
Browse files Browse the repository at this point in the history
- Testing for key didn't look for the secret key
- Import wasn't supplying the password
  • Loading branch information
mrworf committed Apr 21, 2024
1 parent 1935838 commit e61a129
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions extras/testsuite/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ function runTest() {
}

function hasGPGconfig() {
gpg --list-keys 2>/dev/null | grep [email protected] >/dev/null 2>/dev/null
gpg --list-secret-keys 2>/dev/null | grep [email protected] >/dev/null 2>/dev/null
return $?
}

Expand All @@ -312,14 +312,14 @@ if hash gpg ; then
HASKEY=false
if ! hasGPGconfig; then
echo "Importing test-key for test usage"
RESULT="$(gpg 2>&1 --fast-import test_key.*)"
RESULT="$(gpg 2>&1 --no-tty --batch --pinentry-mode loopback --passphrase test --fast-import test_key.*)"
RESULT2="$(echo "010034E91082BF022DBAF1FEA00E5EDACC9D1828:6:" | gpg 2>&1 --import-ownertrust)"
if [ $? -eq 0 ] ; then
if hasGPGconfig ; then
HASKEY=true
else
echo "=== ERROR: Unable to import GPG key for testing, encryption will not be tested"
echo "$RESULT"
echo "$RESULT2"
echo -e "Result 1:\n$RESULT"
echo -e "Result 2:\n$RESULT2"
exit 255
fi
else
Expand Down

0 comments on commit e61a129

Please sign in to comment.