4 Commits

Author SHA1 Message Date
jared 2f74266bd9 Fix monitor loop double-sleep on error; add grep -F regression test
Lint / Python (flake8) (push) Successful in 49s
Lint / JS (eslint) (push) Successful in 9s
Security / Python Security (bandit) (push) Successful in 42s
Test / Python Tests (pytest) (push) Successful in 51s
Lint / Notify on failure (push) Has been skipped
Lint / Deploy (push) Successful in 3s
On exception the monitor slept 30s inside the except block then fell
through to time.sleep(poll_interval), giving a 150s recovery gap instead
of 30s. Adding continue after the error sleep fixes this.

Also adds a regression test asserting dmesg filtering uses grep -F --
so a future refactor cannot silently reintroduce the regex wildcard bug.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 13:16:43 -04:00
jared 77c74098a3 fix: flake8 E701 in avatar handler; update SSH test to match accept-new
Lint / Python (flake8) (push) Successful in 55s
Lint / JS (eslint) (push) Successful in 11s
Security / Python Security (bandit) (push) Successful in 1m15s
Test / Python Tests (pytest) (push) Successful in 59s
Lint / Notify on failure (push) Has been skipped
Lint / Deploy (push) Successful in 3s
- app.py: split 'with open(sentinel): pass' onto two lines (flake8 E701)
- tests/test_diagnose.py: rename test and assert StrictHostKeyChecking=accept-new (not =no which was fixed earlier)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 09:23:06 -04:00
jared 0d25dd74f1 test: expand diagnose test coverage — parsers, dmesg, lldp, and analyze
Lint / Python (flake8) (push) Failing after 40s
Lint / JS (eslint) (push) Successful in 8s
Security / Python Security (bandit) (push) Failing after 1m0s
Test / Python Tests (pytest) (push) Successful in 56s
Lint / Notify on failure (push) Successful in 7s
Lint / Deploy (push) Has been skipped
Add 47 new tests covering parse_ethtool_driver, parse_nic_stats,
parse_ethtool_dom (SFP DOM), parse_ip_link, parse_dmesg, parse_lldpctl,
and the analyze() health-analysis method with all issue/warning/info
code paths (NO_CARRIER, HALF_DUPLEX, SPEED_MISMATCH, SFP thresholds,
CRC errors, carrier flapping, LLDP mismatch/missing).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 19:53:35 -04:00
jared 50da3c0a59 Add pytest test suite and security scanning
Lint / Python (flake8) (push) Failing after 20s
Lint / JS (eslint) (push) Successful in 7s
Security / Python Security (bandit) (push) Failing after 22s
Test / Python Tests (pytest) (push) Successful in 32s
Lint / Deploy (push) Has been skipped
- Add 33 tests for DiagnosticsRunner static methods (build_ssh_command,
  parse_output, parse_sysfs_stats, parse_ethtool and variants)
- Add test.yml CI workflow running pytest on every push/PR
- Add security.yml CI workflow running bandit on every push/PR (weekly)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 12:22:57 -04:00