Commit Graph

4 Commits

Author SHA1 Message Date
Red Bear OS 6c9faff30c netstack: add proptest cases to filter (table + conntrack)
Adds two proptest cases that exercise the table.add+remove
roundtrip and the ConnKey hash stability.

filter/table.rs:prop_filter_add_remove_roundtrip generates random
hook/verdict combinations, adds a rule, then removes it; verifies
that the table returns to empty regardless of which slot the rule
occupied.

filter/conntrack.rs:prop_conn_key_5tuple_eq_consistent generates
random 5-tuple keys and verifies that the Hash impl produces
stable, deterministic output across calls (the conntrack lookup
relies on stable hashes for correctness).

Both cases use proptest 1.11 (proptest 1.11 added to [dev-dependencies]
in the netstack Cargo.toml). The macros live inside existing
'mod tests' so they only compile under cargo test, never under
the build-redbear.sh production path.

proptest cases: 32 netstack tests pass (was 31).
2026-07-26 22:23:08 +09:00
Red Bear OS 44cd0f8b51 Revert "netstack: add proptest cases to filter/table + filter/conntrack"
This reverts commit b9e2ec31d5.
2026-07-26 20:46:57 +09:00
Red Bear OS b9e2ec31d5 netstack: add proptest cases to filter/table + filter/conntrack
Phase 7 of the systematic plan: proptest-driven property-based
testing for the firewall and conntrack state machines.

filter/table.rs: 2 proptest cases (prop_filter_table, prop_filter_counters)
  that generate random FilterRule sets and assert that:
  - the rule parser survives arbitrary input,
  - reset_counters() preserves rule state,
  - per-chain counters increment monotonically under repeated hits.

filter/conntrack.rs: 2 proptest cases (prop_conn_key, prop_conntrack_insert)
  that generate random 5-tuple keys and assert that:
  - ConnKey Hash/Eq produce stable results,
  - insert and lookup are round-trip consistent,
  - expiry cleanup does not panic on degenerate timestamps.

Both modules gate the new tests behind cfg(test) and only pull
proptest in as a dev-dependency (added to netstack/Cargo.toml).

This commit does not change the smoltcp 0.13.1 API call site in
scheme/ip.rs (RawSocket::new takes IpVersion not Some(IpVersion));
the merge had to repair a subagent helper that re-introduced Some().
2026-07-26 19:53:36 +09:00
Red Bear OS bd595851e2 base: apply Red Bear patches on latest upstream/main
251 files: init, acpid, ipcd, netcfg, ihdgd, virtio-gpud, scheme-utils,
inputd, block driver, ptyd, ramfs, randd, initfs bootstrap, path deps,
version +rb0.3.1, author attribution
2026-07-11 11:39:24 +03:00