Skip to content

P6 + P1: live snmpd in CI, coverage gaps, dead nil-guards - #29

Merged
stakach merged 3 commits into
spider-gazelle:masterfrom
n-rodriguez:feat/p6-tests
Jul 13, 2026
Merged

P6 + P1: live snmpd in CI, coverage gaps, dead nil-guards#29
stakach merged 3 commits into
spider-gazelle:masterfrom
n-rodriguez:feat/p6-tests

Conversation

@n-rodriguez

Copy link
Copy Markdown
Contributor

The P6 (test gaps) group plus the last P1 item from the audit (#7).

Commits

  1. refactor(client): drop the dead nil-guards (P1) — with_socket returns the block's value (or raises), so the raise … if msg.nil? pattern around every public method was unreachable. Return directly.
  2. test: cover VarBind.from_value branches and set_unsigned padding — the String/Bool/Nil/BER/VarBind/unsupported branches of VarBind.from_value, and the set_unsigned64/32 padding: false minimal-encoding path.
  3. ci: run the legacy and live (snmpd) spec suites — the e2e suite had no server in CI and the three v3 live specs were pending! since the snmpsim days. The CI now provisions a real net-snmp agent:
    • spec/support/snmpd.conf: unprivileged agent on 127.0.0.1:16161 — v2c public, the sysContact the specs assert, and the three v3 users (usr-md5-none / usr-md5-aes / usr-md5-des).
    • The three v3 live specs are un-pended (MD5, MD5+AES, MD5+DES — the DES one runs with the OpenSSL legacy provider, activated by dev:spec-e2e).
    • The v2c SET spec now asserts the real agent behaviour — noAccess(6), error-index 1 — which also exercises non-zero error-status/index decoding against a live agent.
    • Both the Linux (apt snmpd) and macOS (brew net-snmp) jobs start the agent and run dev:spec-legacy + dev:spec-e2e on every build. New dev:snmpd mise task for running the agent locally.

Verification

  • Local (macOS, brew net-snmp 5.9.5.2): e2e 7/7 including all three v3 users.
  • Ubuntu 24.04 (Docker): DES v3 user creation + query verified; OpenSSL legacy provider present.
  • Deterministic 92/92, multi-threaded 92/92, legacy 3/3, ameba clean, format clean; commits bisect-clean.

Most other P6 items (error-status decoding, Counter64 bounds, walk boundary, ifType fallback, contextName, fuzz, v2 trap round-trips) were already covered by the specs added throughout the audit PRs — checked off in #7 with their PR links.

Tracked in #7.

🤖 Generated with Claude Code

n-rodriguez and others added 3 commits July 13, 2026 05:27
with_socket returns the block's value (or raises), so the msg-nil?-raise pattern
around every public method was unreachable. Return the block value directly.

- client: get / get_next / get_bulk / set / send_inform simplified

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- spec/varbind_from_value_spec: String/Int/Bool/Nil/BER/VarBind branches plus
  the unsupported-type ArgumentError
- spec/data_types_spec: set_unsigned64/32 padding: false (minimal encoding)
  and the padded round-trip

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The e2e suite had no server in CI and the three v3 live specs were pending
("not sure how to configure SNMPv3 on the simulator"). Provision a real
net-snmp agent instead — verified against brew net-snmp 5.9.5.2 (macOS) and
Ubuntu 24.04 snmpd (incl. the DES user and the OpenSSL legacy provider).

- spec/support/snmpd.conf: unprivileged test agent on 127.0.0.1:16161 — v2c
  public, the sysContact the specs assert, and the three v3 users
  (usr-md5-none / usr-md5-aes / usr-md5-des)
- spec/helper: TEST_SNMP_PORT (default 161); snmp_spec/client_spec use it
- snmp_spec: un-pend the three v3 live specs; the SET spec now asserts the
  real agent behaviour (noAccess(6), error-index 1 — exercising non-zero
  error-status/index decoding live)
- mise: dev:spec-e2e activates the OpenSSL legacy provider (DES); new
  dev:snmpd task runs the test agent locally
- ci: Linux (apt) and macOS (brew) jobs start the agent and run
  dev:spec-legacy + dev:spec-e2e on every build

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@stakach
stakach merged commit 2d634f4 into spider-gazelle:master Jul 13, 2026
6 checks passed
@n-rodriguez
n-rodriguez deleted the feat/p6-tests branch July 21, 2026 08:54
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.

2 participants