bit-manager

The core test execution engine that loads and runs PBIT/CBIT/FBIT tests from plugin libraries and publishes results via Zenoh.

Looking for How-To Guides?

This is a command reference. For task-oriented guides and scenarios, see Running Tests.

Environment Variables (with defaults)

  • BIT_TEST_PATH - Directory containing test plugins (default: /usr/local/lib/bit_manager)
  • BIT_CONFIG_PATH - Directory containing configuration files (default: /etc/bit)
  • BIT_STDOUT_LOG - Enable stdout logging (default: disabled, enabled in systemd service)
  • BIT_LOG_FILE - Enable file logging (default: disabled, set to 1 for /var/log/bit/bit.log)
  • RUST_LOG - Control log verbosity (default: info)

Usage

One-Shot Mode

Run all tests once and exit:

bit-manager -o

Loads all PBIT and CBIT tests, executes each once, and exits with status code.

Service Mode (Default)

Run continuously as a system service:

sudo systemctl start bit_manager
  • PBIT tests: Run once at startup
  • CBIT tests: Run continuously at configured intervals
  • FBIT tests: Run on-demand via remote control

Specific Test Mode

Run only specific tests by name:

# Single test
bit-manager -t pbit_cpu_usage -o

# Multiple tests
bit-manager -t pbit_cpu_usage -t cbit_memory_usage -o

Remote Monitoring Mode

Enable Zenoh publishing for remote monitors:

bit-manager --zenoh

Allows bit-monitor-cli and bit-monitor-gui to connect remotely.

For detailed scenarios and examples, see Running Tests.

Command-Line Options

# Run all tests once
bit-manager -o
bit-manager --once

# Run specific test(s)
bit-manager -t test_name -o
bit-manager --test test_name -o

# Enable Zenoh publishing
bit-manager --zenoh

# Help
bit-manager -h
bit-manager --help

# Version
bit-manager -V
bit-manager --version

Exit Codes

Code Meaning
0 All tests passed
1 One or more tests failed
2 Configuration or plugin loading error

Exit codes are only meaningful in one-shot mode (-o). In service mode, check logs for test results.

Logging

Console Output (One-Shot Mode)

Results print to stdout when using -o:

[2026-01-07 10:15:30] PBIT PASS: pbit_cpu_usage - CPU usage at 12%
[2026-01-07 10:15:31] PBIT PASS: pbit_memory_usage - Memory usage at 45%
[2026-01-07 10:15:32] CBIT FAIL: cbit_temperature - Temperature 85°C exceeds threshold

Service Logs

In service mode, logs go to systemd journal:

# Follow live logs
sudo journalctl -u bit_manager -f

# View recent logs
sudo journalctl -u bit_manager -n 100

File Logging

Enable persistent file logging:

BIT_LOG_FILE=1 bit-manager -o

Logs written to /var/log/bit/bit.log.

For more logging examples, see Running Tests.

Examples

Basic Usage

# Run all tests once
bit-manager -o

# Run as service
sudo systemctl start bit_manager

# Run specific test
bit-manager -t pbit_cpu_usage -o

# Enable remote monitoring
bit-manager --zenoh

With Environment Variables

# Use local test plugins during development
BIT_TEST_PATH=/path/to/plugins bit-manager -o

# Enable file logging
BIT_LOG_FILE=1 bit-manager -o

# Increase log verbosity
RUST_LOG=debug bit-manager -o

For complete scenario examples (CI/CD, remote testing, production deployment), see Running Tests.

Next Steps