Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pytest plugin that provides fixtures to start a complete Netbox infrastructure using Docker

License

NotificationsYou must be signed in to change notification settings

link-society/pytest-netbox-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

📦 Installation

pip install git+https://github.com/link-society/pytest-netbox-docker.git

🔨 Usage

⚠️Important Notice

The 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).

🔧 Configuration

Environment VariableDefault ValueDescription
PYTEST_NETBOX_PLUGIN_SCOPEsessionScope of the fixtures for the test suite
PYTEST_NETBOX_PLUGIN_POSTGRES_IMAGEdocker.io/postgres:17-alpineDocker image to use for Netbox's database
PYTEST_NETBOX_PLUGIN_VALKEY_IMAGEdocker.io/valkey/valkey:8.0-alpineDocker image to use for Netbox's cache and queue
PYTEST_NETBOX_PLUGIN_NETBOX_IMAGEdocker.io/netboxcommunity/netbox:latestDocker image to use for Netbox itself
PYTEST_NETBOX_PLUGIN_NETBOX_START_PERIOD120Duration (in seconds) to wait for Netbox to start before considering the container "unhealthy"

📝 License

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

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp