-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathqbittorrent_e2e_runner.rs
More file actions
53 lines (52 loc) · 2.34 KB
/
qbittorrent_e2e_runner.rs
File metadata and controls
53 lines (52 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! Binary entry point for the qBittorrent end-to-end smoke test.
//!
//! This runner validates the full `BitTorrent` seeder→tracker→leecher flow using
//! real qBittorrent 5.1.4 containers:
//!
//! 1. Builds a local Torrust Tracker Docker image.
//! 2. Creates an ephemeral workspace (temporary directory) with all required
//! configuration files and pre-generated torrent + payload.
//! 3. Starts a backend-specific Docker Compose stack containing a tracker, a
//! seeder, and a leecher. The default stack is `SQLite`, while `--db-driver`
//! can switch to `MySQL` or `PostgreSQL`.
//! 4. Authenticates with both `qBittorrent` `WebUI` instances.
//! 5. Uploads the torrent to the seeder and the leecher.
//! 6. Logs the torrent count reported by each client.
//! 7. Tears down the compose stack (RAII — even on failure).
//!
//! # Prerequisites
//!
//! - Docker (or compatible OCI runtime) must be installed and running.
//! - The `docker compose` plugin (v2) must be available on `PATH`.
//! - The workspace must be the repository root (default compose file and tracker
//! config template are resolved relative to the current working directory).
//!
//! # Usage
//!
//! ```text
//! cargo run --bin qbittorrent_e2e_runner -- \
//! --db-driver postgresql \
//! --timeout-seconds 180
//! ```
//!
//! ## Key CLI flags
//!
//! | Flag | Default | Description |
//! |------|---------|-------------|
//! | `--db-driver` | `sqlite3` | Tracker database backend: `sqlite3`, `mysql`, or `postgresql` |
//! | `--compose-file` | driver-specific default | Override the compose file selected for the scenario |
//! | `--timeout-seconds` | `180` | Per-operation HTTP timeout for `WebUI` calls |
//! | `--tracker-image` | `torrust-tracker:qbt-e2e-local` | Local Docker image tag built for the tracker |
//! | `--qbittorrent-image` | `lscr.io/linuxserver/qbittorrent:5.1.4` | qBittorrent image for seeder and leecher |
//! | `--project-prefix` | `qbt-e2e` | Prefix for the randomised compose project name |
//!
//! # Debugging
//!
//! See `contrib/dev-tools/debugging/qbt/` for standalone shell scripts that
//! probe a single qBittorrent container in isolation and validate the compose
//! stack without running the full Rust runner.
use torrust_tracker_lib::console::ci::qbittorrent_e2e;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
qbittorrent_e2e::runner::run().await
}