Skip to content

feat: add 6 validators (batch 1/5) - cpuset_partition, sr_iov_{boolean,uint32}, managed_oom_mem_pressure_{limit,duration_sec}, dhcp_server_emit#445

Merged
SJrX merged 1 commit into
242.xfrom
issue-444
May 23, 2026
Merged

feat: add 6 validators (batch 1/5) - cpuset_partition, sr_iov_{boolean,uint32}, managed_oom_mem_pressure_{limit,duration_sec}, dhcp_server_emit#445
SJrX merged 1 commit into
242.xfrom
issue-444

Conversation

@SJrX
Copy link
Copy Markdown
Owner

@SJrX SJrX commented May 23, 2026

Summary

First of 5 planned batches to extend the OptionValueTest burn-down buffer through July. Each grammar mirrors the systemd C parser semantics rather than guessing from man-page prose.

Validator C source Usages Approach
config_parse_cpuset_partition(0) cgroup-util.c:134 6 Enum: member / root / isolated
config_parse_sr_iov_boolean(0) netif-sriov.c:549 6 parse_boolean — reuse BOOLEAN
config_parse_sr_iov_uint32(0) netif-sriov.c:393 6 Conservative uint32 (per-lvalue bounds skipped)
config_parse_managed_oom_mem_pressure_limit(0) load-fragment.c:4017 6 parse_permyriad, ASCII % form
config_parse_managed_oom_mem_pressure_duration_sec(0) load-fragment.c:4055 6 parse_sec time value (TIME_VALUE)
config_parse_dhcp_server_emit(0) networkd-dhcp-server.c:827 6 List of IPv4 or _server_address

Resolves #444.

Results

  • OptionValueTest missing functions: 400 → 394 (−6)
  • Found keys: 1744 → 1780 (+36 newly-validated occurrences)
  • Today's allowed: 411; we're at 394, so buffer extends ~17 days
  • Estimated burn-down failure date pushes from ~2026-06-03 to ~2026-06-09

Test plan

  • All 6 new test classes pass
  • OptionValueTest passes
  • SemanticDataRepositoryTest passes
  • Full suite passes (./gradlew test -x generateDataFromManPages)
  • CI green

Notes

  • dhcp_server_emit was used by DHCPServer.DNS=/NTP=/SIP=/POP3=/SMTP=/LPR= (not the EmitDNS=-style booleans, which are separate config_parse_bool entries — easy mistake when looking at the function name).
  • sr_iov_* tests target .link files, not .network — the project only lists [SR-IOV] as a valid section in link files even though the gperf appears in both.
  • managed_oom_mem_pressure_duration_sec enforces >= 1s at the C semantic layer; that can't be expressed in the grammar, so a runtime warning at unit-load remains the only catch for values like 500ms.

Skipped from the original candidate list:

  • config_parse_set_status(0) — accepts list of exit codes + signal names, too many enum values to mirror cleanly
  • config_parse_delegate_subgroup(0) — needs cg_needs_escape semantics, hard to validate cheaply

🤖 Generated with Claude Code

…anaged_oom_mem_pressure_{limit,duration_sec}, dhcp_server_emit (Resolves #444)

First of ~5 batches to extend the OptionValueTest burn-down buffer through July.
Each grammar mirrors the systemd C parser semantics:

- config_parse_cpuset_partition: enum member|root|isolated (DEFINE_CONFIG_PARSE_ENUM_WITH_DEFAULT)
- config_parse_sr_iov_boolean: plain parse_boolean
- config_parse_sr_iov_uint32: conservative uint32 (per-lvalue bounds skipped — no lvalue access)
- config_parse_managed_oom_mem_pressure_limit: parse_permyriad, ASCII % form (0..100(.NN)?%)
- config_parse_managed_oom_mem_pressure_duration_sec: parse_sec time value (>= 1s constraint
  is semantic and not expressible in grammar)
- config_parse_dhcp_server_emit: whitespace-separated list of IPv4 addresses or _server_address;
  used by DHCPServer.DNS=/NTP=/SIP=/POP3=/SMTP=/LPR= (not the EmitDNS= booleans)

OptionValueTest missing-function count drops 400 -> 394; found-key count rises 1744 -> 1780.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Test Results

1 036 tests   1 036 ✅  42s ⏱️
  257 suites      0 💤
  257 files        0 ❌

Results for commit fec6ab3.

@SJrX SJrX merged commit c50f7b5 into 242.x May 23, 2026
3 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.

Add validators for cpuset_partition, sr_iov_boolean, sr_iov_uint32, managed_oom_mem_pressure_{limit,duration_sec}, dhcp_server_emit

1 participant