NLnetLabs / domain

A DNS library for Rust.
https://nlnetlabs.nl/projects/domain/about/
BSD 3-Clause "New" or "Revised" License
342 stars 58 forks source link

Make interop tests run as Rust integration tests. #364

Open ximon18 opened 1 month ago

ximon18 commented 1 month ago

By moving them under /tests so that #[cfg(test)] is not set and they do not thus get mock_instant time instead of real time.

As the interop test tests domain as a black box and against other running applications integration test seems like the right thing to do anyway, but in this case this is needed by the xfr branch which modifies Time48 to use mock time when run in test mode, i.e. when #[cfg(test)] is set. If the interop test is not moved it gets compiled with mock time and thus TSIG signature checking fails.

This PR also removes some code which doesn't seem to be used anywhere and which Clippy was complaining about.

Tested by running:

$ cargo test --all-features --test interop -- --ignored
...
test tsig_client_nsd ... ok
[2024-07-24 23:07:25.965] nsd[370539]: warning: signal received, shutting down...
test tsig_client_sequence_nsd ... ok

test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.02s