tests: replace binary GPG keyrings with ASCII-armored keys
[gitweb.git] / t / lib-gpg.sh
index cd2baef383df7dbea5b1544a162f99573476520e..b611b78f5402aedabb19df3a46d7cf7a3ccd01be 100755 (executable)
@@ -16,12 +16,19 @@ else
                # Type DSA and Elgamal, size 2048 bits, no expiration date.
                # Name and email: C O Mitter <committer@example.com>
                # No password given, to enable non-interactive operation.
-               cp -R "$TEST_DIRECTORY"/lib-gpg ./gpghome
-               chmod 0700 gpghome
-               chmod 0600 gpghome/*
+               mkdir ./gpghome
+               chmod 0700 ./gpghome
                GNUPGHOME="$(pwd)/gpghome"
                export GNUPGHOME
+               gpg --homedir "${GNUPGHOME}" --import \
+                       "$TEST_DIRECTORY"/lib-gpg/keyring.gpg
+               gpg --homedir "${GNUPGHOME}" --import-ownertrust \
+                       "$TEST_DIRECTORY"/lib-gpg/ownertrust
                test_set_prereq GPG
+               if echo | gpg --homedir "${GNUPGHOME}" -b --rfc1991 >/dev/null 2>&1
+               then
+                       test_set_prereq RFC1991
+               fi
                ;;
        esac
 fi