From c444bf293e238c02fa87e68d63c2afab6ee3c61d Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Sat, 29 Apr 2023 15:25:49 -0400 Subject: [PATCH] tun: Create integration tests for MTU Tests are good, y'all :) --- tun/src/unix/linux/mod.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tun/src/unix/linux/mod.rs b/tun/src/unix/linux/mod.rs index db22beb..82a2125 100644 --- a/tun/src/unix/linux/mod.rs +++ b/tun/src/unix/linux/mod.rs @@ -98,3 +98,16 @@ impl TunInterface { perform(socket.as_raw_fd())? } } + +mod test { + use super::TunInterface; + + #[test] + fn mtu() { + let interf = TunInterface::new().unwrap(); + + interf.set_mtu(500).unwrap(); + + assert_eq!(interf.mtu().unwrap(), 500); + } +}