Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dainok committed Feb 15, 2024
1 parent 20a9452 commit 5af6e46
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from netdoc.schemas import interface
from netdoc import utils


def ingest(log):
"""Processing parsed output."""
device_o = log.discoverable.device
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ def ingest(log):
interface_name = item.get("interface")
label = utils.normalize_interface_label(interface_name)
mode = utils.normalize_interface_mode(item.get("mode"))
native_vlan = int(item.get("native_vlan")) if item.get("native_vlan")!= "None" else None
native_vlan = (
int(item.get("native_vlan")) if item.get("native_vlan") != "None" else None
)
tagged_vlans = utils.normalize_vlan_list(item.get("trunking_vlans"))

# Get or create Interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def ingest(log):
device_o = log.discoverable.device

for item in log.parsed_output:
if not item.get("port"):
if not item.get("destination_port"):
# Skip entries without associated interfaces
continue
interface_name = item.get("destination_port")
Expand Down
5 changes: 5 additions & 0 deletions netdoc/tests/netmiko_allied_telesis_awplus/lab1/arps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- device: 6F-SH210-5
interface: vl954
ip_address: 192.168.254.251
mac_address: 0000.cd37.06aa
vendor: "Allied Telesis Labs Ltd"
10 changes: 10 additions & 0 deletions netdoc/tests/netmiko_allied_telesis_awplus/lab1/discoverables.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- address: 192.168.254.220
device: 6F-SH210-5
site: test-site
credential: test-credential
mode: netmiko_allied_telesis_awplus
- address: 192.168.254.201
device: null
site: test-site
credential: test-credential
mode: netmiko_allied_telesis_awplus
20 changes: 20 additions & 0 deletions netdoc/tests/netmiko_allied_telesis_awplus/lab1/macaddresses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- device: 6F-SH210-5
interface: sa1
vlan: 900
mac_address: 00:09:0F:09:00:00
vendor: "Fortinet Inc."
- device: 6F-SH210-5
interface: sa1
vlan: 900
mac_address: 00:15:5D:00:AB:14
vendor: "Microsoft Corporation"
- device: 6F-SH210-5
interface: sa1
vlan: 900
mac_address: 00:15:5D:00:AB:15
vendor: "Microsoft Corporation"
- device: 6F-SH210-5
interface: port1.0.19
vlan: 989
mac_address: 00:50:56:6A:1A:CA
vendor: "VMware, Inc."

0 comments on commit 5af6e46

Please sign in to comment.