tests/vm_helpers.py: harden keyring unlock exit check, PTY drain, and coredumpctl status

Open
#482 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
linux, python, shell

Research direction

Start by reading tests/vm_helpers.py and the changes in PR #473, especially keyring_session_shell_command, run_logged_probe, and assert_no_coredumps. Trace how each helper handles command failure, PTY output after child exit, and coredumpctl list status. Done when unlock failures propagate under set -e, trailing PTY bytes are drained, and only status 1 with no coredump lines passes.

Written by the indexing model from the issue text.

Description

Follow-up nits from reviewing #473 (3cd9c70e) in tests/vm_helpers.py:

  1. keyring_session_shell_command masks gnome-keyring-daemon exit status under set -e:
    eval "$(printf %s ... | gnome-keyring-daemon --daemonize --unlock --components=secrets)" evaluates to exit status 0 in POSIX sh when the command substitution fails with empty stdout (e.g. sh -c 'set -e; eval "$(false)"; echo SURVIVED' prints SURVIVED). The subsequent NameHasOwner loop still catches an unowned bus in discord-startup, but assigning first (keyring_env=$(printf ... | gnome-keyring-daemon ...); eval "$keyring_env") will make set -e abort immediately on unlock failure for all callers.

  2. run_logged_probe can drop trailing PTY output on fast exit:
    Checking if proc.poll() is not None: break can leave buffered bytes unread on master if the child exits right after writing (especially in fast-fail paths). Drain master until EOF/EIO before breaking.

  3. assert_no_coredumps accepts any non-zero exit code:
    assert status != 0 and not lines would silently pass if coredumpctl failed to exec (127) or died with a signal. Require status == 1 (the exit code coredumpctl list uses when no coredumps exist).

Dominant language
Rust
Stars
38
Forks
3
Avg merge
1d 8h
Merged PRs (30d)
103

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bitemyapp/sekka

All issues in bitemyapp/sekka

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.