summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-key-net-update
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-12-11 15:08:30 +0100
committerMichael Vogt <mvo@debian.org>2013-12-11 15:08:30 +0100
commitfc85b0d8f3c2d63efcad2590e021d70c2ba700da (patch)
tree8941a0c440043d075251c3557e45713f701f61b3 /test/integration/test-apt-key-net-update
parent37f45a579d4344c3ef6a044b12b992353e238301 (diff)
fix test/integration/test-apt-key-net-update (code copy/DRY violation)
Diffstat (limited to 'test/integration/test-apt-key-net-update')
-rwxr-xr-xtest/integration/test-apt-key-net-update15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/integration/test-apt-key-net-update b/test/integration/test-apt-key-net-update
index d5205836f..2e72d1d62 100755
--- a/test/integration/test-apt-key-net-update
+++ b/test/integration/test-apt-key-net-update
@@ -24,6 +24,21 @@ GPG_CMD="gpg --ignore-time-conflict --no-options --no-default-keyring"
GPG="$GPG_CMD --keyring $TRUSTEDFILE"
MASTER_KEYRING=/usr/share/keyrings/ubuntu-master-keyring.gpg
+# COPYIED from apt-key.in --------------
+
+# gpg needs a trustdb to function, but it can't be invalid (not even empty)
+# so we create a temporary directory to store our fresh readable trustdb in
+TRUSTDBDIR="$(mktemp -d)"
+CURRENTTRAP="${CURRENTTRAP} rm -rf '${TRUSTDBDIR}';"
+trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
+chmod 700 "$TRUSTDBDIR"
+# We also don't use a secret keyring, of course, but gpg panics and
+# implodes if there isn't one available - and writeable for imports
+SECRETKEYRING="${TRUSTDBDIR}/secring.gpg"
+touch $SECRETKEYRING
+GPG_CMD="$GPG_CMD --secret-keyring $SECRETKEYRING"
+GPG_CMD="$GPG_CMD --trustdb-name ${TRUSTDBDIR}/trustdb.gpg"
+#----------------------------------------- END COPY
msgtest "add_keys_with_verify_against_master_keyring"
if [ ! -e $MASTER_KEYRING ]; then