Set up works, daemon still bugs out

This commit is contained in:
rhaskia 2024-03-10 10:40:08 +13:00 committed by Conrad Kramer
parent 982cfc39b6
commit 98ce57bba0
6 changed files with 127 additions and 58 deletions

View file

@ -24,6 +24,21 @@ fn test_set_get_broadcast_addr() {
assert_eq!(broadcast_addr, result);
}
#[test]
#[throws]
#[cfg(not(any(target_os = "windows", target_vendor = "apple")))]
fn test_set_get_up() {
let tun = TunInterface::new()?;
let addr = Ipv4Addr::new(10, 0, 0, 1);
tun.set_ipv4_addr(addr)?;
let broadcast_addr = Ipv4Addr::new(255, 255, 255, 0);
tun.set_broadcast_addr(broadcast_addr)?;
tun.set_up(true)?;
assert!(tun.is_up()?);
}
#[test]
#[throws]
#[cfg(not(target_os = "windows"))]