test: documentation names and addresses in fixtures
driver / types (pull_request) Successful in 1m0s
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 15s
driver / test (3.12) (pull_request) Successful in 1m9s
driver / test (3.13) (pull_request) Successful in 1m3s
driver / lowest (pull_request) Successful in 32s
driver / build (pull_request) Successful in 44s
driver / security (pull_request) Successful in 1m19s
CI / driver (pull_request) Successful in 2m56s
driver / publish (pull_request) Skipped
driver / types (pull_request) Successful in 1m0s
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 15s
driver / test (3.12) (pull_request) Successful in 1m9s
driver / test (3.13) (pull_request) Successful in 1m3s
driver / lowest (pull_request) Successful in 32s
driver / build (pull_request) Successful in 44s
driver / security (pull_request) Successful in 1m19s
CI / driver (pull_request) Successful in 2m56s
driver / publish (pull_request) Skipped
Fixtures, docstring examples and the README use neutral host names (ap-01, ap-02) and addresses from the documentation ranges 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24, mapped one to one so every test keeps its meaning: the management network test still has its address inside that network, a route still covers its prefix. Loopback, the wildcard address and netmasks are unchanged.
This commit is contained in:
1 parent
780b635174
commit
e4ae42fea0
10 files changed
+125
-123
No files matched your search
@@ -34,7 +34,7 @@ def _driver(seen: list, known: SshHostKey | None = None) -> OpenWrtDriver:
|
||||
args: dict = {"port": 2222, OBSERVER_ARG: seen.append}
|
||||
if known is not None:
|
||||
args[KNOWN_KEYS_ARG] = {"2222": known.as_dict()}
|
||||
return OpenWrtDriver("10.0.0.8", "admin", "s3cret", optional_args=args)
|
||||
return OpenWrtDriver("192.0.2.8", "admin", "s3cret", optional_args=args)
|
||||
|
||||
|
||||
def test_first_use_lets_netmiko_accept_and_reports_the_key():
|
||||
@@ -48,7 +48,7 @@ def test_first_use_lets_netmiko_accept_and_reports_the_key():
|
||||
assert kwargs["port"] == 2222
|
||||
assert seen[0]["accepted"] is True
|
||||
assert seen[0]["seen"]["fingerprint"] == SshHostKey.of(SERVER_KEY).fingerprint
|
||||
assert (seen[0]["host"], seen[0]["port"]) == ("10.0.0.8", 2222)
|
||||
assert (seen[0]["host"], seen[0]["port"]) == ("192.0.2.8", 2222)
|
||||
|
||||
|
||||
def test_a_known_key_is_the_only_one_netmiko_accepts():
|
||||
@@ -59,7 +59,7 @@ def test_a_known_key_is_the_only_one_netmiko_accepts():
|
||||
def connect(**kwargs):
|
||||
files.append(kwargs["alt_key_file"])
|
||||
with open(kwargs["alt_key_file"]) as f:
|
||||
assert f.read().strip() == known.known_hosts_line("10.0.0.8", 2222)
|
||||
assert f.read().strip() == known.known_hosts_line("192.0.2.8", 2222)
|
||||
assert kwargs["ssh_strict"] is True and kwargs["alt_host_keys"] is True
|
||||
return _device()
|
||||
|
||||
@@ -74,7 +74,7 @@ def test_a_changed_key_is_refused():
|
||||
|
||||
def refuse(**kwargs):
|
||||
try:
|
||||
raise paramiko.BadHostKeyException("10.0.0.8", SERVER_KEY, OTHER_KEY)
|
||||
raise paramiko.BadHostKeyException("192.0.2.8", SERVER_KEY, OTHER_KEY)
|
||||
except paramiko.SSHException as exc: # what netmiko does with it
|
||||
raise NetmikoTimeoutException(f"A paramiko SSHException occurred: {exc}") from exc
|
||||
|
||||
|
||||
Reference in new issue
Block a user