Skip to main content
Execute custom binaries that have been uploaded to the Lager Box via the CLI. This is useful for running customer-specific tools, device interaction utilities, or third-party command-line applications.

Import

Functions

Exception Classes

Function Reference

run_custom_binary(binary_name, *args, **kwargs)

Execute a custom binary that was uploaded via lager binaries add.
Parameters: Returns: subprocess.CompletedProcess with attributes:
  • returncode - Exit code of the process
  • stdout - Captured standard output (if capture_output=True)
  • stderr - Captured standard error (if capture_output=True)
Raises:
  • BinaryNotFoundError - If the binary doesn’t exist or isn’t executable
  • subprocess.TimeoutExpired - If the process times out
  • subprocess.CalledProcessError - If check=True and return code is non-zero

get_binary_path(binary_name)

Get the full filesystem path to a custom binary.
Parameters: Returns: str - Full path to the binary Raises: BinaryNotFoundError - If the binary doesn’t exist or isn’t executable

list_binaries()

List all available custom binaries on the Lager Box.
Returns: list[str] - Sorted list of binary names

Examples

Run Device Interaction Tool

Run with Custom Environment

Check Available Binaries

Error Handling

Integration with Test Script

Uploading Binaries

Custom binaries are uploaded to the Lager Box using the CLI:

Binary Location

On the Lager Box, custom binaries are stored at:
  • Host path: /home/lagerdata/third_party/customer-binaries/
  • Container path: /home/www-data/customer-binaries/
The directory is mounted into the container, so binaries are immediately available after upload without rebuilding.

Notes

  • Binaries must be Linux x86_64 compatible (matching Lager Box architecture)
  • Binary names cannot contain path separators (/, \) or ..
  • Binaries must be executable (set automatically during upload)
  • Default timeout is 30 seconds; use timeout=None for no limit
  • Use capture_output=False for interactive or streaming output
  • Environment variables are inherited from parent process unless env is specified