Count an up tether with unknown state in beta check 3.8 #137

Merged
aluminum-ice merged 1 commit from beta-check-tether-state into main 2026-11-01 10:14:32 +00:00
Owner

What this PR does

Fixes beta-check item 3.8, which skipped on a device whose tether was working. A Bluetooth PAN interface (bnep0) has no carrier state, so its operstate reads unknown even while the tether is up, and the check accepted only up. It now also counts unknown as up when the interface's IFF_UP flag is set (read from /sys/class/net/bnep0/flags; still read-only, no ip call). The census plugin itself isn't affected: it gates on the daemon's active paths, not on operstate.

Checklist

  • Lint passes — make lint (ansible --syntax-check, yamllint, shellcheck --severity=error, and the real-data check). The Lint workflow runs this on the PR.
  • Tests pass — make test (the kestrel_pi pytest suite and the real-data check's tests). The Test workflow runs this on the PR.
  • Nothing real: no secrets, no personal information, no real data. This is a public repository. The diff contains no real account passwords or hashes, Wi-Fi passphrases, private keys, API tokens, .env files, real names, personal emails, device serials, and no real captured or device data: SSIDs, MAC addresses, GPS coordinates, capture files, diagnostics bundles, logs, or screenshots of a real device — placeholders only. The real-data check catches MACs, emails, keys and capture files; real SSIDs, coordinates and screenshots are on you.
  • Consent gates intact. Capture and network plugins still ship disabled, enabling them still takes the authorized-use acknowledgment (never pre-ticked or given by code), and the capture whitelist is still enforced.
  • Docs updated in the same PR, if this changes something an operator sees or configures: the README package table, the relevant page under docs/, and the on-device operator guide (GUIDE_MD in kestrel_pi/userguide.py) where it applies.
  • Commit messages are short and imperative.

Release impact

  • App-layer-safe — changes only files the in-place update engine carries: the kestrel_pi package, plugins/*.py, systemd units, the journald drop-in, a lib script already in the engine's LIB_SCRIPTS, or the CLI.
  • Reflash-class — touches a build input the engine does not carry onto a running device: apt or pip packages, boot options / config.txt / cmdline, kernel modules, the base image or partition size, builder/config.json, builder/config.yml, the Makefile, the Release workflow (.forgejo/workflows/main.yml), a shipped config default (config.toml / default.conf), or a brand-new lib script.

Notes for review

  • The beta-check scripts aren't shipped in the image, so this doesn't affect any release; no docs change.
  • Checked off the device: the new tether logic against staged sysfs values (up → up; unknown with IFF_UP → up; unknown without it → unknown; down → down; missing → absent), the config harness (11 PASS, and 2 FAILs against a weakened plugins-ctl copy), and the redactor against an invented report (MACs, IPs, coordinates, a capture file name with a space, the login user and a fingerprint all masked). No pytest file covers this script, so make test is unchanged by it.
  • The scripts from this branch are attached to #133 for the next on-device run.

🤖 Generated with Claude Code

## What this PR does Fixes beta-check item 3.8, which skipped on a device whose tether was working. A Bluetooth PAN interface (`bnep0`) has no carrier state, so its `operstate` reads `unknown` even while the tether is up, and the check accepted only `up`. It now also counts `unknown` as up when the interface's `IFF_UP` flag is set (read from `/sys/class/net/bnep0/flags`; still read-only, no `ip` call). The census plugin itself isn't affected: it gates on the daemon's active paths, not on `operstate`. ## Checklist - [x] **Lint passes** — `make lint` (ansible `--syntax-check`, `yamllint`, `shellcheck --severity=error`, and the real-data check). The **Lint** workflow runs this on the PR. - [x] **Tests pass** — `make test` (the `kestrel_pi` pytest suite and the real-data check's tests). The **Test** workflow runs this on the PR. - [x] **Nothing real: no secrets, no personal information, no real data.** This is a public repository. The diff contains no real account passwords or hashes, Wi-Fi passphrases, private keys, API tokens, `.env` files, real names, personal emails, device serials, and no real captured or device data: SSIDs, MAC addresses, GPS coordinates, capture files, diagnostics bundles, logs, or screenshots of a real device — placeholders only. The real-data check catches MACs, emails, keys and capture files; real SSIDs, coordinates and screenshots are on you. - [x] **Consent gates intact.** Capture and network plugins still ship disabled, enabling them still takes the authorized-use acknowledgment (never pre-ticked or given by code), and the capture whitelist is still enforced. - [ ] **Docs updated in the same PR**, if this changes something an operator sees or configures: the README package table, the relevant page under `docs/`, and the on-device operator guide (`GUIDE_MD` in `kestrel_pi/userguide.py`) where it applies. - [x] Commit messages are short and imperative. ## Release impact - [x] **App-layer-safe** — changes only files the in-place update engine carries: the `kestrel_pi` package, `plugins/*.py`, systemd units, the journald drop-in, a lib script already in the engine's `LIB_SCRIPTS`, or the CLI. - [ ] **Reflash-class** — touches a build input the engine does not carry onto a running device: apt or pip packages, boot options / `config.txt` / `cmdline`, kernel modules, the base image or partition size, `builder/config.json`, `builder/config.yml`, the `Makefile`, the Release workflow (`.forgejo/workflows/main.yml`), a shipped config default (`config.toml` / `default.conf`), or a brand-new lib script. ## Notes for review - The beta-check scripts aren't shipped in the image, so this doesn't affect any release; no docs change. - Checked off the device: the new tether logic against staged sysfs values (`up` → up; `unknown` with `IFF_UP` → up; `unknown` without it → unknown; `down` → down; missing → absent), the config harness (11 PASS, and 2 FAILs against a weakened `plugins-ctl` copy), and the redactor against an invented report (MACs, IPs, coordinates, a capture file name with a space, the login user and a fingerprint all masked). No pytest file covers this script, so `make test` is unchanged by it. - The scripts from this branch are attached to #133 for the next on-device run. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Count an up tether with unknown state in beta check 3.8
All checks were successful
Lint / lint (push) Successful in 35s
Test / test (push) Successful in 38s
Lint / lint (pull_request) Successful in 35s
Test / test (pull_request) Successful in 34s
db9c9d2365
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aluminum-ice deleted branch beta-check-tether-state 2026-11-01 10:14:32 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aluminum-ice/kestrel!137
No description provided.