Metadata-Version: 2.4
Name: clabgen
Version: 0.3.0
Summary: Python client and pytest helpers for clabgen, the protocol emulator and traffic generator for containerlab
Author-email: Tom Young <ripnet@gmail.com>
License-Expression: BSD-3-Clause
Project-URL: Homepage, https://github.com/ripnet/clabgen
Classifier: Framework :: Pytest
Classifier: Topic :: System :: Networking
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: test
Requires-Dist: pytest>=7; extra == "test"
Dynamic: license-file

# clabgen (Python)

Python client and pytest helpers for
[clabgen](https://github.com/ripnet/clabgen), the protocol emulator and
traffic generator for containerlab. Standard library only; Python 3.9+.

```sh
pip install clabgen
```

Installing from a checkout or from git builds the package: Ubuntu 22.04's
own pip 22.0 builds it as `UNKNOWN`, so use a newer pip there (e.g. in a
virtualenv after `pip install -U pip`).

```python
def test_failover(clabgen_lab):              # pytest --clabgen-lab b2b
    with clabgen_lab.measure() as m:
        clabgen_lab["gen2"].port_down("eth1")
        time.sleep(2)
        clabgen_lab["gen2"].port_up("eth1")
    m.assert_pass()
```

See [docs/python.md](https://github.com/ripnet/clabgen/blob/main/docs/python.md).

Tests: `pytest` here. The unit tests need nothing; the `agent` tests run
the agent binary (`make build` at the top, or `CLABGEN_AGENT=path`) in a
container, so they need docker, and are skipped without it.
