Files
firezone/rust/libs/bin-shared/tests/tunnel_drop.rs
Thomas Eizinger b7dc897eea refactor(rust): introduce libs/ directory (#10964)
The current Rust workspace isn't as consistent as it could be. To make
navigation a bit easier, we move a few crates around. Generally, we
follow the idea that entry-points should be at the top-level. `rust/`
now looks like this (directories only):

```
.
├── cli             # Firezone CLI
├── client-ffi      # Entry point for Apple & Android
├── gateway         # Gateway
├── gui-client      # GUI client
├── headless-client # Headless client
├── libs            # Library crates
├── relay           # Relay
├── target          # Compile artifacts
├── tests           # Crates for testing
└── tools           # Local tools
```

To further enforce this structure, we also drop the `firezone-` prefix
from all crates that are not top-level binary crates.
2025-11-25 10:59:11 +00:00

19 lines
692 B
Rust

#![allow(clippy::unwrap_used)]
use bin_shared::TunDeviceManager;
/// Checks for regressions in issue #4765, un-initializing Wintun
/// Redundant but harmless on Linux.
#[tokio::test] // Needs a runtime.
#[ignore = "Needs admin / sudo and Internet"]
async fn tunnel_drop() {
logging::test_global("debug"); // `Tun` uses threads and we want to see the logs of all threads.
let mut tun_device_manager = TunDeviceManager::new(1280).unwrap();
// Each cycle takes about half a second, so this will take a fair bit to run.
for _ in 0..50 {
let _tun = tun_device_manager.make_tun().unwrap(); // This will panic if we don't correctly clean-up the wintun interface.
}
}