Skip to content

test: expand Bats coverage for hardening contracts - #198

Merged
openoms merged 3 commits into
openoms:masterfrom
autoblitzbot:test/full-bats-coverage
Aug 16, 2026
Merged

openoms merged 3 commits into
openoms:masterfrom
autoblitzbot:test/full-bats-coverage

Conversation

@autoblitzbot

Copy link
Copy Markdown
Contributor

Summary

  • add behavioral Bats coverage for safe joinin.conf parsing
  • cover generated systemd-service wallet and service-name validation
  • cover Tor hidden-service directory, service-name, and port validation
  • assert Tor configuration verification happens before atomic replacement
  • add repository-wide shell/Python syntax, systemd asset, and config-parser adoption contracts

Scope

This PR is test-only. It covers the hardening already merged through #187–#189 and #195 without duplicating production changes from the still-open #190–#194 branches. Those PRs carry their own focused Bats suites and will add them when merged.

Small production bugs directly demonstrated by this suite may be fixed here. Larger production changes will be split into separate PRs.

Test plan

  • bats tests/repository-contracts.bats tests/source-conf.bats tests/service-args.bats tests/hiddenservice-validation.bats (19 tests)
  • full recursive suite via GitHub Actions: bats -r tests

@RonDeBanc RonDeBanc left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — APPROVE

PR #198 adds 19 focused hardening-contract tests across four suites. I verified them on the PR head and on a combined master + #190–#194 + #198 integration tree; all merges were conflict-free and all 19 new tests passed.

Review results

  • The tests exercise behavior already present on master and do not depend on #190–#194.
  • They complement rather than duplicate the branch-specific suites in those PRs.
  • 17/19 tests are behavioral: config-parser acceptance/rejection and no-code-execution probes, service/wallet argument validation, and hidden-service validators.
  • The two grep/order tests pin important Tor invariants (pipefail, nonempty candidates, verify before atomic move). They are implementation-sensitive but reasonable contract guards.
  • Fixtures are isolated under BATS_TEST_TMPDIR; no sudo, network or systemd access is needed.
  • GNU userland assumptions match the supported Debian/RPi targets.

Mutation checks confirmed the suites detect all four tested regressions:

  1. removing set -o pipefail;
  2. weakening sourceConf metacharacter rejection;
  3. allowing arbitrary services in validateServiceArgs;
  4. reintroducing raw source joinin.conf.

Code verdict: approve. ShellCheck, Bats, spelling and arm64 image build pass. The amd64 image build is still pending and remains the final process gate.

Non-blocking: two hidden-service tests assert guard strings/order rather than running the complete Tor mutation path; retain runtime integration coverage elsewhere.


Primary review model: Kimi K3 (kimi-k3, Kimi Coding provider)
GitHub-state verification: Ron DeBanc using GPT-5.6 Sol (gpt-5.6-sol, OpenAI Codex provider)

@openoms openoms left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@openoms
openoms merged commit 5d708be into openoms:master Aug 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants