Skip to content

Commit

Permalink
eos: add optional real-device integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
bewing committed Oct 16, 2023
1 parent 805f98f commit 9c09afe
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/eos/test_integration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import os
import pytest

from napalm.eos import eos
from napalm.base.base import NetworkDriver


@pytest.fixture
def integration_device():
with eos.EOSDriver(
os.environ["NAPALM_INTEGRATION_HOST"],
os.environ["NAPALM_USERNAME"],
os.environ["NAPALM_PASSWORD"],
) as d:
yield d


@pytest.mark.skipif(
os.getenv("NAPALM_INTEGRATION_HOST") is None, reason="No integration host specified"
)
def test_eos_foo(integration_device):
getters = [s for s in dir(NetworkDriver) if s.startswith("get_")]

getter_options = {"get_route_to": {"destination": "0.0.0.0/0", "longer": True}}

for getter in getters:
try:
ret = getattr(integration_device, getter)(**getter_options.get(getter, {}))
assert ret
except NotImplementedError:
pass

0 comments on commit 9c09afe

Please sign in to comment.