cloudflare / boringtun

Userspace WireGuard® Implementation in Rust
BSD 3-Clause "New" or "Revised" License
5.92k stars 397 forks source link

Add unit tests to noise #315

Closed schultetwin1 closed 1 year ago

schultetwin1 commented 1 year ago

Introduces some basic encapsulate/decapsulate tests for the noise mod

Noah-Kennedy commented 1 year ago

You have displeased rustfmt

Noah-Kennedy commented 1 year ago

This is good to merge as soon as you fix rustfmt.

schultetwin1 commented 1 year ago

This is good to merge as soon as you fix rustfmt.

Fixed!

Noah-Kennedy commented 1 year ago

@schultetwin1 try pushing an empty commit, the integration tests are failing. I'm hoping this is spurious.

schultetwin1 commented 1 year ago

@schultetwin1 try pushing an empty commit, the integration tests are failing. I'm hoping this is spurious.

I'm looking into it. I'm wondering if it's not spurious. I did introduce the mocking on Instant which could mean time is not increasing.

Noah-Kennedy commented 1 year ago

Yeah that might be doing it.

Noah-Kennedy commented 1 year ago

@schultetwin1 you might want to move that out of #[cfg(test)] and into some special test CI path, behind a rustc --cfg flag. This would allow us to do this without any users being able to accidentally opt into this by enabling features.

schultetwin1 commented 1 year ago

@schultetwin1 you might want to move that out of #[cfg(test)] and into some special test CI path, behind a rustc --cfg flag. This would allow us to do this without any users being able to accidentally opt into this by enabling features.

Good idea, done! I'm pretty sure the tests will now run since we have cargo hack test --each-feature