Samba Server Testing Framework (Integration)
=========================================

This project uses a hybrid framework for Samba integration tests.

SambaContainer (Docker & Mock)
------------------------------

The `SambaContainer` class is the core of the test infrastructure. It provides:

1. **Real Docker Container (Default)**
   - Uses `Testcontainers` and the image `dperson/samba`.
   - Provides full protocol compatibility (SMB2/SMB3).
   - Requires an active Docker runtime environment (e.g., OrbStack on MacOS).

2. **In-Memory Mock (Fallback)**
   - If no Docker daemon is detected, the framework automatically switches to a Java-based simulation.
   - Ideal for environments without Docker support or extremely fast unit tests.

Configuration & Usage
---------------------

Preferably use the `SmbTestHelper` to write tests. It abstracts the details of server provisioning:

```java
SmbTestHelper helper = SmbTestHelper.builder()
    .withAutoDetect() // Choose Docker if available, otherwise Mock
    .build();

helper.start();
// Test logic
helper.stop();
```

Prerequisites
-------------

- **MacOS:** Install and start **OrbStack** (recommended) or Docker Desktop.
- **CI (GitHub Actions):** Docker is automatically enabled.

Troubleshooting
---------------

1. **Docker not detected:** Check if `/var/run/docker.sock` exists and is accessible.
2. **Ports:** The framework uses dynamic ports to avoid conflicts. Access the current port via `sambaContainer.getPort()`.

Detailed information can be found in the central guide:
`docs/SAMBA_TESTING_FRAMEWORK.md`
