You are browsing as a guest. Sign up (or log in) to start making projects!

2h 0m logged

Add server integration test suite and library target for external testing

Create 17 integration tests in pwr-server/tests/server_integration.rs
covering the full server subsystem. Storage CRUD tests (6) verify project
creation with duplicate rejection, removal, archive read/write round-trips
through the storage layer, persistence across re-opens via registry JSON,
and size limit enforcement rejecting archives exceeding the configured
max_project_size_gb. PSK handshake tests (3) validate the full mutual
authentication flow with correct proof verification and wrong-PSK
rejection. Frame-level integration tests (3) exercise the complete
serialization pipeline: Handshake framing round-trip with client_id and
nonce preservation, ArchiveRequest framing with all fields intact, and
server message decode direction checking.

File chunk streaming tests (2) simulate the chunk protocol by encoding
250 KB of cyclical data across 4 KB chunks with 4-byte length prefixes
and EOF markers, reassembling on the receiver side and verifying content
equality. An empty archive test confirms that a standalone EOF marker
produces zero bytes of received data. Rate limiter tests (3) verify the
6th attempt is blocked after 5 allowed, success resets the window, and
different IPs are tracked independently.

A full archive-restore simulation test writes 500 KB of data through the
storage layer, reads it back, and verifies byte-exact restoration plus
metadata persistence. A cleanup test confirms that removing a project
after a failed archive deletes both the archive file and registry entry.

To support external integration tests, a library target (lib.rs) is added
to pwr-server, re-exporting all modules as public while the binary target
(main.rs) retains its own private module declarations.

0
0

Comments 0

No comments yet. Be the first!