Repository navigation
test: expand Bats coverage for hardening contracts - #198
Conversation
RonDeBanc
left a comment
There was a problem hiding this comment.
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:
- removing
set -o pipefail; - weakening
sourceConfmetacharacter rejection; - allowing arbitrary services in
validateServiceArgs; - 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)
Summary
joinin.confparsingScope
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)bats -r tests