Skip to main content

Python bindings for PassMark's BurnInTest plugin interface

Project description

BurnInTest Plugin Python Interface (burnintest-plugin)

A simple wrapper for interfacing with PassMark's BurnInTest plugin system.

BurnInTest allows you to integrate custom testing tools via a shared memory interface. This package abstracts away the underlying ctypes and multiprocessing.shared_memory boilerplate, giving you a simple, object-oriented API to communicate statuses, log errors, and track test cycles directly from Python.

Features

  • Context Manager Support: Automatically handles shared memory cleanup and safe exits.
  • Built-in Enums: Statuses and error severities are mapped to standard Python Enums (PluginStatus, ErrorSeverity).
  • Safe Encoding: Automatically handles UTF-8 encoding and string truncation to prevent buffer overflows in the underlying C-struct.
  • State Tracking: Easily update cycles, duty cycles, read/write/verify operations, and error counts.

Installation

pip install burnintest-plugin

Quick Start

When BurnInTest launches a plugin, it passes a unique shared memory key as the first entry in argv. You use this key to initialize the BitInterface.

Below is an example of a simple plugin that verifies hardware states and communicates its progress back to the BurnInTest dashboard.

import sys
import time
from burnintest_plugin import BitInterface, PluginStatus, ErrorSeverity

def main():
    # BurnInTest passes the shared memory key as a command line argument
    mem_key = sys.argv[0]
    if not mem_key.startswith("BIT_PLUGIN_INT"):
        print("No BIT shared memory key found... Aborting!")
        sys.exit(1)

    # Use the context manager for clean shared memory cleanup
    with BitInterface(key=mem_key, window_title="Custom BIT Plugin") as bit:
        
        bit.set_status(PluginStatus.PLUGIN_STARTUP, "Initializing hardware SDK...")
        time.sleep(1)

        # Simulating a testing loop (e.g., verifying GPIO/DIO or memory states)
        bit.set_status(PluginStatus.PLUGIN_READING, "Verifying module states...")

        for i in range(10):
            # Always check if the user has stopped the test in the BurnInTest UI
            if not bit.test_running:
                break

            # Simulate a read operation
            bit.read_operations += 1
            time.sleep(0.5)

            # Simulate catching a minor hardware anomaly (e.g., a recoverable bit flip)
            if i == 5:
                bit.log_message(ErrorSeverity.ERRORWARNING, "Minor state mismatch detected, retrying...")
                # Note: log_message automatically increments bit.error_count for severities > WARNING

            # Update metrics
            bit.verify_operations += 1
            bit.cycle += 1

        bit.set_status(PluginStatus.PLUGIN_CLEANUP, "Cleaning up resources...")

if __name__ == "__main__":
    main()

Usage Notes

  • Blocking vs Non-Blocking: Methods like set_status and log_message have an optional wait boolean parameter. When True, the Python script will block until BurnInTest acknowledges the update. If back to back calls are made, the second call will always wait for the first to be acknowledged.
  • Pre-Testing: If you are using this script as a Pre-Test plugin, you can call bit.set_pretest_complete() to signal to BurnInTest that it should proceed with the main testing phase.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

burnintest_plugin-0.1.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

burnintest_plugin-0.1.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file burnintest_plugin-0.1.1.tar.gz.

File metadata

  • Download URL: burnintest_plugin-0.1.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.16

File hashes

Hashes for burnintest_plugin-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f0782cd7b53d4d10e09949fdd2b63fcd37750f33cd76f0c3e5592385a3a048a0
MD5 b778ff48461dddd939006998665d743d
BLAKE2b-256 2f570f56d71fd38087f64c1612a8796bab9f207ea482d578fda6411e8081ded3

See more details on using hashes here.

File details

Details for the file burnintest_plugin-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for burnintest_plugin-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4e52ceda1e21d37e0104102d155ddf90d9948a245e7ffbb5d304e3c643c5a5ea
MD5 7e5aa231994b0105be7679d5b2e5becc
BLAKE2b-256 656a11015c96ed80bb929b2dfb1a2d5862481e7e6c76176480e00abce843834f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page