diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2020-03-29 18:21:48 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2020-03-29 18:21:48 +0200 |
commit | 12a7b371d4fed75f3934cf7d3788a6cf51c33c22 (patch) | |
tree | 970fc1287d6cbdbd419ef9151e6e94a077b5a7fd /src/wireguard/tests.rs | |
parent | Merge branch 'tests' (diff) | |
download | wireguard-rs-12a7b371d4fed75f3934cf7d3788a6cf51c33c22.tar.xz wireguard-rs-12a7b371d4fed75f3934cf7d3788a6cf51c33c22.zip |
Restructuring and dependency version bump.
Diffstat (limited to '')
-rw-r--r-- | src/wireguard/tests.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/wireguard/tests.rs b/src/wireguard/tests.rs index 4cc441e..bb1f87a 100644 --- a/src/wireguard/tests.rs +++ b/src/wireguard/tests.rs @@ -59,7 +59,14 @@ fn init() { let _ = env_logger::builder().is_test(true).try_init(); } -/* Create and configure two matching pure instances of WireGuard +/* Create and configure + * two matching pure (no side-effects) instances of WireGuard. + * + * Test: + * + * - Handshaking completes successfully + * - All packets up to MTU are delivered + * - All packets are delivered in-order */ #[test] fn test_pure_wireguard() { @@ -137,7 +144,7 @@ fn test_pure_wireguard() { for id in 0..num_packets { packets.push(make_packet( - 50 + 50 * id as usize, // size + 50 * id as usize, // size "192.168.1.20".parse().unwrap(), // src "192.168.2.10".parse().unwrap(), // dst id as u64, // prng seed @@ -153,7 +160,6 @@ fn test_pure_wireguard() { while let Some(p) = backup.pop() { println!("read"); - assert_eq!( hex::encode(fake2.read()), hex::encode(p), |