CRG C Test Coverage — FlatRacoon Hesiod DNS Mapping
CRG Grade: C — ACHIEVED 2026-04-04
Date: 2026-04-04
Module: netstack/modules/hesiod-dns-map/crates/hesiod-lib/
Status: COMPLETE — All CRG C requirements met
Count: 16 tests
Location: src/config.rs, src/records.rs, src/zone.rs, src/server.rs
Categories:
Configuration parsing (2 tests)
Record round-trip serialization (6 tests)
Zone operations (4 tests)
DNS server resolution (3 tests)
File: tests/integration_tests.rs
Count: 21 tests
Categories:
smoke_minimal_zone_lookup — Basic zone creation and lookup
e2e_config_to_zone_pipeline — Full pipeline: HesiodConfig → HesiodZone → lookups (service, user, group)
e2e_bind_zone_generation — BIND zone file generation from config
reflexive_passwd_round_trip — PasswdRecord serialize/deserialize
reflexive_group_round_trip — GroupRecord serialize/deserialize
reflexive_service_round_trip — ServiceRecord serialize/deserialize
reflexive_filsys_round_trip — FilsysRecord serialize/deserialize
reflexive_hesiod_record_enum_round_trip — HesiodRecord enum round-trip
contract_lookup_returns_option — Lookup returns Some/None, never panics
contract_lookup_never_panics_on_missing_type — Wrong MapType returns None, not panic
contract_zone_empty_initially — New zone starts at 0 records
contract_zone_record_count_increments — record_count() increments correctly
contract_add_record_overwrites_existing — Same key overwrites, count unchanged
aspect_empty_string_name_returns_none — Empty lookup key returns None
aspect_very_long_name_returns_none — 10K-char name returns None
aspect_special_chars_in_name — Spaces, newlines, nulls, colons handled safely
aspect_malformed_passwd_txt_returns_err — Invalid fields error, not panic
aspect_malformed_service_txt_returns_err — Invalid port/fields error, not panic
aspect_malformed_group_txt_returns_err — Invalid gid/fields error, not panic
aspect_malformed_filsys_txt_returns_err — Invalid fields error, not panic
aspect_record_parse_malformed_map_type — Invalid map_type string errors gracefully
Framework: proptest 1.4
File: tests/property_tests.rs
Count: 11 tests
Categories:
prop_passwd_record_never_panics — Random valid passwd fields
prop_service_record_never_panics — Random valid service fields
prop_group_record_never_panics — Random valid group fields
prop_filsys_record_never_panics — Random valid filsys fields
Round-Trip Invariants (4)
prop_passwd_round_trip_preserves_data — All fields preserved
prop_service_round_trip_preserves_data — All fields preserved
prop_group_round_trip_preserves_data — All fields preserved
prop_filsys_round_trip_preserves_data — All fields preserved
prop_arbitrary_txt_never_panics_on_parse — Any string input handled gracefully
prop_map_type_parse_arbitrary_strings — Invalid map_type strings error, not panic
prop_very_long_fields_dont_panic — 1–2K character fields handled
Framework: Criterion 0.5
File: benches/hesiod_bench.rs
Count: 9 benchmarks
Baselines:
Benchmark
Purpose
zone_new_empty
Zone creation overhead
lookup_present_100_records
Lookup in populated zone (HashMap O(1))
lookup_missing_100_records
Lookup miss performance
zone_from_config_50svc_100users_20groups
Large config parsing
passwd_record_to_txt
Serialization
passwd_record_from_txt
Deserialization
bind_zone_output_50users_50services
BIND zone file generation (100 records)
passwd_record_round_trip
Full round-trip
service_record_round_trip
Full round-trip
Unit tests (inline): 16 passed
Integration tests: 21 passed
Property-based tests: 11 passed
───────────
Total: 48 passed
Benchmarks: 9 targets compiled successfully (no run-time failures)
Requirement
Evidence
Unit tests
16 inline tests in src/
Smoke tests
smoke_minimal_zone_lookup + e2e_*
Build
cargo build ✓
Property-based (P2P)
11 proptest tests covering round-trip invariants, no-panic properties, edge cases
E2E tests
e2e_config_to_zone_pipeline, e2e_bind_zone_generation
Reflexive tests
5 round-trip tests (all record types)
Contract tests
5 API invariant tests (lookup returns Option, never panics, record count logic)
Aspect tests
8 security/robustness tests (malformed input, special chars, empty/long names)
Benchmarks
9 Criterion baselines established
Key API Guarantees Validated
Lookup safety: zone.lookup(name, type) always returns Option<&HesiodRecord>, never panics
Serialization round-trip: All record types preserve data through TXT encode/decode cycles
Graceful error handling: Malformed TXT input returns Result::Err, not panic
Configuration pipeline: HesiodConfig → HesiodZone builds correctly with 0–100+ records
BIND zone generation: Produces valid HS-class TXT record syntax
Edge-case robustness: Empty strings, 10K-char names, null bytes, special chars all handled safely
File
Type
Change
crates/hesiod-lib/Cargo.toml
Modified
Added proptest, criterion dev-dependencies; [[bench]] section
crates/hesiod-lib/tests/integration_tests.rs
New
21 integration tests (E2E, reflexive, contract, aspect, smoke)
crates/hesiod-lib/tests/property_tests.rs
New
11 property-based tests (proptest framework)
crates/hesiod-lib/benches/hesiod_bench.rs
New
9 Criterion benchmarks
All new test files include SPDX header:
// SPDX-License-Identifier: CC-BY-SA-4.0
All CRG C requirements are now satisfied
Repository is ready for CRG B upgrade if needed (add doc tests, expand contract coverage)
Benchmarks provide baseline for performance regression detection