From 4da1bf9f1a100b0c1c6e5827c3d6dd51400a5237 Mon Sep 17 00:00:00 2001 From: niels van hooij Date: Tue, 15 Aug 2023 12:53:36 +0200 Subject: [PATCH] updated tests --- src/genie/libs/parser/iosxe/show_run_dhcp.py | 1 + .../cli/equal/golden_output2_expected.py | 71 +++++++++++++++---- .../cli/equal/golden_output2_output.txt | 1 + 3 files changed, 59 insertions(+), 14 deletions(-) diff --git a/src/genie/libs/parser/iosxe/show_run_dhcp.py b/src/genie/libs/parser/iosxe/show_run_dhcp.py index df9b37b32a..2c06cb0bc8 100644 --- a/src/genie/libs/parser/iosxe/show_run_dhcp.py +++ b/src/genie/libs/parser/iosxe/show_run_dhcp.py @@ -305,4 +305,5 @@ def cli(self, output=None): boot_file = m.groupdict()['boot_file'] dhcp_pools[pool_name]['boot_file'] = boot_file + logging.debug(dhcp_pools) return dhcp_pools \ No newline at end of file diff --git a/src/genie/libs/parser/iosxe/tests/ShowRunDhcp/cli/equal/golden_output2_expected.py b/src/genie/libs/parser/iosxe/tests/ShowRunDhcp/cli/equal/golden_output2_expected.py index e517f46b49..30ddf22dfd 100644 --- a/src/genie/libs/parser/iosxe/tests/ShowRunDhcp/cli/equal/golden_output2_expected.py +++ b/src/genie/libs/parser/iosxe/tests/ShowRunDhcp/cli/equal/golden_output2_expected.py @@ -1,19 +1,62 @@ expected_output = { - 'TEST-1': {'networks': { - 1: {'ip': '1.1.1.0', 'subnet_mask': '255.255.255.0', 'secondary': False}}, - 'dhcp_options': {1: {'option': '150', 'type': 'ip', - 'data': '4.4.4.4 5.5.5.5'}}, + 'TEST-1': { + 'boot_file': 'dapcfg.txt', 'dhcp_excludes': { - 1: {'start': '1.1.1.2', 'end': '1.1.1.2'}, - 2: {'start': '1.1.1.3', 'end': '1.1.1.10'}}, - 'vrf': 'ABC', 'gateway': '1.1.1.1', + 1: { + 'end': '1.1.1.2', + 'start': '1.1.1.2', + }, + 2: { + 'end': '1.1.1.10', + 'start': '1.1.1.3', + }, + }, + 'dhcp_options': { + 1: { + 'data': '4.4.4.4 5.5.5.5', + 'option': '150', + 'type': 'ip', + }, + }, 'dns_servers': ['8.8.8.8', '9.9.9.9'], + 'domain': 'TEST.com', + 'gateway': '1.1.1.1', + 'lease_time': '1', 'netbios_servers': ['2.2.2.2', '3.3.3.3'], - 'lease_time': '1', 'domain': 'TEST.com'}, 'TEST-12': { 'networks': { - 1: {'ip': '12.1.1.0', 'subnet_mask': '255.255.255.0', 'secondary': False}}, - 'dhcp_options': {1: {'option': '150', 'type': 'ip', 'data': '4.4.4.4 5.5.5.5'}}, - 'dhcp_excludes': {1: {'start': '12.1.1.200', 'end': '12.1.1.201'}}, - 'gateway': '1.1.1.1', 'dns_servers': ['8.8.8.8', '9.9.9.9'], - 'netbios_servers': ['2.2.2.2', '3.3.3.3'], 'lease_time': '1', - 'domain': 'TEST.com'}} \ No newline at end of file + 1: { + 'ip': '1.1.1.0', + 'secondary': False, + 'subnet_mask': '255.255.255.0', + }, + }, + 'vrf': 'ABC', + }, + 'TEST-12': { + 'dhcp_excludes': { + 1: { + 'end': '12.1.1.201', + 'start': '12.1.1.200', + }, + }, + 'dhcp_options': { + 1: { + 'data': '4.4.4.4 5.5.5.5', + 'option': '150', + 'type': 'ip', + }, + }, + 'dns_servers': ['8.8.8.8', '9.9.9.9'], + 'domain': 'TEST.com', + 'gateway': '1.1.1.1', + 'lease_time': '1', + 'netbios_servers': ['2.2.2.2', '3.3.3.3'], + 'networks': { + 1: { + 'ip': '12.1.1.0', + 'secondary': False, + 'subnet_mask': '255.255.255.0', + }, + }, + }, +} diff --git a/src/genie/libs/parser/iosxe/tests/ShowRunDhcp/cli/equal/golden_output2_output.txt b/src/genie/libs/parser/iosxe/tests/ShowRunDhcp/cli/equal/golden_output2_output.txt index a023f13f32..f27874a7f0 100644 --- a/src/genie/libs/parser/iosxe/tests/ShowRunDhcp/cli/equal/golden_output2_output.txt +++ b/src/genie/libs/parser/iosxe/tests/ShowRunDhcp/cli/equal/golden_output2_output.txt @@ -8,6 +8,7 @@ no ip dhcp conflict logging ip dhcp pool TEST-1 vrf ABC network 1.1.1.0 255.255.255.0 + bootfile dapcfg.txt default-router 1.1.1.1 dns-server 8.8.8.8 9.9.9.9 netbios-name-server 2.2.2.2 3.3.3.3