Skip to content

[Enhancement] Maximize deny_remote coverage in functional test suite - #444

Merged
mcdope merged 1 commit into
masterfrom
issue-420
Jul 1, 2026
Merged

[Enhancement] Maximize deny_remote coverage in functional test suite#444
mcdope merged 1 commit into
masterfrom
issue-420

Conversation

@mcdope

@mcdope mcdope commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

CI globally disabled deny_remote before running any tests (via a workflow step patching <defaults> directly), because the functional suite is driven entirely over SSH and deny_remote (which defaults to true) would otherwise deny every pamusb-check call. As a result, the sshd parent-process-chain detection path in local.c had zero test coverage — the one feature this CI environment is naturally positioned to exercise (since it always runs over SSH) was the one thing disabled before tests ran.

  • Adds test-check-deny-remote-ssh.sh, which exercises the sshd-ancestry denial path directly (no device/user setup needed, since the check fires before device inspection). It skips gracefully when not actually run over SSH, since there's no env var to fake an sshd ancestor (unlike XRDP_SESSION).
  • Replaces the blanket global disable with a bypass scoped to just the current CI user's <user> config entry, gated behind a new PAMUSB_CI_MODE=1 env var passed from the workflow. This keeps deny_remote enforced for everything except the handful of tests that need a successful pamusb-check call from the SSH-driven runner.
  • Removes the old "disable deny_remote option" workflow step entirely.

Why this approach

Scoping the bypass to the specific user (rather than <defaults>) means deny_remote stays "on" by default for the whole suite, and only the tests that structurally require a granted auth over SSH get an explicit, narrow opt-out — instead of the feature being untested end-to-end. Tests that build their own temp config from a copy of the live config (test-check-many-devices.sh, test-check-superuser-filtering.sh) automatically inherit the scoped bypass with no changes needed on their end.

Closes #420

Test plan

  • bash -n syntax check on the new/modified shell scripts
  • Verified locally that test-check-deny-remote-ssh.sh skips gracefully (exit 0) when not run over SSH
  • Full tests/can-actually-be-used/run-tests.sh run on the dedicated CI runner (real SSH session) confirming: new test denies + logs the expected message, and test-check-verify-created-config.sh / test-check-many-devices.sh / test-check-superuser-filtering.sh still pass under PAMUSB_CI_MODE=1
  • make test

🤖 This PR was generated with the assistance of Claude Code

I have read the rules

…420)

CI globally disabled deny_remote before running any tests, since the
functional suite is driven over SSH, leaving the sshd parent-chain
detection path in local.c completely untested. Add a dedicated test for
that path and replace the blanket disable with a bypass scoped to just
the current user's <user> config entry, so deny_remote stays enforced
for everything except the handful of tests that need pamusb-check to
succeed from the SSH-driven CI runner.

Closes #420

🤖 This PR was generated with the assistance of Claude Code

I have read the rules

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
@mcdope mcdope added the enhancement New feature or request label Jul 1, 2026
@mcdope mcdope self-assigned this Jul 1, 2026
@mcdope
mcdope merged commit 229371d into master Jul 1, 2026
34 of 35 checks passed
@mcdope
mcdope deleted the issue-420 branch July 1, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Maximize deny_remote coverage in functional test suite

1 participant