- Notifications
You must be signed in to change notification settings - Fork0
Pytest plugin that provides fixtures to start a complete Netbox infrastructure using Docker
License
link-society/pytest-netbox-docker
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Pytest plugin that provides fixtures to start a complete Netbox infrastructureusing Docker.
It does not usetestcontainers because it is athin wrapper around the Python Docker SDK, and it does not expose the requiredfeatures.
pip install git+https://github.com/link-society/pytest-netbox-docker.git
⚠️ Important NoticeThe Netbox webserver container will expose the port 8080 on 127.0.0.1,therefore this port should be free when running the test suite.
First, write a test that uses thenetbox fixture:
deftest_mytest(netbox):resp=requests.get("http://localhost:8080/login/")resp.raise_for_status()
Then run your test suite with the plugin activated:
pytest -p pytest_netbox_docker
NB: Netbox can take a long time to start (and apply the migrations).
| Environment Variable | Default Value | Description |
|---|---|---|
PYTEST_NETBOX_PLUGIN_SCOPE | session | Scope of the fixtures for the test suite |
PYTEST_NETBOX_PLUGIN_POSTGRES_IMAGE | docker.io/postgres:17-alpine | Docker image to use for Netbox's database |
PYTEST_NETBOX_PLUGIN_VALKEY_IMAGE | docker.io/valkey/valkey:8.0-alpine | Docker image to use for Netbox's cache and queue |
PYTEST_NETBOX_PLUGIN_NETBOX_IMAGE | docker.io/netboxcommunity/netbox:latest | Docker image to use for Netbox itself |
PYTEST_NETBOX_PLUGIN_NETBOX_START_PERIOD | 120 | Duration (in seconds) to wait for Netbox to start before considering the container "unhealthy" |
This project is released under the terms of theMIT License
About
Pytest plugin that provides fixtures to start a complete Netbox infrastructure using Docker
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.