Skip to main content

Utilities for Python-driven integration tests at LINBIT

Project description



Utilities for Python-driven integration tests at LINBIT.


pip install lbpytest



from lbpytest.controlmaster import SSH
from io import StringIO
import subprocess
import sys

    ssh = SSH("")
except subprocess.CalledProcessError as e:
    print(e.stderr.decode('utf-8'), file=sys.stderr)
    raise e

# Run command using the hosts stdin/stdout/stderr"echo 'Hello, World!'")

# Save command output
output = StringIO()"echo 'Hello, World!'", stdout=output)
print(output.getvalue()) # prints Hello, World!



See and


The unit tests for this project can be run using pytest:

$ pytest src/lbpytest

Note that for the ControlMaster tests, a --host option is required. This should specify the IP address or hostname of an SSH server to use for the test.

Type Checking

This library uses type annotations. The mypy tool can be used to verify these annotations:

$ mypy src/lbpytest


Apache License 2.0

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

lbpytest-0.3.0.tar.gz (15.5 kB view hashes)

Uploaded source

Built Distribution

lbpytest-0.3.0-py3-none-any.whl (17.3 kB view hashes)

Uploaded py3

Supported by

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