Introducing Pantavisor Mocker: Simulate Your Entire Device Fleet Without Hardware

Introducing Pantavisor Mocker: Simulate Your Entire Device Fleet Without Hardware

We are excited to announce the release of Pantavisor Mocker, a powerful device simulation tool that lets you mock and test the complete Pantavisor runtime behavior—without requiring actual hardware or a full embedded Linux deployment.

Whether you’re developing OTA update workflows, testing fleet management scenarios, or building CI/CD pipelines for edge devices, Pantavisor Mocker provides a realistic, fully-featured simulation environment that integrates seamlessly with Pantahub.

github.com/pantavisor/pantavisor-mocker

Why Pantavisor Mocker?

Developing and testing embedded Linux systems traditionally requires physical hardware, which creates bottlenecks in development workflows:

  • Hardware availability: Limited devices for testing at scale
  • Slow iteration cycles: Flashing and rebooting physical devices takes time
  • Fleet testing challenges: Simulating hundreds of devices for load testing is impractical
  • CI/CD limitations: Automated pipelines can’t easily include real hardware

Pantavisor Mocker eliminates these barriers by providing a software-only simulation that accurately replicates how real Pantavisor devices interact with Pantahub.

Key Features

  • :gear: Complete Update Flow Simulation: Simulates the full Pantavisor state machine (QUEUEDDOWNLOADINGINPROGRESSTESTINGDONE), including download verification, installation, testing phases, and automatic rollback on failure.

  • :arrows_counterclockwise: Device Registration & Metadata Sync: Automatically registers devices using factory auto-tokens and continuously synchronizes device and user metadata with Pantahub.

  • :busts_in_silhouette: Fleet Invitation Protocol: Simulates the complete user consent flow for fleet-wide updates, including Accept, Skip, and Ask Later options—perfect for testing deployment strategies.

  • :robot: Automation Mode: Run large-scale tests without manual intervention. Configure weighted probabilities for invitation responses and update outcomes to simulate realistic fleet behavior.

  • :package: Swarm Mode: Generate and manage hundreds of simulated devices from a single workspace. Perfect for load testing, fleet management validation, and stress testing your Pantahub infrastructure.

  • :electric_plug: pvcontrol Compatibility: Includes a built-in server that implements the Pantavisor Control API, allowing standard pvcontrol commands to interact with simulated devices.

  • :closed_lock_with_key: TLS Ownership Validation: Supports device ownership verification using client-side TLS certificates, just like real Pantavisor devices.

Getting Started

Docker (Recommended)

The fastest way to get started is with our pre-built Docker image:

1. Initialize storage with your Pantahub auto-token:

docker run -it -v ${PWD}/storage:/app/storage \
    ghcr.io/pantavisor/pantavisor-mocker:latest \
    init --token YOUR_AUTO_TOKEN_HERE

2. Start the mocker:

docker run -it -v ${PWD}/storage:/app/storage \
    ghcr.io/pantavisor/pantavisor-mocker:latest \
    start

Build from Source

If you prefer to build from source:

Prerequisites: Zig compiler version 0.15.2

# Clone the repository
git clone https://github.com/pantavisor/pantavisor-mocker.git
cd pantavisor-mocker

# Build
zig build -Doptimize=ReleaseSafe

# Initialize and run
./zig-out/bin/pantavisor-mocker init --token YOUR_AUTO_TOKEN_HERE
./zig-out/bin/pantavisor-mocker start

Interactive Update Testing

When the mocker receives an update from Pantahub, it progresses through the download and installation phases. Once it reaches the TESTING phase, you’ll be prompted to make a decision:

UPDATE DECISION REQUIRED
An update cycle is in TESTING phase.
Select Outcome:
[U]PDATED  - Success (Immediate)
[D]ONE     - Success (Reboot)
[E]RROR    - Simulate Failure
[W]ONTGO   - Reject Update

This allows you to test different update scenarios and verify your rollback mechanisms work correctly.

Swarm Mode: Fleet Simulation at Scale

Need to test how your infrastructure handles hundreds of devices? Swarm mode makes it easy:

# 1. Create a workspace with template configs
pantavisor-mocker swarm init --dir my-fleet

# 2. Configure your auto-token and device profiles
cd my-fleet && vim autojointoken.txt

# 3. Generate 50 simulated devices
pantavisor-mocker swarm generate-devices --count 50

# 4. Launch all devices in parallel with automation
pantavisor-mocker swarm simulate --auto

You can also generate appliances organized by channels and hardware models—perfect for simulating diverse production fleets.

Automation Configuration

For CI/CD pipelines and large-scale testing, configure automation behavior in mocker.json:

{
  "automation": {
    "enabled": true,
    "invitation": {
      "accept": 70,
      "skip": 20,
      "later": 10
    },
    "update": {
      "done": 60,
      "updated": 25,
      "error": 10,
      "wontgo": 5
    }
  }
}

This creates realistic fleet behavior where 70% of devices accept invitations, 10% simulate failures, and so on.

Use Cases

  • Development & Debugging: Test your OTA update logic without waiting for physical devices
  • CI/CD Integration: Automate end-to-end testing of your Pantahub workflows
  • Load Testing: Stress test your fleet management infrastructure with hundreds of simulated devices
  • Demo & Training: Showcase Pantavisor capabilities without hardware requirements
  • Fleet Protocol Testing: Validate invitation flows and consent mechanisms before production rollout

Join the Community!

We built Pantavisor Mocker to accelerate development workflows and make testing Pantavisor-based systems easier than ever. We’d love to hear how you’re using it!

Give it a try, and share your feedback here in the community forums. If you encounter issues or want to contribute, check out the GitHub repository.

Happy Mocking! :rocket:

1 Like