Test script for GPG agent functionality#78
Conversation
🤖 Augment PR SummarySummary: Adds a dedicated test script to validate GPG agent startup and cleanup behavior in the metaport test suite. Changes:
Technical Notes: Creates an isolated 🤖 Was this summary useful? React with 👍 or 👎 |
| verbose=true | ||
|
|
||
| # Locate zopen-install script to extract functions | ||
| if [ -f "${MYDIR}/../meta/bin/zopen-install" ]; then |
There was a problem hiding this comment.
MYDIR is never set in this script (and tests/include/common.sh doesn’t define it), so this first lookup will effectively check /meta/bin/zopen-install and likely never match. Also the /home/haritha/... fallback is machine-specific and can make this test non-portable in CI.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| fi | ||
|
|
||
| echo "Extracting functions from ${ZOPEN_INSTALL_SCRIPT}" | ||
| EXTRACTED_FUNCTIONS=$(sed -n '/^startGPGAgent() {/,/^}/p; /^gpgCleanup() {/,/^}/p' "${ZOPEN_INSTALL_SCRIPT}") |
There was a problem hiding this comment.
This sed range extraction is brittle: it stops at the first line beginning with }, so any brace blocks inside startGPGAgent/gpgCleanup (or a different formatting of the closing brace) could truncate the function and make the test fail for reasons unrelated to behavior.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| fi | ||
|
|
||
| # Check if agent is running for this GNUPGHOME | ||
| if ! gpgconf --list-dirs agent-socket >/dev/null 2>&1; then |
There was a problem hiding this comment.
gpgconf --list-dirs agent-socket typically succeeds even when the agent isn’t running (it just prints the configured socket path), so this check may not actually validate that startGPGAgent started anything.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| PUBLIC_KEY_FILE="$zopen_tmp_dir/pub.asc" | ||
| touch "$SIGNATURE_FILE" "$PUBLIC_KEY_FILE" | ||
|
|
||
| gpgCleanup |
There was a problem hiding this comment.
No description provided.