Bacula Enterprise Mock Server is a wire-compatible simulation of the Bacula Enterprise REST API — same endpoints, same response formats, same OAuth2/Basic Auth flow — backed by realistic generated data instead of a live Director. Designed for dashboard development, CI/CD pipelines, administrator training, and demo environments. Ships with 30+ client profiles (databases, VMs, Kubernetes, IoT, and more), configurable error rates, schedule-driven job history, full TLS support, and a CLI tool with 86 automated tests. No Bacula Director required.
  • Python 65%
  • Shell 24.7%
  • C 10.1%
  • Makefile 0.2%
Find a file
faaleoleo dev team 9755c003a8
All checks were successful
Functional Tests / Run Functional Tests (push) Successful in 31s
Security & Dependency Scan / Scan Python Source & Dependencies (push) Successful in 7s
Security & Dependency Scan / Grype Cross-Check (push) Successful in 1s
Security & Dependency Scan / Email Alert on Detection (push) Has been skipped
fix: add --tls flag to match server TLS config in CI test run
2026-04-06 20:02:38 +03:00
.forgejo fix: add --tls flag to match server TLS config in CI test run 2026-04-06 20:02:38 +03:00
certs update to release v1.2.0. Multiple changes 2026-03-24 22:21:30 +02:00
docs update to release v1.2.1. TLS bugfix release 2026-03-25 00:40:34 +02:00
logs some files cleaned 2026-03-25 10:16:40 +02:00
scripts update to release v1.2.1. TLS bugfix release 2026-03-25 00:40:34 +02:00
src update to release v1.2.1. TLS bugfix release 2026-03-25 00:40:34 +02:00
tests update to release v1.2.0. Multiple changes 2026-03-24 22:21:30 +02:00
.coveragerc refactoring. Read the CHANGELOG fro details 2026-03-18 21:29:53 +02:00
.env update to release v1.2.0. Multiple changes 2026-03-24 22:21:30 +02:00
.gitignore add .trivyignore.yaml to suppress false positive for test certs 2026-04-02 10:37:26 +03:00
.gitleaks.toml refactoring. Read the CHANGELOG fro details 2026-03-18 21:29:53 +02:00
.trivyignore.yaml fix: remove unsupported paths filter from trivyignore secrets rule 2026-04-02 10:45:54 +03:00
CHANGELOG update to release v1.2.1. TLS bugfix release 2026-03-25 00:40:34 +02:00
config.yaml update to release v1.2.0. Multiple changes 2026-03-24 22:21:30 +02:00
CONTRIBUTING.md Add CONTRIBUTING.md 2026-04-03 03:40:40 +03:00
generate-bom.py refactoring. Read the CHANGELOG fro details 2026-03-18 21:29:53 +02:00
gpg-faaleo-dev-team.asc init 2026-03-12 21:45:34 +02:00
install-bweb-mock.sh update to release v1.2.0. Multiple changes 2026-03-24 22:21:30 +02:00
install-bweb-scheduled.sh update to release v1.2.0. Multiple changes 2026-03-24 22:21:30 +02:00
install.sh update to release v1.2.1. TLS bugfix release 2026-03-25 00:40:34 +02:00
README.md some files cleaned 2026-03-25 10:16:40 +02:00
requirements.txt init 2026-03-12 21:45:34 +02:00
status-check.sh init 2026-03-12 21:45:34 +02:00
structure.md init 2026-03-12 21:45:34 +02:00

Bacula Enterprise Mock Server

Full simulation of the Bacula Enterprise REST API — no Director required

A wire-compatible mock of the Bacula Enterprise REST API for dashboard development, CI/CD testing, administrator training, and demo environments. Same endpoints, same response formats, same authentication — backed by realistic generated data across 30+ client profiles instead of a production Director.

Use Cases

  • Dashboard development — build monitoring UIs against a realistic API without production infrastructure
  • CI/CD testing — 86 automated tests across 13 groups, runnable in seconds
  • Training — learn the Bacula REST API without risk to production
  • QA / disaster simulation — configurable error rates from 0% to 100%
  • Performance testing — benchmark with ab, wrk, or hey
  • BWeb integration — plug into BWeb Management Suite via lighttpd reverse proxy

Key Features

  • 100% wire-compatible with the Bacula Enterprise REST API
  • 30+ client profiles — mail, database, NFS, web, Windows, VMware, Kubernetes, SAP HANA, IoT, and more
  • OAuth2 + HTTP Basic Auth — same auth flow as real Bacula Enterprise
  • HTTP and HTTPS (TLS) with auto-generated self-signed certificates
  • Configurable error ratesbacula-mock init 100 0.25 creates 100 clients with 25% failure rate
  • Schedule-based job history — jobs are generated at regular intervals (default: every 24 h over 7 days) so job IDs and timestamps are always strictly ascending, matching real Bacula Director behaviour; interval, jitter, and history length are configurable in config.yaml
  • Full CLI tool (bacula-mock) — server management, queries, exports, smoke tests
  • External Go test client — 86 tests across 13 groups for CI/CD pipelines
  • BVFS browsing — file-level restore browsing endpoints
  • CSV/JSON data export — for reporting and analysis
  • Systemd service with auto-start, auto-restart, and log rotation

Quick Start

# 1. Install
sudo ./install.sh

# 2. Start
sudo systemctl start bacula-mock

# 3. Generate test data (100 clients, 25% error rate)
#    Jobs are created at 24 h intervals over the last 7 days (see config.yaml)
bacula-mock init 100 0.25

# 4. Verify
bacula-mock health
bacula-mock clients
bacula-mock jobs-failed
bacula-mock smoke-test

Tuning the job history

Three parameters in config.yaml under simulation control the generated history:

Parameter Default Description
history_days 7 How many days of history to generate per client
job_interval_hours 24 Base interval between consecutive jobs
jitter 0.1 Timestamp variance as a fraction of the interval (0 = exact, 1 = fully random)

Example — 30 days of history with 12 h intervals and slight jitter:

simulation:
  history_days: 30
  job_interval_hours: 12
  jitter: 0.05

API at a Glance

Category Endpoints Examples
Catalog /cat/Client, /cat/Job, /cat/JobTotals, /cat/JobLog, /cat/Pool, /cat/Storage List clients, jobs, logs, aggregate stats
Commands /cmd/run, /cmd/restore, /cmd/cancel, /cmd/estimate, /cmd/label, /cmd/purge, /cmd/prune Run backups, restore, manage volumes
Status /status/director, /status/client/ Live daemon status
Resources /res/director, /res/filedaemon, /res/storagedaemon Read/write configuration
Auth /oauth/token OAuth2 token flow
Mock /mock/health, /mock/initialize, /mock/reset Server control (no auth on health)

CLI Commands

bacula-mock start               # Start server
bacula-mock init [N] [rate]     # Generate N clients with error rate
bacula-mock reset               # Delete all data
bacula-mock clients [limit]     # List clients
bacula-mock jobs-failed [limit] # Failed jobs only
bacula-mock jobtotals           # Aggregate KPIs
bacula-mock joblog <jobid>      # Job log messages
bacula-mock dir-status          # Director status
bacula-mock run <job>           # Start a backup
bacula-mock restore             # Restore from backup
bacula-mock export-csv          # Export jobs as CSV
bacula-mock smoke-test          # Test all endpoints (86 tests)

Add --raw to any command for unformatted JSON output.

Requirements

Component Requirement
OS Debian 13, (Ubuntu 20.04+, RHEL 8+, Fedora 35+, macOS 11+ untested)
Python 3.8+
Disk ~100 MB
Memory 512 MB minimum (1 GB for 500+ clients)
Port 9101 (configurable)

All Python dependencies are installed automatically in a virtual environment.

Documentation

Document Description
Implementation Guide Full configuration, client profiles, authentication, TLS, BWeb integration, service management
End User Guide Getting started, CLI walkthrough, dashboard building
Usage Examples Practical workflows, frontend integration (JS/Python), load testing, error analysis

Verifying a Release Package

All release packages are GPG-signed. Follow these steps to verify the authenticity and integrity of a downloaded package.

1. Import the Public GPG Key (One-Time)

curl -sL https://git.faaleoleo.io/faaleoleo-dev-team/BaculaMockServer/raw/branch/main/my-public-key.asc | gpg --import

2. Download the Package, Signature, and Checksum

Replace v1.0.0 with the version you want:

VERSION="v1.0.0"
BASE="https://git.faaleoleo.io/api/packages/faaleoleo-dev-team/generic/BaculaMockServer/${VERSION}"

curl -O "${BASE}/BaculaMockServer-${VERSION}.tar.gz"
curl -O "${BASE}/BaculaMockServer-${VERSION}.tar.gz.asc"
curl -O "${BASE}/BaculaMockServer-${VERSION}.tar.gz.sha256"

3. Verify the GPG Signature

gpg --verify BaculaMockServer-${VERSION}.tar.gz.asc BaculaMockServer-${VERSION}.tar.gz

Expected output: gpg: Good signature from "...". If you see BAD signature, do not use the package.

4. Verify the SHA256 Checksum

sha256sum -c BaculaMockServer-${VERSION}.tar.gz.sha256

Expected output: BaculaMockServer-v1.0.0.tar.gz: OK

5. Extract

tar -xzf BaculaMockServer-${VERSION}.tar.gz

License

BSD 2-Clause — Copyright © 2026 faaleoleo


"Bacula" is a registered trademark of Bacula Systems SA. This software is not affiliated with or endorsed by Bacula Systems SA.