diff mbox series

[2/4] oeqa: selftest: signing: Use supported method to set auto-expand-secmem

Message ID 20261030-selftest-fixes-v1-2-1ba0fc952001@pbarker.dev
State New
Headers show
Series Selftest fixes | expand

Commit Message

Paul Barker Oct. 30, 2026, 6:22 p.m. UTC
Using a `|` character with `gpg --agent-program` to specify arguments
for the gpg-agent process is not officially supported. The docs describe
it as "a regression test suite hack" [1].

As we are already placing the gpg homedir in a temporary directory, we
can instead create a gpg-agent.conf file to specify this option.

[1]: https://www.gnupg.org/documentation/manuals/gnupg24/gpg.1.html

Signed-off-by: Paul Barker <paul@pbarker.dev>
---
 meta/lib/oeqa/selftest/cases/signing.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/lib/oeqa/selftest/cases/signing.py b/meta/lib/oeqa/selftest/cases/signing.py
index 0471ddfd7e92..6269536d1d61 100644
--- a/meta/lib/oeqa/selftest/cases/signing.py
+++ b/meta/lib/oeqa/selftest/cases/signing.py
@@ -33,7 +33,10 @@  class Signing(OESelftestTestCase):
 
         nsysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "gnupg-native")
 
-        runCmd('gpg --agent-program=`which gpg-agent`\|--auto-expand-secmem --batch --homedir %s --import %s %s' % (self.gpg_dir, self.pub_key_path, self.secret_key_path), native_sysroot=nsysroot)
+        with open(os.path.join(self.gpg_dir, "gpg-agent.conf"), "w") as f:
+            f.write("auto-expand-secmem\n")
+
+        runCmd('gpg --batch --homedir %s --import %s %s' % (self.gpg_dir, self.pub_key_path, self.secret_key_path), native_sysroot=nsysroot)
         return nsysroot