Skip to content

Table-ify the shared vendor_class predicate tests in dhcp and dhcp-server #2730

Description

@chet

dhcp and dhcp-server both carry a vendor_class.rs with ~14 single-predicate tests (it_is_pxe_capable, is_it_arm, is_it_x64, ... -- each does .parse().unwrap() then asserts one bool). The two files are near-identical, so the duplication spans crates.

Collapse each into one check_cases table over a named row ({ input, arm, x64, netboot, modern }), so a vendor-class string's full classification is one row. Add the MachineArchitecture::from_str numeric-code mapping ("00007" -> Arm64, "00016" -> EfiX64, unknown, ...) which is currently only exercised implicitly through VendorClass::from_str, and its Display strings.

Scope

  • crates/dhcp/src/vendor_class.rs and crates/dhcp-server/src/vendor_class.rs -- collapse the predicate tests; add the arch-code from_str / Display table.

Acceptance

  • Both crates' classification coverage preserved + the arch-code contract pinned; no production change.
  • cargo test green for both; cargo clippy --all-features + cargo make format-nightly clean.

Size: M

Part of #2692.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Task.

Projects

Status
Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions