pub struct TestServers { /* private fields */ }Expand description
Docker-based SMB test servers for integration testing.
Starts Samba containers on construction, stops on drop. Each server
type has a factory method returning a connected SmbClient.
Consumers can also skip TestServers entirely and use the compose
files directly for E2E or manual testing via write_compose_files.
Implementations§
Source§impl TestServers
impl TestServers
Sourcepub async fn start() -> Result<Self>
pub async fn start() -> Result<Self>
Start the minimal set: guest + auth containers.
This is the fastest option (~2 seconds). Use start_all
if you need all 14 containers.
Sourcepub fn start_blocking() -> Result<Self>
pub fn start_blocking() -> Result<Self>
Sourcepub async fn guest_client(&self) -> Result<SmbClient>
pub async fn guest_client(&self) -> Result<SmbClient>
Guest-access server. No credentials needed.
Sourcepub async fn auth_client(&self, user: &str, pass: &str) -> Result<SmbClient>
pub async fn auth_client(&self, user: &str, pass: &str) -> Result<SmbClient>
Auth-required server. Needs username and password.
Sourcepub async fn both_client(&self) -> Result<SmbClient>
pub async fn both_client(&self) -> Result<SmbClient>
Mixed server, guest connection. Can access the “public” share only.
Sourcepub async fn both_client_auth(
&self,
user: &str,
pass: &str,
) -> Result<SmbClient>
pub async fn both_client_auth( &self, user: &str, pass: &str, ) -> Result<SmbClient>
Mixed server, authenticated connection. Can access both “public” and “private” shares.
Sourcepub async fn readonly_client(&self) -> Result<SmbClient>
pub async fn readonly_client(&self) -> Result<SmbClient>
Read-only server. Writes return errors.
Server with 50 shares for testing share enumeration at scale.
Sourcepub async fn unicode_client(&self) -> Result<SmbClient>
pub async fn unicode_client(&self) -> Result<SmbClient>
Server with unicode share and file names (CJK, emoji, accented characters).
Sourcepub async fn longnames_client(&self) -> Result<SmbClient>
pub async fn longnames_client(&self) -> Result<SmbClient>
Server with 200+ character filenames. Tests path truncation.
Sourcepub async fn deepnest_client(&self) -> Result<SmbClient>
pub async fn deepnest_client(&self) -> Result<SmbClient>
Server with 50-level deep directory tree. Tests navigation overflow.
Sourcepub async fn many_files_client(&self) -> Result<SmbClient>
pub async fn many_files_client(&self) -> Result<SmbClient>
Server with 10,000+ files in one directory.
Sourcepub async fn windows_client(&self) -> Result<SmbClient>
pub async fn windows_client(&self) -> Result<SmbClient>
Windows-like server (server string in smb.conf). Tests OS detection.
Sourcepub async fn synology_client(&self) -> Result<SmbClient>
pub async fn synology_client(&self) -> Result<SmbClient>
Synology-like server (server string in smb.conf). Tests NAS-specific UI.
Sourcepub async fn linux_client(&self) -> Result<SmbClient>
pub async fn linux_client(&self) -> Result<SmbClient>
Generic Linux Samba server. Most common real-world server type.
Sourcepub async fn flaky_client(&self) -> Result<SmbClient>
pub async fn flaky_client(&self) -> Result<SmbClient>
Flaky server (5 seconds up, 5 seconds down). Tests error recovery UI.
Sourcepub async fn slow_client(&self) -> Result<SmbClient>
pub async fn slow_client(&self) -> Result<SmbClient>
Slow server (200ms latency). Tests loading states and timeouts.