From c3ad827197cf594646899655cacb7100440c4488 Mon Sep 17 00:00:00 2001 From: Mathias Hall-Andersen Date: Wed, 11 Sep 2019 16:36:38 +0200 Subject: Test for confirmation of key using staged packet --- src/router/tests.rs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/router/tests.rs b/src/router/tests.rs index 9061414..80c3ea9 100644 --- a/src/router/tests.rs +++ b/src/router/tests.rs @@ -454,11 +454,18 @@ mod tests { fn test_outbound_inbound() { init(); - let tests = [( - false, - ("192.168.1.0", 24, "192.168.1.20", true), - ("172.133.133.133", 32, "172.133.133.133", true), - )]; + let tests = [ + ( + false, // confirm with keepalive + ("192.168.1.0", 24, "192.168.1.20", true), + ("172.133.133.133", 32, "172.133.133.133", true), + ), + ( + true, // confirm with staged packet + ("192.168.1.0", 24, "192.168.1.20", true), + ("172.133.133.133", 32, "172.133.133.133", true), + ), + ]; for (stage, p1, p2) in tests.iter() { let (bind1, bind2) = bind_pair(); @@ -533,7 +540,7 @@ mod tests { assert!(opaq1.is_empty(), "nothing should happend on peer1"); // read confirming message received by the other end ("across the internet") - let mut buf = vec![0u8; 1024]; + let mut buf = vec![0u8; 2048]; let (len, from) = bind1.recv(&mut buf).unwrap(); buf.truncate(len); router1.recv(from, buf).unwrap(); -- cgit v1.2.3-59-g8ed1b