aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-09-11 16:36:38 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-09-11 16:36:38 +0200
commitc3ad827197cf594646899655cacb7100440c4488 (patch)
tree8239792dbc1c6c9efccc84482ee75a4628a54cd2
parentSimplified router tests (diff)
downloadwireguard-rs-c3ad827197cf594646899655cacb7100440c4488.tar.xz
wireguard-rs-c3ad827197cf594646899655cacb7100440c4488.zip
Test for confirmation of key using staged packet
-rw-r--r--src/router/tests.rs19
1 files changed, 13 insertions, 6 deletions
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();