From 150164d24f889f97e8ac1781b8a005633cbc4fff Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Tue, 27 Dec 2022 14:53:23 +0900 Subject: [PATCH] test: Set default GPG key when testing ipc module When initializing the environment for tests of the ipc module, the default GPG key is not explicitly set. Because newer GPG versions do not automatically set the default key, no default key is set, causing sign operations to fail. This commit modifies the test cases for the ipc module so that the default GPG key is set during the test setup. The default key is not set automatically on newer GPG versions --- test/ipc_spec.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/ipc_spec.sh b/test/ipc_spec.sh index 01549e0..c45aa63 100644 --- a/test/ipc_spec.sh +++ b/test/ipc_spec.sh @@ -22,6 +22,8 @@ export PATH="$PWD/..:$PATH" include "ipc" setup() { + local keyfp + if ! mkdir -p "/tmp/test.$$"; then return 1 fi @@ -51,6 +53,14 @@ EOF return 1 fi + if ! keypf=$(gpg -K 2>/dev/null | grep -m 1 -oP '[0-9a-fA-F]{40}'); then + return 2 + fi + + if ! printf 'default-key %s\nquiet\n' "$keypf" > "/tmp/test.$$/gpg.conf"; then + return 3 + fi + return 0 } -- 2.47.3