This is an automated email from the ASF dual-hosted git repository.

hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git


The following commit(s) were added to refs/heads/main by this push:
     new adb62ebca1 [IT] fix pgp tests (#8469)
adb62ebca1 is described below

commit adb62ebca1591fff8f756266693029af1475edc1
Author: Hans Van Akelyen <[email protected]>
AuthorDate: Sat Sep 19 17:46:36 2026 +0200

    [IT] fix pgp tests (#8469)
---
 integration-tests/pgp/main-0001-pgp-sign-and-verify.hwf        | 10 ++++++++++
 .../pgp/main-0002-pgp-sign-encrypt-and-decrypt.hwf             | 10 ++++++++++
 .../pgp/main-0003-pgp-sign-folder-with-hostile-filenames.hwf   | 10 ++++++++++
 .../pgp/main-0004-pgp-encrypt-binary-roundtrip.hwf             | 10 ++++++++++
 .../pgp/main-0005-pgp-verify-detached-signature.hwf            | 10 ++++++++++
 .../pgp/main-0006-pgp-decrypt-with-passphrase.hwf              |  3 +++
 integration-tests/pgp/main-0007-pgp-stream-transforms.hwf      | 10 ++++++++++
 .../pgp/main-0008-pgp-filename-command-injection.hwf           | 10 ++++++++++
 8 files changed, 73 insertions(+)

diff --git a/integration-tests/pgp/main-0001-pgp-sign-and-verify.hwf 
b/integration-tests/pgp/main-0001-pgp-sign-and-verify.hwf
index 998e2c3ceb..258d50f26f 100644
--- a/integration-tests/pgp/main-0001-pgp-sign-and-verify.hwf
+++ b/integration-tests/pgp/main-0001-pgp-sign-and-verify.hwf
@@ -79,6 +79,13 @@ if [ -z "$GPG_BIN" ]; then
   exit 1
 fi
 
+# gpg starts an agent bound to this home's socket and leaves it running. 
Deleting the home
+# under a live agent, then racing gpg's five-second auto-launch of a fresh 
one, is what made
+# key generation fail now and then with "No agent running" or "Broken pipe". 
Stop the previous
+# test's agent first.
+if [ -d "$GNUPG_HOME" ]; then
+  gpgconf --homedir "$GNUPG_HOME" --kill all &gt;/dev/null 2&gt;&amp;1 || true
+fi
 rm -rf "$GNUPG_HOME"
 mkdir -p "$GNUPG_HOME"
 chmod 700 "$GNUPG_HOME"
@@ -89,6 +96,9 @@ chmod 700 "$GNUPG_HOME"
 printf '#!/bin/sh\nexec "%s" --homedir "%s" "$@"\n' "$GPG_BIN" "$GNUPG_HOME" 
&gt; "$WRAPPER"
 chmod 700 "$WRAPPER"
 
+# Start the agent for this home ourselves, and wait for it, before asking it 
for a key.
+gpg-connect-agent --homedir "$GNUPG_HOME" /bye &gt;/dev/null 2&gt;&amp;1 || 
true
+
 # The key carries no passphrase: the PGP encrypt action has no passphrase 
field, so signing can
 # only ever use a key gpg is able to unlock on its own.
 "$GPG_BIN" --homedir "$GNUPG_HOME" --batch --yes --pinentry-mode loopback 
--passphrase '' \
diff --git a/integration-tests/pgp/main-0002-pgp-sign-encrypt-and-decrypt.hwf 
b/integration-tests/pgp/main-0002-pgp-sign-encrypt-and-decrypt.hwf
index 7def46f7a0..cb0dd719d1 100644
--- a/integration-tests/pgp/main-0002-pgp-sign-encrypt-and-decrypt.hwf
+++ b/integration-tests/pgp/main-0002-pgp-sign-encrypt-and-decrypt.hwf
@@ -78,6 +78,13 @@ if [ -z "$GPG_BIN" ]; then
   exit 1
 fi
 
+# gpg starts an agent bound to this home's socket and leaves it running. 
Deleting the home
+# under a live agent, then racing gpg's five-second auto-launch of a fresh 
one, is what made
+# key generation fail now and then with "No agent running" or "Broken pipe". 
Stop the previous
+# test's agent first.
+if [ -d "$GNUPG_HOME" ]; then
+  gpgconf --homedir "$GNUPG_HOME" --kill all &gt;/dev/null 2&gt;&amp;1 || true
+fi
 rm -rf "$GNUPG_HOME"
 mkdir -p "$GNUPG_HOME"
 chmod 700 "$GNUPG_HOME"
@@ -88,6 +95,9 @@ chmod 700 "$GNUPG_HOME"
 printf '#!/bin/sh\nexec "%s" --homedir "%s" "$@"\n' "$GPG_BIN" "$GNUPG_HOME" > 
"$WRAPPER"
 chmod 700 "$WRAPPER"
 
+# Start the agent for this home ourselves, and wait for it, before asking it 
for a key.
+gpg-connect-agent --homedir "$GNUPG_HOME" /bye &gt;/dev/null 2&gt;&amp;1 || 
true
+
 # The key carries no passphrase: the PGP encrypt action has no passphrase 
field, so signing can
 # only ever use a key gpg is able to unlock on its own.
 "$GPG_BIN" --homedir "$GNUPG_HOME" --batch --yes --pinentry-mode loopback 
--passphrase '' \
diff --git 
a/integration-tests/pgp/main-0003-pgp-sign-folder-with-hostile-filenames.hwf 
b/integration-tests/pgp/main-0003-pgp-sign-folder-with-hostile-filenames.hwf
index ec826655ae..7c5bbcf751 100644
--- a/integration-tests/pgp/main-0003-pgp-sign-folder-with-hostile-filenames.hwf
+++ b/integration-tests/pgp/main-0003-pgp-sign-folder-with-hostile-filenames.hwf
@@ -81,6 +81,13 @@ if [ -z "$GPG_BIN" ]; then
   exit 1
 fi
 
+# gpg starts an agent bound to this home's socket and leaves it running. 
Deleting the home
+# under a live agent, then racing gpg's five-second auto-launch of a fresh 
one, is what made
+# key generation fail now and then with "No agent running" or "Broken pipe". 
Stop the previous
+# test's agent first.
+if [ -d "$GNUPG_HOME" ]; then
+  gpgconf --homedir "$GNUPG_HOME" --kill all &gt;/dev/null 2&gt;&amp;1 || true
+fi
 rm -rf "$GNUPG_HOME" "$DROP" "$SIGNED"
 mkdir -p "$GNUPG_HOME" "$DROP" "$SIGNED"
 chmod 700 "$GNUPG_HOME"
@@ -88,6 +95,9 @@ chmod 700 "$GNUPG_HOME"
 printf '#!/bin/sh\nexec "%s" --homedir "%s" "$@"\n' "$GPG_BIN" "$GNUPG_HOME" 
&gt; "$WRAPPER"
 chmod 700 "$WRAPPER"
 
+# Start the agent for this home ourselves, and wait for it, before asking it 
for a key.
+gpg-connect-agent --homedir "$GNUPG_HOME" /bye &gt;/dev/null 2&gt;&amp;1 || 
true
+
 "$GPG_BIN" --homedir "$GNUPG_HOME" --batch --yes --pinentry-mode loopback 
--passphrase '' \
   --quiet --quick-generate-key "Hop Integration Test 
&lt;[email protected]&gt;" default default never 2&gt;&amp;1
 
diff --git a/integration-tests/pgp/main-0004-pgp-encrypt-binary-roundtrip.hwf 
b/integration-tests/pgp/main-0004-pgp-encrypt-binary-roundtrip.hwf
index 2b7ec8e790..b411f69723 100644
--- a/integration-tests/pgp/main-0004-pgp-encrypt-binary-roundtrip.hwf
+++ b/integration-tests/pgp/main-0004-pgp-encrypt-binary-roundtrip.hwf
@@ -79,6 +79,13 @@ if [ -z "$GPG_BIN" ]; then
   exit 1
 fi
 
+# gpg starts an agent bound to this home's socket and leaves it running. 
Deleting the home
+# under a live agent, then racing gpg's five-second auto-launch of a fresh 
one, is what made
+# key generation fail now and then with "No agent running" or "Broken pipe". 
Stop the previous
+# test's agent first.
+if [ -d "$GNUPG_HOME" ]; then
+  gpgconf --homedir "$GNUPG_HOME" --kill all &gt;/dev/null 2&gt;&amp;1 || true
+fi
 rm -rf "$GNUPG_HOME"
 mkdir -p "$GNUPG_HOME"
 chmod 700 "$GNUPG_HOME"
@@ -86,6 +93,9 @@ chmod 700 "$GNUPG_HOME"
 printf '#!/bin/sh\nexec "%s" --homedir "%s" "$@"\n' "$GPG_BIN" "$GNUPG_HOME" 
&gt; "$WRAPPER"
 chmod 700 "$WRAPPER"
 
+# Start the agent for this home ourselves, and wait for it, before asking it 
for a key.
+gpg-connect-agent --homedir "$GNUPG_HOME" /bye &gt;/dev/null 2&gt;&amp;1 || 
true
+
 "$GPG_BIN" --homedir "$GNUPG_HOME" --batch --yes --pinentry-mode loopback 
--passphrase '' \
   --quiet --quick-generate-key "Hop Integration Test 
&lt;[email protected]&gt;" default default never 2&gt;&amp;1
 
diff --git a/integration-tests/pgp/main-0005-pgp-verify-detached-signature.hwf 
b/integration-tests/pgp/main-0005-pgp-verify-detached-signature.hwf
index fdf2521098..25bbf19067 100644
--- a/integration-tests/pgp/main-0005-pgp-verify-detached-signature.hwf
+++ b/integration-tests/pgp/main-0005-pgp-verify-detached-signature.hwf
@@ -80,6 +80,13 @@ if [ -z "$GPG_BIN" ]; then
   exit 1
 fi
 
+# gpg starts an agent bound to this home's socket and leaves it running. 
Deleting the home
+# under a live agent, then racing gpg's five-second auto-launch of a fresh 
one, is what made
+# key generation fail now and then with "No agent running" or "Broken pipe". 
Stop the previous
+# test's agent first.
+if [ -d "$GNUPG_HOME" ]; then
+  gpgconf --homedir "$GNUPG_HOME" --kill all &gt;/dev/null 2&gt;&amp;1 || true
+fi
 rm -rf "$GNUPG_HOME" "$DETACHED"
 mkdir -p "$GNUPG_HOME" "$DETACHED"
 chmod 700 "$GNUPG_HOME"
@@ -87,6 +94,9 @@ chmod 700 "$GNUPG_HOME"
 printf '#!/bin/sh\nexec "%s" --homedir "%s" "$@"\n' "$GPG_BIN" "$GNUPG_HOME" 
&gt; "$WRAPPER"
 chmod 700 "$WRAPPER"
 
+# Start the agent for this home ourselves, and wait for it, before asking it 
for a key.
+gpg-connect-agent --homedir "$GNUPG_HOME" /bye &gt;/dev/null 2&gt;&amp;1 || 
true
+
 "$GPG_BIN" --homedir "$GNUPG_HOME" --batch --yes --pinentry-mode loopback 
--passphrase '' \
   --quiet --quick-generate-key "Hop Integration Test 
&lt;[email protected]&gt;" default default never 2&gt;&amp;1
 
diff --git a/integration-tests/pgp/main-0006-pgp-decrypt-with-passphrase.hwf 
b/integration-tests/pgp/main-0006-pgp-decrypt-with-passphrase.hwf
index 0656dfa42a..f5d9c77471 100644
--- a/integration-tests/pgp/main-0006-pgp-decrypt-with-passphrase.hwf
+++ b/integration-tests/pgp/main-0006-pgp-decrypt-with-passphrase.hwf
@@ -92,6 +92,9 @@ chmod 700 "$GNUPG_HOME"
 printf '#!/bin/sh\nexec "%s" --homedir "%s" "$@"\n' "$GPG_BIN" "$GNUPG_HOME" 
&gt; "$WRAPPER"
 chmod 700 "$WRAPPER"
 
+# Start the agent for this home ourselves, and wait for it, before asking it 
for a key.
+gpg-connect-agent --homedir "$GNUPG_HOME" /bye &gt;/dev/null 2&gt;&amp;1 || 
true
+
 "$GPG_BIN" --homedir "$GNUPG_HOME" --batch --yes --pinentry-mode loopback \
   --passphrase "$PASSPHRASE" --quiet \
   --quick-generate-key "Hop Locked Key &lt;[email protected]&gt;" default 
default never 2&gt;&amp;1
diff --git a/integration-tests/pgp/main-0007-pgp-stream-transforms.hwf 
b/integration-tests/pgp/main-0007-pgp-stream-transforms.hwf
index 0cbf1a289c..ef6858baa5 100644
--- a/integration-tests/pgp/main-0007-pgp-stream-transforms.hwf
+++ b/integration-tests/pgp/main-0007-pgp-stream-transforms.hwf
@@ -78,6 +78,13 @@ if [ -z "$GPG_BIN" ]; then
   exit 1
 fi
 
+# gpg starts an agent bound to this home's socket and leaves it running. 
Deleting the home
+# under a live agent, then racing gpg's five-second auto-launch of a fresh 
one, is what made
+# key generation fail now and then with "No agent running" or "Broken pipe". 
Stop the previous
+# test's agent first.
+if [ -d "$GNUPG_HOME" ]; then
+  gpgconf --homedir "$GNUPG_HOME" --kill all &gt;/dev/null 2&gt;&amp;1 || true
+fi
 rm -rf "$GNUPG_HOME"
 mkdir -p "$GNUPG_HOME"
 chmod 700 "$GNUPG_HOME"
@@ -85,6 +92,9 @@ chmod 700 "$GNUPG_HOME"
 printf '#!/bin/sh\nexec "%s" --homedir "%s" "$@"\n' "$GPG_BIN" "$GNUPG_HOME" 
&gt; "$WRAPPER"
 chmod 700 "$WRAPPER"
 
+# Start the agent for this home ourselves, and wait for it, before asking it 
for a key.
+gpg-connect-agent --homedir "$GNUPG_HOME" /bye &gt;/dev/null 2&gt;&amp;1 || 
true
+
 # The decrypt stream transform requires a passphrase, so unlike the action 
tests this key has to
 # carry one.
 "$GPG_BIN" --homedir "$GNUPG_HOME" --batch --yes --pinentry-mode loopback \
diff --git a/integration-tests/pgp/main-0008-pgp-filename-command-injection.hwf 
b/integration-tests/pgp/main-0008-pgp-filename-command-injection.hwf
index 9718962742..87ad6602ee 100644
--- a/integration-tests/pgp/main-0008-pgp-filename-command-injection.hwf
+++ b/integration-tests/pgp/main-0008-pgp-filename-command-injection.hwf
@@ -81,6 +81,13 @@ if [ -z "$GPG_BIN" ]; then
   exit 1
 fi
 
+# gpg starts an agent bound to this home's socket and leaves it running. 
Deleting the home
+# under a live agent, then racing gpg's five-second auto-launch of a fresh 
one, is what made
+# key generation fail now and then with "No agent running" or "Broken pipe". 
Stop the previous
+# test's agent first.
+if [ -d "$GNUPG_HOME" ]; then
+  gpgconf --homedir "$GNUPG_HOME" --kill all &gt;/dev/null 2&gt;&amp;1 || true
+fi
 rm -rf "$GNUPG_HOME" "$DROP" "$SIGNED"
 mkdir -p "$GNUPG_HOME" "$DROP" "$SIGNED"
 chmod 700 "$GNUPG_HOME"
@@ -88,6 +95,9 @@ chmod 700 "$GNUPG_HOME"
 printf '#!/bin/sh\nexec "%s" --homedir "%s" "$@"\n' "$GPG_BIN" "$GNUPG_HOME" 
&gt; "$WRAPPER"
 chmod 700 "$WRAPPER"
 
+# Start the agent for this home ourselves, and wait for it, before asking it 
for a key.
+gpg-connect-agent --homedir "$GNUPG_HOME" /bye &gt;/dev/null 2&gt;&amp;1 || 
true
+
 "$GPG_BIN" --homedir "$GNUPG_HOME" --batch --yes --pinentry-mode loopback 
--passphrase '' \
   --quiet --quick-generate-key "Hop Integration Test 
&lt;[email protected]&gt;" default default never 2&gt;&amp;1
 

Reply via email to