diff --git a/napalm_s350/s350.py b/napalm_s350/s350.py index 902496c..641d6e0 100644 --- a/napalm_s350/s350.py +++ b/napalm_s350/s350.py @@ -32,7 +32,7 @@ from napalm.base.exceptions import ( CommandErrorException, ConnectionClosedException, ) - +import napalm.base.constants as C import napalm.base.helpers @@ -164,7 +164,7 @@ class S350Driver(NetworkDriver): return arp_table - def get_config(self, retrieve='all'): + def get_config(self, retrieve='all', full=False, sanitized=False): """ get_config for S350. Since this firmware doesn't support a candidate configuration we leave it empty. @@ -175,14 +175,48 @@ class S350Driver(NetworkDriver): 'running': '', 'candidate': '', } - + if retrieve in ('all', 'startup'): - output = self._send_command('show startup-config') - configs['startup'] = output + startup = self._send_command('show startup-config') + configs['startup'] = self._get_config_filter(startup) if retrieve in ('all', 'running'): - output = self._send_command('show running-config') - configs['running'] = output + # IOS supports "full" only on "show running-config" + run_full = " detailed" if full else "" + running = self._send_command('show running-config' + run_full) + configs['running'] = self._get_config_filter(running) + + if sanitized: + configs = self._get_config_sanitized(configs) + + return configs + + def _get_config_filter(self, config): + # The output of get_config should be directly usable by load_replace_candidate() + + # remove header + filter_strings = [ + r"(?sm)^config-file-header.*^@$", + ] + + for ft in filter_strings: + config = re.sub(ft, "", config) + + return config + + def _get_config_sanitized(self, configs): + # Do not output sensitive information + + # use Cisco IOS filters + configs = napalm.base.helpers.sanitize_configs(configs, C.CISCO_SANITIZE_FILTERS) + + # defina my own filters + s350_filters = { + r"^(.* password) (\S+) (\S+) (.*)$": r"\1 \2 \4", + r"^(snmp-server location) (\S+).*$": r"\1 ", + } + + configs = napalm.base.helpers.sanitize_configs(configs, s350_filters) return configs diff --git a/test/unit/mocked_data/SG350X-48P-K9/show_running_config_detailed.txt b/test/unit/mocked_data/SG350X-48P-K9/show_running_config_detailed.txt new file mode 100644 index 0000000..7327753 --- /dev/null +++ b/test/unit/mocked_data/SG350X-48P-K9/show_running_config_detailed.txt @@ -0,0 +1,548 @@ +config-file-header +switch1 +v2.4.5.71 / RTESLA2.4.5_930_181_144 +CLI v1.0 +file SSD indicator encrypted +@ +ssd-control-start +ssd config +ssd file passphrase control unrestricted +no ssd file integrity control +ssd-control-end cb0a3fdb1f3a1af4e4430033719968c0 +! +! +unit-type-control-start +unit-type unit 1 network gi uplink te +unit-type unit 2 network gi uplink te +unit-type unit 3 network gi uplink te +unit-type unit 4 network gi uplink te +unit-type-control-end +! +spanning-tree mode mst +port jumbo-frame +vlan database +vlan 5,7,852 +exit +voice vlan oui-table add 0001e3 Siemens_AG_phone________ +voice vlan oui-table add 00036b Cisco_phone_____________ +voice vlan oui-table add 00096e Avaya___________________ +voice vlan oui-table add 000fe2 H3C_Aolynk______________ +voice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone +voice vlan oui-table add 00d01e Pingtel_phone___________ +voice vlan oui-table add 00e075 Polycom/Veritel_phone___ +voice vlan oui-table add 00e0bb 3Com_phone______________ +errdisable recovery cause loopback-detection +errdisable recovery cause port-security +errdisable recovery cause dot1x-src-address +errdisable recovery cause acl-deny +errdisable recovery cause stp-bpdu-guard +errdisable recovery cause stp-loopback-guard +errdisable recovery cause udld +errdisable recovery cause storm-control +link-flap prevention disable +no ip routing +system resources vlan-mapping-entries 4 +bonjour interface range vlan 1 +hostname switch1 +line console +exec-timeout 120 +exit +line ssh +exec-timeout 120 +exit +line telnet +exec-timeout 120 +exit +no passwords complexity enable +username admin password encrypted 00000000000000000000aaaaaaaaaaaaaaaaaaaa privilege 15 +username adm02 password encrypted aaaaaaaaaaaaaaaaaaaa00000000000000000000 privilege 15 +ip ssh server +ip ssh password-auth +ip ssh pubkey-auth auto-login +snmp-server server +snmp-server location SW Location +snmp-server community SOMe rw view Default +ip http timeout-policy 86400 +clock timezone " " +1 +clock summer-time web recurring eu +sntp server 198.51.100.1 +sntp server 198.51.100.2 +no sntp server time-a.timefreq.bldrdoc.gov +no sntp server time-b.timefreq.bldrdoc.gov +no sntp server time-c.timefreq.bldrdoc.gov +ip telnet server +! +interface vlan 1 + name Vlan1 + ip address 198.51.100.3 255.255.255.0 + no ip address dhcp +! +interface vlan 5 + name Vlan5 +! +interface vlan 7 + name Vlan7 +! +interface vlan 852 + name Vlan852 + ip address 198.51.100.4 255.255.128.0 +! +interface GigabitEthernet1/0/1 + description "3B10" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/2 + description "3A9" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/3 + description "3E2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/4 + description "3F1" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/5 + description "2A2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/6 + description "Lobby" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/11 + switchport access vlan 5 +! +interface GigabitEthernet1/0/12 + switchport access vlan 5 +! +interface GigabitEthernet1/0/13 + switchport access vlan 5 +! +interface GigabitEthernet1/0/14 + switchport access vlan 5 +! +interface GigabitEthernet1/0/15 + description "Dk" +! +interface GigabitEthernet1/0/16 + description "Dc" +! +interface GigabitEthernet1/0/17 + description "Dct" +! +interface GigabitEthernet1/0/18 + description "DPC" +! +interface GigabitEthernet1/0/19 + description "Dr" +! +interface GigabitEthernet1/0/20 + description "Dr" +! +interface GigabitEthernet1/0/21 + description "Dr" +! +interface GigabitEthernet1/0/25 + description "2B2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/26 + description "2E2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/27 + description "2F2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/28 + description "1A2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/29 + description "1B2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/30 + switchport access vlan 5 +! +interface GigabitEthernet1/0/31 + switchport access vlan 5 +! +interface GigabitEthernet1/0/32 + switchport access vlan 5 +! +interface GigabitEthernet1/0/33 + switchport access vlan 5 +! +interface GigabitEthernet1/0/34 + switchport access vlan 5 +! +interface GigabitEthernet1/0/35 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/36 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/37 + description "MP" + switchport mode trunk + switchport access vlan 852 + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/38 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/39 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/40 + switchport access vlan 5 +! +interface GigabitEthernet1/0/41 + switchport access vlan 5 +! +interface GigabitEthernet1/0/42 + switchport access vlan 5 +! +interface GigabitEthernet1/0/43 + switchport access vlan 5 +! +interface GigabitEthernet1/0/44 + switchport access vlan 5 +! +interface GigabitEthernet1/0/45 + description "S2" +! +interface GigabitEthernet1/0/46 + description "Ce" +! +interface TengigabitEthernet1/0/1 + description "T1" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface TengigabitEthernet1/0/3 + description "T1" + switchport mode trunk +! +interface TengigabitEthernet1/0/4 + description "T2" + switchport mode trunk +! +exit +macro auto disabled +encrypted ip ssh-client key rsa key-pair +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: RSA Private Key +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm222222222222222224= +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: RSA Public Key +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAA +---- END SSH2 PUBLIC KEY ---- +. +encrypted ip ssh-client key dsa key-pair +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: DSA Private Key +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAA= +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: DSA Public Key +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAA= +---- END SSH2 PUBLIC KEY ---- +. +encrypted crypto key import rsa +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: RSA Private Key +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAA= +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: RSA Public Key +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAA= +---- END SSH2 PUBLIC KEY ---- +. +encrypted crypto key import dsa +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: DSA Private Key +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAA= +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: DSA Public Key +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAA= +---- END SSH2 PUBLIC KEY ---- +. +encrypted crypto certificate 1 import +-----BEGIN RSA ENCRYPTED PRIVATE KEY----- +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAA= +-----END RSA PRIVATE KEY----- +-----BEGIN RSA PUBLIC KEY----- +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +-----END RSA PUBLIC KEY----- +-----BEGIN CERTIFICATE----- +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +-----END CERTIFICATE----- +. +encrypted crypto certificate 2 import +-----BEGIN RSA ENCRYPTED PRIVATE KEY----- +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +-----END RSA PRIVATE KEY----- +-----BEGIN RSA PUBLIC KEY----- +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +-----END RSA PUBLIC KEY----- +-----BEGIN CERTIFICATE----- +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +AAAAAAAAAAAAAAAAAAAAAAmmmmmmmmmmmmmmm22222222222222222444444444444eeee +-----END CERTIFICATE----- +. diff --git a/test/unit/mocked_data/test_get_config/SG350X-48P-K9/expected_result.json b/test/unit/mocked_data/test_get_config/SG350X-48P-K9/expected_result.json index f26c363..e332ddd 100644 --- a/test/unit/mocked_data/test_get_config/SG350X-48P-K9/expected_result.json +++ b/test/unit/mocked_data/test_get_config/SG350X-48P-K9/expected_result.json @@ -1 +1,5 @@ -{"startup": "config-file-header\nswitch1\nv2.4.5.71 / RTESLA2.4.5_930_181_144\nCLI v1.0\nfile SSD indicator encrypted\n@\nssd-control-start\nssd config\nssd file passphrase control unrestricted\nno ssd file integrity control\nssd-control-end cb0a3fdb1f3a1af4e4430033719968c0\n!\n!\nunit-type-control-start\nunit-type unit 1 network gi uplink te\nunit-type unit 2 network gi uplink te\nunit-type unit 3 network gi uplink te\nunit-type unit 4 network gi uplink te\nunit-type-control-end\n!\nspanning-tree mode mst\nport jumbo-frame\nvlan database\nvlan 5,7,852\nexit\nvoice vlan oui-table add 0001e3 Siemens_AG_phone________\nvoice vlan oui-table add 00036b Cisco_phone_____________\nvoice vlan oui-table add 00096e Avaya___________________\nvoice vlan oui-table add 000fe2 H3C_Aolynk______________\nvoice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone\nvoice vlan oui-table add 00d01e Pingtel_phone___________\nvoice vlan oui-table add 00e075 Polycom/Veritel_phone___\nvoice vlan oui-table add 00e0bb 3Com_phone______________\nerrdisable recovery cause loopback-detection\nerrdisable recovery cause port-security\nerrdisable recovery cause dot1x-src-address\nerrdisable recovery cause acl-deny\nerrdisable recovery cause stp-bpdu-guard\nerrdisable recovery cause stp-loopback-guard\nerrdisable recovery cause udld\nerrdisable recovery cause storm-control\nlink-flap prevention disable\nno ip routing\nsystem resources vlan-mapping-entries 4\nbonjour interface range vlan 1\nhostname switch1\nline console\nexec-timeout 120\nexit\nline ssh\nexec-timeout 120\nexit\nline telnet\nexec-timeout 120\nexit\nno passwords complexity enable\nusername admin password encrypted 00000000000000000000aaaaaaaaaaaaaaaaaaaa privilege 15\nusername adm02 password encrypted aaaaaaaaaaaaaaaaaaaa00000000000000000000 privilege 15\nip ssh server\nip ssh password-auth\nip ssh pubkey-auth auto-login\nsnmp-server server\nsnmp-server location SW Location \nsnmp-server community SOMe rw view Default\nip http timeout-policy 86400\nclock timezone \" \" +1\nclock summer-time web recurring eu\nsntp server 198.51.100.1\nsntp server 198.51.100.2\nno sntp server time-a.timefreq.bldrdoc.gov\nno sntp server time-b.timefreq.bldrdoc.gov\nno sntp server time-c.timefreq.bldrdoc.gov\nip telnet server\n!\ninterface vlan 1\n name Vlan1\n ip address 198.51.100.3 255.255.255.0\n no ip address dhcp\n!\ninterface vlan 5\n name Vlan5\n!\ninterface vlan 7\n name Vlan7\n!\ninterface vlan 852\n name Vlan852\n ip address 198.51.100.4 255.255.128.0\n!\ninterface GigabitEthernet1/0/1\n description \"3B10\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/2\n description \"3A9\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/3\n description \"3E2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/4\n description \"3F1\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/5\n description \"2A2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/6\n description \"Lobby\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/11\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/12\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/13\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/14\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/15\n description \"Dk\"\n!\ninterface GigabitEthernet1/0/16\n description \"Dc\"\n!\ninterface GigabitEthernet1/0/17\n description \"Dct\"\n!\ninterface GigabitEthernet1/0/18\n description \"DPC\"\n!\ninterface GigabitEthernet1/0/19\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/20\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/21\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/25\n description \"2B2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/26\n description \"2E2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/27\n description \"2F2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/28\n description \"1A2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/29\n description \"1B2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/30\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/31\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/32\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/33\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/34\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/35\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/36\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/37\n description \"MP\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/38\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/39\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/40\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/41\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/42\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/43\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/44\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/45\n description \"S2\"\n!\ninterface GigabitEthernet1/0/46\n description \"Ce\"\n!\ninterface TengigabitEthernet1/0/1\n description \"T1\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface TengigabitEthernet1/0/3\n description \"T1\"\n switchport mode trunk\n!\ninterface TengigabitEthernet1/0/4\n description \"T2\"\n switchport mode trunk\n!\nexit\nmacro auto disabled", "running": "config-file-header\nswitch1\nv2.4.5.71 / RTESLA2.4.5_930_181_144\nCLI v1.0\nfile SSD indicator encrypted\n@\nssd-control-start\nssd config\nssd file passphrase control unrestricted\nno ssd file integrity control\nssd-control-end cb0a3fdb1f3a1af4e4430033719968c0\n!\n!\nunit-type-control-start\nunit-type unit 1 network gi uplink te\nunit-type unit 2 network gi uplink te\nunit-type unit 3 network gi uplink te\nunit-type unit 4 network gi uplink te\nunit-type-control-end\n!\nspanning-tree mode mst\nport jumbo-frame\nvlan database\nvlan 5,7,852\nexit\nvoice vlan oui-table add 0001e3 Siemens_AG_phone________\nvoice vlan oui-table add 00036b Cisco_phone_____________\nvoice vlan oui-table add 00096e Avaya___________________\nvoice vlan oui-table add 000fe2 H3C_Aolynk______________\nvoice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone\nvoice vlan oui-table add 00d01e Pingtel_phone___________\nvoice vlan oui-table add 00e075 Polycom/Veritel_phone___\nvoice vlan oui-table add 00e0bb 3Com_phone______________\nerrdisable recovery cause loopback-detection\nerrdisable recovery cause port-security\nerrdisable recovery cause dot1x-src-address\nerrdisable recovery cause acl-deny\nerrdisable recovery cause stp-bpdu-guard\nerrdisable recovery cause stp-loopback-guard\nerrdisable recovery cause udld\nerrdisable recovery cause storm-control\nlink-flap prevention disable\nno ip routing\nsystem resources vlan-mapping-entries 4\nbonjour interface range vlan 1\nhostname switch1\nline console\nexec-timeout 120\nexit\nline ssh\nexec-timeout 120\nexit\nline telnet\nexec-timeout 120\nexit\nno passwords complexity enable\nusername admin password encrypted 00000000000000000000aaaaaaaaaaaaaaaaaaaa privilege 15\nusername adm02 password encrypted aaaaaaaaaaaaaaaaaaaa00000000000000000000 privilege 15\nip ssh server\nip ssh password-auth\nip ssh pubkey-auth auto-login\nsnmp-server server\nsnmp-server location SW Location \nsnmp-server community SOMe rw view Default\nip http timeout-policy 86400\nclock timezone \" \" +1\nclock summer-time web recurring eu\nsntp server 198.51.100.1\nsntp server 198.51.100.2\nno sntp server time-a.timefreq.bldrdoc.gov\nno sntp server time-b.timefreq.bldrdoc.gov\nno sntp server time-c.timefreq.bldrdoc.gov\nip telnet server\n!\ninterface vlan 1\n name Vlan1\n ip address 198.51.100.3 255.255.255.0\n no ip address dhcp\n!\ninterface vlan 5\n name Vlan5\n!\ninterface vlan 7\n name Vlan7\n!\ninterface vlan 852\n name Vlan852\n ip address 198.51.100.4 255.255.128.0\n!\ninterface GigabitEthernet1/0/1\n description \"3B10\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/2\n description \"3A9\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/3\n description \"3E2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/4\n description \"3F1\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/5\n description \"2A2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/6\n description \"Lobby\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/11\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/12\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/13\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/14\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/15\n description \"Dk\"\n!\ninterface GigabitEthernet1/0/16\n description \"Dc\"\n!\ninterface GigabitEthernet1/0/17\n description \"Dct\"\n!\ninterface GigabitEthernet1/0/18\n description \"DPC\"\n!\ninterface GigabitEthernet1/0/19\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/20\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/21\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/25\n description \"2B2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/26\n description \"2E2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/27\n description \"2F2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/28\n description \"1A2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/29\n description \"1B2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/30\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/31\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/32\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/33\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/34\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/35\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/36\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/37\n description \"MP\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/38\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/39\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/40\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/41\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/42\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/43\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/44\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/45\n description \"S2\"\n!\ninterface GigabitEthernet1/0/46\n description \"Ce\"\n!\ninterface TengigabitEthernet1/0/1\n description \"T1\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface TengigabitEthernet1/0/3\n description \"T1\"\n switchport mode trunk\n!\ninterface TengigabitEthernet1/0/4\n description \"T2\"\n switchport mode trunk\n!\nexit\nmacro auto disabled", "candidate": ""} +{ + "candidate" : "", + "running" : "\nssd-control-start\nssd config\nssd file passphrase control unrestricted\nno ssd file integrity control\nssd-control-end cb0a3fdb1f3a1af4e4430033719968c0\n!\n!\nunit-type-control-start\nunit-type unit 1 network gi uplink te\nunit-type unit 2 network gi uplink te\nunit-type unit 3 network gi uplink te\nunit-type unit 4 network gi uplink te\nunit-type-control-end\n!\nspanning-tree mode mst\nport jumbo-frame\nvlan database\nvlan 5,7,852\nexit\nvoice vlan oui-table add 0001e3 Siemens_AG_phone________\nvoice vlan oui-table add 00036b Cisco_phone_____________\nvoice vlan oui-table add 00096e Avaya___________________\nvoice vlan oui-table add 000fe2 H3C_Aolynk______________\nvoice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone\nvoice vlan oui-table add 00d01e Pingtel_phone___________\nvoice vlan oui-table add 00e075 Polycom/Veritel_phone___\nvoice vlan oui-table add 00e0bb 3Com_phone______________\nerrdisable recovery cause loopback-detection\nerrdisable recovery cause port-security\nerrdisable recovery cause dot1x-src-address\nerrdisable recovery cause acl-deny\nerrdisable recovery cause stp-bpdu-guard\nerrdisable recovery cause stp-loopback-guard\nerrdisable recovery cause udld\nerrdisable recovery cause storm-control\nlink-flap prevention disable\nno ip routing\nsystem resources vlan-mapping-entries 4\nbonjour interface range vlan 1\nhostname switch1\nline console\nexec-timeout 120\nexit\nline ssh\nexec-timeout 120\nexit\nline telnet\nexec-timeout 120\nexit\nno passwords complexity enable\nusername admin password encrypted 00000000000000000000aaaaaaaaaaaaaaaaaaaa privilege 15\nusername adm02 password encrypted aaaaaaaaaaaaaaaaaaaa00000000000000000000 privilege 15\nip ssh server\nip ssh password-auth\nip ssh pubkey-auth auto-login\nsnmp-server server\nsnmp-server location SW Location \nsnmp-server community SOMe rw view Default\nip http timeout-policy 86400\nclock timezone \" \" +1\nclock summer-time web recurring eu\nsntp server 198.51.100.1\nsntp server 198.51.100.2\nno sntp server time-a.timefreq.bldrdoc.gov\nno sntp server time-b.timefreq.bldrdoc.gov\nno sntp server time-c.timefreq.bldrdoc.gov\nip telnet server\n!\ninterface vlan 1\n name Vlan1\n ip address 198.51.100.3 255.255.255.0\n no ip address dhcp\n!\ninterface vlan 5\n name Vlan5\n!\ninterface vlan 7\n name Vlan7\n!\ninterface vlan 852\n name Vlan852\n ip address 198.51.100.4 255.255.128.0\n!\ninterface GigabitEthernet1/0/1\n description \"3B10\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/2\n description \"3A9\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/3\n description \"3E2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/4\n description \"3F1\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/5\n description \"2A2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/6\n description \"Lobby\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/11\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/12\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/13\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/14\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/15\n description \"Dk\"\n!\ninterface GigabitEthernet1/0/16\n description \"Dc\"\n!\ninterface GigabitEthernet1/0/17\n description \"Dct\"\n!\ninterface GigabitEthernet1/0/18\n description \"DPC\"\n!\ninterface GigabitEthernet1/0/19\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/20\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/21\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/25\n description \"2B2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/26\n description \"2E2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/27\n description \"2F2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/28\n description \"1A2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/29\n description \"1B2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/30\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/31\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/32\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/33\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/34\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/35\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/36\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/37\n description \"MP\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/38\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/39\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/40\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/41\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/42\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/43\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/44\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/45\n description \"S2\"\n!\ninterface GigabitEthernet1/0/46\n description \"Ce\"\n!\ninterface TengigabitEthernet1/0/1\n description \"T1\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface TengigabitEthernet1/0/3\n description \"T1\"\n switchport mode trunk\n!\ninterface TengigabitEthernet1/0/4\n description \"T2\"\n switchport mode trunk\n!\nexit\nmacro auto disabled", + "startup" : "\nssd-control-start\nssd config\nssd file passphrase control unrestricted\nno ssd file integrity control\nssd-control-end cb0a3fdb1f3a1af4e4430033719968c0\n!\n!\nunit-type-control-start\nunit-type unit 1 network gi uplink te\nunit-type unit 2 network gi uplink te\nunit-type unit 3 network gi uplink te\nunit-type unit 4 network gi uplink te\nunit-type-control-end\n!\nspanning-tree mode mst\nport jumbo-frame\nvlan database\nvlan 5,7,852\nexit\nvoice vlan oui-table add 0001e3 Siemens_AG_phone________\nvoice vlan oui-table add 00036b Cisco_phone_____________\nvoice vlan oui-table add 00096e Avaya___________________\nvoice vlan oui-table add 000fe2 H3C_Aolynk______________\nvoice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone\nvoice vlan oui-table add 00d01e Pingtel_phone___________\nvoice vlan oui-table add 00e075 Polycom/Veritel_phone___\nvoice vlan oui-table add 00e0bb 3Com_phone______________\nerrdisable recovery cause loopback-detection\nerrdisable recovery cause port-security\nerrdisable recovery cause dot1x-src-address\nerrdisable recovery cause acl-deny\nerrdisable recovery cause stp-bpdu-guard\nerrdisable recovery cause stp-loopback-guard\nerrdisable recovery cause udld\nerrdisable recovery cause storm-control\nlink-flap prevention disable\nno ip routing\nsystem resources vlan-mapping-entries 4\nbonjour interface range vlan 1\nhostname switch1\nline console\nexec-timeout 120\nexit\nline ssh\nexec-timeout 120\nexit\nline telnet\nexec-timeout 120\nexit\nno passwords complexity enable\nusername admin password encrypted 00000000000000000000aaaaaaaaaaaaaaaaaaaa privilege 15\nusername adm02 password encrypted aaaaaaaaaaaaaaaaaaaa00000000000000000000 privilege 15\nip ssh server\nip ssh password-auth\nip ssh pubkey-auth auto-login\nsnmp-server server\nsnmp-server location SW Location \nsnmp-server community SOMe rw view Default\nip http timeout-policy 86400\nclock timezone \" \" +1\nclock summer-time web recurring eu\nsntp server 198.51.100.1\nsntp server 198.51.100.2\nno sntp server time-a.timefreq.bldrdoc.gov\nno sntp server time-b.timefreq.bldrdoc.gov\nno sntp server time-c.timefreq.bldrdoc.gov\nip telnet server\n!\ninterface vlan 1\n name Vlan1\n ip address 198.51.100.3 255.255.255.0\n no ip address dhcp\n!\ninterface vlan 5\n name Vlan5\n!\ninterface vlan 7\n name Vlan7\n!\ninterface vlan 852\n name Vlan852\n ip address 198.51.100.4 255.255.128.0\n!\ninterface GigabitEthernet1/0/1\n description \"3B10\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/2\n description \"3A9\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/3\n description \"3E2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/4\n description \"3F1\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/5\n description \"2A2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/6\n description \"Lobby\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/11\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/12\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/13\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/14\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/15\n description \"Dk\"\n!\ninterface GigabitEthernet1/0/16\n description \"Dc\"\n!\ninterface GigabitEthernet1/0/17\n description \"Dct\"\n!\ninterface GigabitEthernet1/0/18\n description \"DPC\"\n!\ninterface GigabitEthernet1/0/19\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/20\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/21\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/25\n description \"2B2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/26\n description \"2E2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/27\n description \"2F2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/28\n description \"1A2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/29\n description \"1B2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/30\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/31\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/32\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/33\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/34\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/35\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/36\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/37\n description \"MP\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/38\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/39\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/40\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/41\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/42\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/43\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/44\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/45\n description \"S2\"\n!\ninterface GigabitEthernet1/0/46\n description \"Ce\"\n!\ninterface TengigabitEthernet1/0/1\n description \"T1\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface TengigabitEthernet1/0/3\n description \"T1\"\n switchport mode trunk\n!\ninterface TengigabitEthernet1/0/4\n description \"T2\"\n switchport mode trunk\n!\nexit\nmacro auto disabled" +} diff --git a/test/unit/mocked_data/test_get_config/SG350X-48P-K9/expected_result.json.new b/test/unit/mocked_data/test_get_config/SG350X-48P-K9/expected_result.json.new new file mode 100644 index 0000000..f8846bb --- /dev/null +++ b/test/unit/mocked_data/test_get_config/SG350X-48P-K9/expected_result.json.new @@ -0,0 +1,2 @@ +{"startup": "\nssd-control-start\nssd config\nssd file passphrase control unrestricted\nno ssd file integrity control\nssd-control-end cb0a3fdb1f3a1af4e4430033719968c0\n!\n!\nunit-type-control-start\nunit-type unit 1 network gi uplink te\nunit-type unit 2 network gi uplink te\nunit-type unit 3 network gi uplink te\nunit-type unit 4 network gi uplink te\nunit-type-control-end\n!\nspanning-tree mode mst\nport jumbo-frame\nvlan database\nvlan 5,7,852\nexit\nvoice vlan oui-table add 0001e3 Siemens_AG_phone________\nvoice vlan oui-table add 00036b Cisco_phone_____________\nvoice vlan oui-table add 00096e Avaya___________________\nvoice vlan oui-table add 000fe2 H3C_Aolynk______________\nvoice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone\nvoice vlan oui-table add 00d01e Pingtel_phone___________\nvoice vlan oui-table add 00e075 Polycom/Veritel_phone___\nvoice vlan oui-table add 00e0bb 3Com_phone______________\nerrdisable recovery cause loopback-detection\nerrdisable recovery cause port-security\nerrdisable recovery cause dot1x-src-address\nerrdisable recovery cause acl-deny\nerrdisable recovery cause stp-bpdu-guard\nerrdisable recovery cause stp-loopback-guard\nerrdisable recovery cause udld\nerrdisable recovery cause storm-control\nlink-flap prevention disable\nno ip routing\nsystem resources vlan-mapping-entries 4\nbonjour interface range vlan 1\nhostname switch1\nline console\nexec-timeout 120\nexit\nline ssh\nexec-timeout 120\nexit\nline telnet\nexec-timeout 120\nexit\nno passwords complexity enable\nusername admin password encrypted 00000000000000000000aaaaaaaaaaaaaaaaaaaa privilege 15\nusername adm02 password encrypted aaaaaaaaaaaaaaaaaaaa00000000000000000000 privilege 15\nip ssh server\nip ssh password-auth\nip ssh pubkey-auth auto-login\nsnmp-server server\nsnmp-server location SW Location \nsnmp-server community SOMe rw view Default\nip http timeout-policy 86400\nclock timezone \" \" +1\nclock summer-time web recurring eu\nsntp server 198.51.100.1\nsntp server 198.51.100.2\nno sntp server time-a.timefreq.bldrdoc.gov\nno sntp server time-b.timefreq.bldrdoc.gov\nno sntp server time-c.timefreq.bldrdoc.gov\nip telnet server\n!\ninterface vlan 1\n name Vlan1\n ip address 198.51.100.3 255.255.255.0\n no ip address dhcp\n!\ninterface vlan 5\n name Vlan5\n!\ninterface vlan 7\n name Vlan7\n!\ninterface vlan 852\n name Vlan852\n ip address 198.51.100.4 255.255.128.0\n!\ninterface GigabitEthernet1/0/1\n description \"3B10\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/2\n description \"3A9\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/3\n description \"3E2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/4\n description \"3F1\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/5\n description \"2A2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/6\n description \"Lobby\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/11\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/12\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/13\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/14\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/15\n description \"Dk\"\n!\ninterface GigabitEthernet1/0/16\n description \"Dc\"\n!\ninterface GigabitEthernet1/0/17\n description \"Dct\"\n!\ninterface GigabitEthernet1/0/18\n description \"DPC\"\n!\ninterface GigabitEthernet1/0/19\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/20\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/21\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/25\n description \"2B2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/26\n description \"2E2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/27\n description \"2F2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/28\n description \"1A2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/29\n description \"1B2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/30\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/31\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/32\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/33\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/34\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/35\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/36\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/37\n description \"MP\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/38\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/39\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/40\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/41\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/42\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/43\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/44\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/45\n description \"S2\"\n!\ninterface GigabitEthernet1/0/46\n description \"Ce\"\n!\ninterface TengigabitEthernet1/0/1\n description \"T1\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface TengigabitEthernet1/0/3\n description \"T1\"\n switchport mode trunk\n!\ninterface TengigabitEthernet1/0/4\n description \"T2\"\n switchport mode trunk\n!\nexit\nmacro auto disabled", "running": "\nssd-control-start\nssd config\nssd file passphrase control unrestricted\nno ssd file integrity control\nssd-control-end cb0a3fdb1f3a1af4e4430033719968c0\n!\n!\nunit-type-control-start\nunit-type unit 1 network gi uplink te\nunit-type unit 2 network gi uplink te\nunit-type unit 3 network gi uplink te\nunit-type unit 4 network gi uplink te\nunit-type-control-end\n!\nspanning-tree mode mst\nport jumbo-frame\nvlan database\nvlan 5,7,852\nexit\nvoice vlan oui-table add 0001e3 Siemens_AG_phone________\nvoice vlan oui-table add 00036b Cisco_phone_____________\nvoice vlan oui-table add 00096e Avaya___________________\nvoice vlan oui-table add 000fe2 H3C_Aolynk______________\nvoice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone\nvoice vlan oui-table add 00d01e Pingtel_phone___________\nvoice vlan oui-table add 00e075 Polycom/Veritel_phone___\nvoice vlan oui-table add 00e0bb 3Com_phone______________\nerrdisable recovery cause loopback-detection\nerrdisable recovery cause port-security\nerrdisable recovery cause dot1x-src-address\nerrdisable recovery cause acl-deny\nerrdisable recovery cause stp-bpdu-guard\nerrdisable recovery cause stp-loopback-guard\nerrdisable recovery cause udld\nerrdisable recovery cause storm-control\nlink-flap prevention disable\nno ip routing\nsystem resources vlan-mapping-entries 4\nbonjour interface range vlan 1\nhostname switch1\nline console\nexec-timeout 120\nexit\nline ssh\nexec-timeout 120\nexit\nline telnet\nexec-timeout 120\nexit\nno passwords complexity enable\nusername admin password encrypted 00000000000000000000aaaaaaaaaaaaaaaaaaaa privilege 15\nusername adm02 password encrypted aaaaaaaaaaaaaaaaaaaa00000000000000000000 privilege 15\nip ssh server\nip ssh password-auth\nip ssh pubkey-auth auto-login\nsnmp-server server\nsnmp-server location SW Location \nsnmp-server community SOMe rw view Default\nip http timeout-policy 86400\nclock timezone \" \" +1\nclock summer-time web recurring eu\nsntp server 198.51.100.1\nsntp server 198.51.100.2\nno sntp server time-a.timefreq.bldrdoc.gov\nno sntp server time-b.timefreq.bldrdoc.gov\nno sntp server time-c.timefreq.bldrdoc.gov\nip telnet server\n!\ninterface vlan 1\n name Vlan1\n ip address 198.51.100.3 255.255.255.0\n no ip address dhcp\n!\ninterface vlan 5\n name Vlan5\n!\ninterface vlan 7\n name Vlan7\n!\ninterface vlan 852\n name Vlan852\n ip address 198.51.100.4 255.255.128.0\n!\ninterface GigabitEthernet1/0/1\n description \"3B10\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/2\n description \"3A9\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/3\n description \"3E2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/4\n description \"3F1\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/5\n description \"2A2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/6\n description \"Lobby\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/11\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/12\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/13\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/14\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/15\n description \"Dk\"\n!\ninterface GigabitEthernet1/0/16\n description \"Dc\"\n!\ninterface GigabitEthernet1/0/17\n description \"Dct\"\n!\ninterface GigabitEthernet1/0/18\n description \"DPC\"\n!\ninterface GigabitEthernet1/0/19\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/20\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/21\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/25\n description \"2B2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/26\n description \"2E2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/27\n description \"2F2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/28\n description \"1A2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/29\n description \"1B2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/30\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/31\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/32\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/33\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/34\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/35\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/36\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/37\n description \"MP\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/38\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/39\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/40\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/41\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/42\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/43\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/44\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/45\n description \"S2\"\n!\ninterface GigabitEthernet1/0/46\n description \"Ce\"\n!\ninterface TengigabitEthernet1/0/1\n description \"T1\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface TengigabitEthernet1/0/3\n description \"T1\"\n switchport mode trunk\n!\ninterface TengigabitEthernet1/0/4\n description \"T2\"\n switchport mode trunk\n!\nexit\nmacro auto disabled", "candidate": ""} + diff --git a/test/unit/mocked_data/test_get_config_filtered/SG350X-48P-K9/expected_result.json b/test/unit/mocked_data/test_get_config_filtered/SG350X-48P-K9/expected_result.json index 0967ef4..dcddbba 100644 --- a/test/unit/mocked_data/test_get_config_filtered/SG350X-48P-K9/expected_result.json +++ b/test/unit/mocked_data/test_get_config_filtered/SG350X-48P-K9/expected_result.json @@ -1 +1,5 @@ -{} +{ + "startup": "", + "running": "", + "candidate": "" +} diff --git a/test/unit/mocked_data/test_get_config_sanitized/SG350X-48P-K9/expected_result.json b/test/unit/mocked_data/test_get_config_sanitized/SG350X-48P-K9/expected_result.json new file mode 100644 index 0000000..23cfb09 --- /dev/null +++ b/test/unit/mocked_data/test_get_config_sanitized/SG350X-48P-K9/expected_result.json @@ -0,0 +1,5 @@ +{ + "candidate" : "", + "running" : "\nssd-control-start\nssd config\nssd file passphrase control unrestricted\nno ssd file integrity control\nssd-control-end cb0a3fdb1f3a1af4e4430033719968c0\n!\n!\nunit-type-control-start\nunit-type unit 1 network gi uplink te\nunit-type unit 2 network gi uplink te\nunit-type unit 3 network gi uplink te\nunit-type unit 4 network gi uplink te\nunit-type-control-end\n!\nspanning-tree mode mst\nport jumbo-frame\nvlan database\nvlan 5,7,852\nexit\nvoice vlan oui-table add 0001e3 Siemens_AG_phone________\nvoice vlan oui-table add 00036b Cisco_phone_____________\nvoice vlan oui-table add 00096e Avaya___________________\nvoice vlan oui-table add 000fe2 H3C_Aolynk______________\nvoice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone\nvoice vlan oui-table add 00d01e Pingtel_phone___________\nvoice vlan oui-table add 00e075 Polycom/Veritel_phone___\nvoice vlan oui-table add 00e0bb 3Com_phone______________\nerrdisable recovery cause loopback-detection\nerrdisable recovery cause port-security\nerrdisable recovery cause dot1x-src-address\nerrdisable recovery cause acl-deny\nerrdisable recovery cause stp-bpdu-guard\nerrdisable recovery cause stp-loopback-guard\nerrdisable recovery cause udld\nerrdisable recovery cause storm-control\nlink-flap prevention disable\nno ip routing\nsystem resources vlan-mapping-entries 4\nbonjour interface range vlan 1\nhostname switch1\nline console\nexec-timeout 120\nexit\nline ssh\nexec-timeout 120\nexit\nline telnet\nexec-timeout 120\nexit\nno passwords complexity enable\nusername admin password encrypted privilege 15\nusername adm02 password encrypted privilege 15\nip ssh server\nip ssh password-auth\nip ssh pubkey-auth auto-login\nsnmp-server server\nsnmp-server location \nsnmp-server community \nip http timeout-policy 86400\nclock timezone \" \" +1\nclock summer-time web recurring eu\nsntp server 198.51.100.1\nsntp server 198.51.100.2\nno sntp server time-a.timefreq.bldrdoc.gov\nno sntp server time-b.timefreq.bldrdoc.gov\nno sntp server time-c.timefreq.bldrdoc.gov\nip telnet server\n!\ninterface vlan 1\n name Vlan1\n ip address 198.51.100.3 255.255.255.0\n no ip address dhcp\n!\ninterface vlan 5\n name Vlan5\n!\ninterface vlan 7\n name Vlan7\n!\ninterface vlan 852\n name Vlan852\n ip address 198.51.100.4 255.255.128.0\n!\ninterface GigabitEthernet1/0/1\n description \"3B10\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/2\n description \"3A9\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/3\n description \"3E2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/4\n description \"3F1\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/5\n description \"2A2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/6\n description \"Lobby\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/11\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/12\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/13\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/14\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/15\n description \"Dk\"\n!\ninterface GigabitEthernet1/0/16\n description \"Dc\"\n!\ninterface GigabitEthernet1/0/17\n description \"Dct\"\n!\ninterface GigabitEthernet1/0/18\n description \"DPC\"\n!\ninterface GigabitEthernet1/0/19\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/20\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/21\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/25\n description \"2B2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/26\n description \"2E2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/27\n description \"2F2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/28\n description \"1A2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/29\n description \"1B2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/30\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/31\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/32\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/33\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/34\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/35\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/36\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/37\n description \"MP\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/38\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/39\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/40\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/41\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/42\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/43\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/44\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/45\n description \"S2\"\n!\ninterface GigabitEthernet1/0/46\n description \"Ce\"\n!\ninterface TengigabitEthernet1/0/1\n description \"T1\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface TengigabitEthernet1/0/3\n description \"T1\"\n switchport mode trunk\n!\ninterface TengigabitEthernet1/0/4\n description \"T2\"\n switchport mode trunk\n!\nexit\nmacro auto disabled", + "startup" : "\nssd-control-start\nssd config\nssd file passphrase control unrestricted\nno ssd file integrity control\nssd-control-end cb0a3fdb1f3a1af4e4430033719968c0\n!\n!\nunit-type-control-start\nunit-type unit 1 network gi uplink te\nunit-type unit 2 network gi uplink te\nunit-type unit 3 network gi uplink te\nunit-type unit 4 network gi uplink te\nunit-type-control-end\n!\nspanning-tree mode mst\nport jumbo-frame\nvlan database\nvlan 5,7,852\nexit\nvoice vlan oui-table add 0001e3 Siemens_AG_phone________\nvoice vlan oui-table add 00036b Cisco_phone_____________\nvoice vlan oui-table add 00096e Avaya___________________\nvoice vlan oui-table add 000fe2 H3C_Aolynk______________\nvoice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone\nvoice vlan oui-table add 00d01e Pingtel_phone___________\nvoice vlan oui-table add 00e075 Polycom/Veritel_phone___\nvoice vlan oui-table add 00e0bb 3Com_phone______________\nerrdisable recovery cause loopback-detection\nerrdisable recovery cause port-security\nerrdisable recovery cause dot1x-src-address\nerrdisable recovery cause acl-deny\nerrdisable recovery cause stp-bpdu-guard\nerrdisable recovery cause stp-loopback-guard\nerrdisable recovery cause udld\nerrdisable recovery cause storm-control\nlink-flap prevention disable\nno ip routing\nsystem resources vlan-mapping-entries 4\nbonjour interface range vlan 1\nhostname switch1\nline console\nexec-timeout 120\nexit\nline ssh\nexec-timeout 120\nexit\nline telnet\nexec-timeout 120\nexit\nno passwords complexity enable\nusername admin password encrypted privilege 15\nusername adm02 password encrypted privilege 15\nip ssh server\nip ssh password-auth\nip ssh pubkey-auth auto-login\nsnmp-server server\nsnmp-server location \nsnmp-server community \nip http timeout-policy 86400\nclock timezone \" \" +1\nclock summer-time web recurring eu\nsntp server 198.51.100.1\nsntp server 198.51.100.2\nno sntp server time-a.timefreq.bldrdoc.gov\nno sntp server time-b.timefreq.bldrdoc.gov\nno sntp server time-c.timefreq.bldrdoc.gov\nip telnet server\n!\ninterface vlan 1\n name Vlan1\n ip address 198.51.100.3 255.255.255.0\n no ip address dhcp\n!\ninterface vlan 5\n name Vlan5\n!\ninterface vlan 7\n name Vlan7\n!\ninterface vlan 852\n name Vlan852\n ip address 198.51.100.4 255.255.128.0\n!\ninterface GigabitEthernet1/0/1\n description \"3B10\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/2\n description \"3A9\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/3\n description \"3E2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/4\n description \"3F1\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/5\n description \"2A2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/6\n description \"Lobby\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/11\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/12\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/13\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/14\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/15\n description \"Dk\"\n!\ninterface GigabitEthernet1/0/16\n description \"Dc\"\n!\ninterface GigabitEthernet1/0/17\n description \"Dct\"\n!\ninterface GigabitEthernet1/0/18\n description \"DPC\"\n!\ninterface GigabitEthernet1/0/19\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/20\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/21\n description \"Dr\"\n!\ninterface GigabitEthernet1/0/25\n description \"2B2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/26\n description \"2E2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/27\n description \"2F2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/28\n description \"1A2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/29\n description \"1B2\"\n switchport mode trunk\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/30\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/31\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/32\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/33\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/34\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/35\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/36\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/37\n description \"MP\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk allowed vlan remove 2-4,6-4094\n!\ninterface GigabitEthernet1/0/38\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/39\n description \"MV\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface GigabitEthernet1/0/40\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/41\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/42\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/43\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/44\n switchport access vlan 5\n!\ninterface GigabitEthernet1/0/45\n description \"S2\"\n!\ninterface GigabitEthernet1/0/46\n description \"Ce\"\n!\ninterface TengigabitEthernet1/0/1\n description \"T1\"\n switchport mode trunk\n switchport access vlan 852\n switchport trunk native vlan 852\n switchport trunk allowed vlan remove 1-6,8-851,853-4094\n!\ninterface TengigabitEthernet1/0/3\n description \"T1\"\n switchport mode trunk\n!\ninterface TengigabitEthernet1/0/4\n description \"T2\"\n switchport mode trunk\n!\nexit\nmacro auto disabled" +} diff --git a/test/unit/mocked_data/test_get_config_sanitized/SG350X-48P-K9/show_running_config.txt b/test/unit/mocked_data/test_get_config_sanitized/SG350X-48P-K9/show_running_config.txt new file mode 100644 index 0000000..a9d1793 --- /dev/null +++ b/test/unit/mocked_data/test_get_config_sanitized/SG350X-48P-K9/show_running_config.txt @@ -0,0 +1,264 @@ +config-file-header +switch1 +v2.4.5.71 / RTESLA2.4.5_930_181_144 +CLI v1.0 +file SSD indicator encrypted +@ +ssd-control-start +ssd config +ssd file passphrase control unrestricted +no ssd file integrity control +ssd-control-end cb0a3fdb1f3a1af4e4430033719968c0 +! +! +unit-type-control-start +unit-type unit 1 network gi uplink te +unit-type unit 2 network gi uplink te +unit-type unit 3 network gi uplink te +unit-type unit 4 network gi uplink te +unit-type-control-end +! +spanning-tree mode mst +port jumbo-frame +vlan database +vlan 5,7,852 +exit +voice vlan oui-table add 0001e3 Siemens_AG_phone________ +voice vlan oui-table add 00036b Cisco_phone_____________ +voice vlan oui-table add 00096e Avaya___________________ +voice vlan oui-table add 000fe2 H3C_Aolynk______________ +voice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone +voice vlan oui-table add 00d01e Pingtel_phone___________ +voice vlan oui-table add 00e075 Polycom/Veritel_phone___ +voice vlan oui-table add 00e0bb 3Com_phone______________ +errdisable recovery cause loopback-detection +errdisable recovery cause port-security +errdisable recovery cause dot1x-src-address +errdisable recovery cause acl-deny +errdisable recovery cause stp-bpdu-guard +errdisable recovery cause stp-loopback-guard +errdisable recovery cause udld +errdisable recovery cause storm-control +link-flap prevention disable +no ip routing +system resources vlan-mapping-entries 4 +bonjour interface range vlan 1 +hostname switch1 +line console +exec-timeout 120 +exit +line ssh +exec-timeout 120 +exit +line telnet +exec-timeout 120 +exit +no passwords complexity enable +username admin password encrypted 00000000000000000000aaaaaaaaaaaaaaaaaaaa privilege 15 +username adm02 password encrypted aaaaaaaaaaaaaaaaaaaa00000000000000000000 privilege 15 +ip ssh server +ip ssh password-auth +ip ssh pubkey-auth auto-login +snmp-server server +snmp-server location SW Location +snmp-server community SOMe rw view Default +ip http timeout-policy 86400 +clock timezone " " +1 +clock summer-time web recurring eu +sntp server 198.51.100.1 +sntp server 198.51.100.2 +no sntp server time-a.timefreq.bldrdoc.gov +no sntp server time-b.timefreq.bldrdoc.gov +no sntp server time-c.timefreq.bldrdoc.gov +ip telnet server +! +interface vlan 1 + name Vlan1 + ip address 198.51.100.3 255.255.255.0 + no ip address dhcp +! +interface vlan 5 + name Vlan5 +! +interface vlan 7 + name Vlan7 +! +interface vlan 852 + name Vlan852 + ip address 198.51.100.4 255.255.128.0 +! +interface GigabitEthernet1/0/1 + description "3B10" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/2 + description "3A9" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/3 + description "3E2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/4 + description "3F1" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/5 + description "2A2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/6 + description "Lobby" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/11 + switchport access vlan 5 +! +interface GigabitEthernet1/0/12 + switchport access vlan 5 +! +interface GigabitEthernet1/0/13 + switchport access vlan 5 +! +interface GigabitEthernet1/0/14 + switchport access vlan 5 +! +interface GigabitEthernet1/0/15 + description "Dk" +! +interface GigabitEthernet1/0/16 + description "Dc" +! +interface GigabitEthernet1/0/17 + description "Dct" +! +interface GigabitEthernet1/0/18 + description "DPC" +! +interface GigabitEthernet1/0/19 + description "Dr" +! +interface GigabitEthernet1/0/20 + description "Dr" +! +interface GigabitEthernet1/0/21 + description "Dr" +! +interface GigabitEthernet1/0/25 + description "2B2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/26 + description "2E2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/27 + description "2F2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/28 + description "1A2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/29 + description "1B2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/30 + switchport access vlan 5 +! +interface GigabitEthernet1/0/31 + switchport access vlan 5 +! +interface GigabitEthernet1/0/32 + switchport access vlan 5 +! +interface GigabitEthernet1/0/33 + switchport access vlan 5 +! +interface GigabitEthernet1/0/34 + switchport access vlan 5 +! +interface GigabitEthernet1/0/35 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/36 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/37 + description "MP" + switchport mode trunk + switchport access vlan 852 + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/38 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/39 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/40 + switchport access vlan 5 +! +interface GigabitEthernet1/0/41 + switchport access vlan 5 +! +interface GigabitEthernet1/0/42 + switchport access vlan 5 +! +interface GigabitEthernet1/0/43 + switchport access vlan 5 +! +interface GigabitEthernet1/0/44 + switchport access vlan 5 +! +interface GigabitEthernet1/0/45 + description "S2" +! +interface GigabitEthernet1/0/46 + description "Ce" +! +interface TengigabitEthernet1/0/1 + description "T1" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface TengigabitEthernet1/0/3 + description "T1" + switchport mode trunk +! +interface TengigabitEthernet1/0/4 + description "T2" + switchport mode trunk +! +exit +macro auto disabled diff --git a/test/unit/mocked_data/test_get_config_sanitized/SG350X-48P-K9/show_startup_config.txt b/test/unit/mocked_data/test_get_config_sanitized/SG350X-48P-K9/show_startup_config.txt new file mode 100644 index 0000000..a9d1793 --- /dev/null +++ b/test/unit/mocked_data/test_get_config_sanitized/SG350X-48P-K9/show_startup_config.txt @@ -0,0 +1,264 @@ +config-file-header +switch1 +v2.4.5.71 / RTESLA2.4.5_930_181_144 +CLI v1.0 +file SSD indicator encrypted +@ +ssd-control-start +ssd config +ssd file passphrase control unrestricted +no ssd file integrity control +ssd-control-end cb0a3fdb1f3a1af4e4430033719968c0 +! +! +unit-type-control-start +unit-type unit 1 network gi uplink te +unit-type unit 2 network gi uplink te +unit-type unit 3 network gi uplink te +unit-type unit 4 network gi uplink te +unit-type-control-end +! +spanning-tree mode mst +port jumbo-frame +vlan database +vlan 5,7,852 +exit +voice vlan oui-table add 0001e3 Siemens_AG_phone________ +voice vlan oui-table add 00036b Cisco_phone_____________ +voice vlan oui-table add 00096e Avaya___________________ +voice vlan oui-table add 000fe2 H3C_Aolynk______________ +voice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone +voice vlan oui-table add 00d01e Pingtel_phone___________ +voice vlan oui-table add 00e075 Polycom/Veritel_phone___ +voice vlan oui-table add 00e0bb 3Com_phone______________ +errdisable recovery cause loopback-detection +errdisable recovery cause port-security +errdisable recovery cause dot1x-src-address +errdisable recovery cause acl-deny +errdisable recovery cause stp-bpdu-guard +errdisable recovery cause stp-loopback-guard +errdisable recovery cause udld +errdisable recovery cause storm-control +link-flap prevention disable +no ip routing +system resources vlan-mapping-entries 4 +bonjour interface range vlan 1 +hostname switch1 +line console +exec-timeout 120 +exit +line ssh +exec-timeout 120 +exit +line telnet +exec-timeout 120 +exit +no passwords complexity enable +username admin password encrypted 00000000000000000000aaaaaaaaaaaaaaaaaaaa privilege 15 +username adm02 password encrypted aaaaaaaaaaaaaaaaaaaa00000000000000000000 privilege 15 +ip ssh server +ip ssh password-auth +ip ssh pubkey-auth auto-login +snmp-server server +snmp-server location SW Location +snmp-server community SOMe rw view Default +ip http timeout-policy 86400 +clock timezone " " +1 +clock summer-time web recurring eu +sntp server 198.51.100.1 +sntp server 198.51.100.2 +no sntp server time-a.timefreq.bldrdoc.gov +no sntp server time-b.timefreq.bldrdoc.gov +no sntp server time-c.timefreq.bldrdoc.gov +ip telnet server +! +interface vlan 1 + name Vlan1 + ip address 198.51.100.3 255.255.255.0 + no ip address dhcp +! +interface vlan 5 + name Vlan5 +! +interface vlan 7 + name Vlan7 +! +interface vlan 852 + name Vlan852 + ip address 198.51.100.4 255.255.128.0 +! +interface GigabitEthernet1/0/1 + description "3B10" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/2 + description "3A9" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/3 + description "3E2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/4 + description "3F1" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/5 + description "2A2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/6 + description "Lobby" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/11 + switchport access vlan 5 +! +interface GigabitEthernet1/0/12 + switchport access vlan 5 +! +interface GigabitEthernet1/0/13 + switchport access vlan 5 +! +interface GigabitEthernet1/0/14 + switchport access vlan 5 +! +interface GigabitEthernet1/0/15 + description "Dk" +! +interface GigabitEthernet1/0/16 + description "Dc" +! +interface GigabitEthernet1/0/17 + description "Dct" +! +interface GigabitEthernet1/0/18 + description "DPC" +! +interface GigabitEthernet1/0/19 + description "Dr" +! +interface GigabitEthernet1/0/20 + description "Dr" +! +interface GigabitEthernet1/0/21 + description "Dr" +! +interface GigabitEthernet1/0/25 + description "2B2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/26 + description "2E2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/27 + description "2F2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/28 + description "1A2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/29 + description "1B2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/30 + switchport access vlan 5 +! +interface GigabitEthernet1/0/31 + switchport access vlan 5 +! +interface GigabitEthernet1/0/32 + switchport access vlan 5 +! +interface GigabitEthernet1/0/33 + switchport access vlan 5 +! +interface GigabitEthernet1/0/34 + switchport access vlan 5 +! +interface GigabitEthernet1/0/35 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/36 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/37 + description "MP" + switchport mode trunk + switchport access vlan 852 + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/38 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/39 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/40 + switchport access vlan 5 +! +interface GigabitEthernet1/0/41 + switchport access vlan 5 +! +interface GigabitEthernet1/0/42 + switchport access vlan 5 +! +interface GigabitEthernet1/0/43 + switchport access vlan 5 +! +interface GigabitEthernet1/0/44 + switchport access vlan 5 +! +interface GigabitEthernet1/0/45 + description "S2" +! +interface GigabitEthernet1/0/46 + description "Ce" +! +interface TengigabitEthernet1/0/1 + description "T1" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface TengigabitEthernet1/0/3 + description "T1" + switchport mode trunk +! +interface TengigabitEthernet1/0/4 + description "T2" + switchport mode trunk +! +exit +macro auto disabled