Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds another keyword argument to the get_config method, in order to filter out various sensitive details such as secrets, passwords, etc. Also corrects the test for Junos which weren't testing anything actually.
- Loading branch information
1 parent
9731790
commit 10b2c7a
Showing
35 changed files
with
2,328 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
test/eos/mocked_data/test_get_config_sanitized/normal/expected_result.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"startup": "! Command: show startup-config\n! Startup-config last modified at Sun Sep 11 18:35:01 2016 by root\n! device: localhost (vEOS, EOS-4.15.2.1F)\n!\n! boot system flash:/vEOS-lab.swi\n!\nevent-handler dhclient\n trigger on-boot\n action bash sudo /mnt/flash/initialize_ma1.sh\n !\n transceiver qsfp default-mode 4x10G\n !\n spanning-tree mode mstp\n !\n aaa authorization exec default local\n !\n aaa root secret 5 $1$zr7sHZaW$WagNykw1d5wjy4ZhtMgUS/\n !\n username admin privilege 15 role network-admin secret 5 $1$VoQBHXed$4z2.EoAeoIY2SFme/Pz3Q/\n username vagrant privilege 15 role network-admin secret 5 $1$l/6gq.Qs$ifURvKWUYzLm0RqmRgr.W1\n !\n interface Ethernet1\n !\n interface Ethernet2\n !\n interface Management1\n ip address 10.0.2.15/24\n\t !\n\t no ip routing\n\t !\n\t management api http-commands\n\t no shutdown\n\t !\n\t !\n\t end\n", | ||
"running": "! Command: show startup-config\n! Startup-config last modified at Sun Sep 11 18:35:01 2016 by root\n! device: localhost (vEOS, EOS-4.15.2.1F)\n!\n! boot system flash:/vEOS-lab.swi\n!\nevent-handler dhclient\n trigger on-boot\n action bash sudo /mnt/flash/initialize_ma1.sh\n !\n transceiver qsfp default-mode 4x10G\n !\n spanning-tree mode mstp\n !\n aaa authorization exec default local\n !\n aaa root secret 5 <removed>\n !\n username admin privilege 15 role network-admin secret 5 <removed>\n username vagrant privilege 15 role network-admin secret 5 <removed>\n !\n interface Ethernet1\n !\n interface Ethernet2\n !\n interface Management1\n ip address 10.0.2.15/24\n\t !\n\t no ip routing\n\t !\n\t management api http-commands\n\t no shutdown\n\t !\n\t !\n\t end\n", | ||
"candidate": "" | ||
} |
35 changes: 35 additions & 0 deletions
35
test/eos/mocked_data/test_get_config_sanitized/normal/show_running_config_sanitized.text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
! Command: show startup-config | ||
! Startup-config last modified at Sun Sep 11 18:35:01 2016 by root | ||
! device: localhost (vEOS, EOS-4.15.2.1F) | ||
! | ||
! boot system flash:/vEOS-lab.swi | ||
! | ||
event-handler dhclient | ||
trigger on-boot | ||
action bash sudo /mnt/flash/initialize_ma1.sh | ||
! | ||
transceiver qsfp default-mode 4x10G | ||
! | ||
spanning-tree mode mstp | ||
! | ||
aaa authorization exec default local | ||
! | ||
aaa root secret 5 <removed> | ||
! | ||
username admin privilege 15 role network-admin secret 5 <removed> | ||
username vagrant privilege 15 role network-admin secret 5 <removed> | ||
! | ||
interface Ethernet1 | ||
! | ||
interface Ethernet2 | ||
! | ||
interface Management1 | ||
ip address 10.0.2.15/24 | ||
! | ||
no ip routing | ||
! | ||
management api http-commands | ||
no shutdown | ||
! | ||
! | ||
end |
35 changes: 35 additions & 0 deletions
35
test/eos/mocked_data/test_get_config_sanitized/normal/show_startup_config.text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
! Command: show startup-config | ||
! Startup-config last modified at Sun Sep 11 18:35:01 2016 by root | ||
! device: localhost (vEOS, EOS-4.15.2.1F) | ||
! | ||
! boot system flash:/vEOS-lab.swi | ||
! | ||
event-handler dhclient | ||
trigger on-boot | ||
action bash sudo /mnt/flash/initialize_ma1.sh | ||
! | ||
transceiver qsfp default-mode 4x10G | ||
! | ||
spanning-tree mode mstp | ||
! | ||
aaa authorization exec default local | ||
! | ||
aaa root secret 5 $1$zr7sHZaW$WagNykw1d5wjy4ZhtMgUS/ | ||
! | ||
username admin privilege 15 role network-admin secret 5 $1$VoQBHXed$4z2.EoAeoIY2SFme/Pz3Q/ | ||
username vagrant privilege 15 role network-admin secret 5 $1$l/6gq.Qs$ifURvKWUYzLm0RqmRgr.W1 | ||
! | ||
interface Ethernet1 | ||
! | ||
interface Ethernet2 | ||
! | ||
interface Management1 | ||
ip address 10.0.2.15/24 | ||
! | ||
no ip routing | ||
! | ||
management api http-commands | ||
no shutdown | ||
! | ||
! | ||
end |
5 changes: 5 additions & 0 deletions
5
test/ios/mocked_data/test_get_config_sanitized/normal/expected_result.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"startup": "!\n\n!\nversion 15.5\nservice timestamps debug datetime msec\nservice timestamps log datetime msec\nno platform punt-keepalive disable-kernel-core\nplatform console auto\n!\nhostname CSR1\n!\nboot-start-marker\nboot-end-marker\n!\n!\nenable password cisco\n!\naaa new-model\n!\n!\naaa authentication login default local\naaa authorization exec default local\n!\n!\n!\n!\n!\naaa session-id common\n!\nip vrf MGMT\n!\n!\n!\n!\n!\n!\n!\n!\n!\n\n\nip domain name example.local\n\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\nsubscriber templating\n!\nmultilink bundle-name authenticated\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\nlicense udi pid CSR1000V sn 9OSEGKJXRHE\nspanning-tree extend system-id\n!\nusername cisco privilege 15 password 0 <removed>\n!\nredundancy\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\ninterface Loopback0\n ip address 1.1.1.1 255.255.255.255\n!\ninterface GigabitEthernet1\n ip vrf forwarding MGMT\n ip address 192.168.35.121 255.255.255.0\n negotiation auto\n!\ninterface GigabitEthernet2\n ip address 10.1.1.1 255.255.255.0\n negotiation auto\n!\ninterface GigabitEthernet3\n no ip address\n shutdown\n negotiation auto\n!\nrouter ospf 1\n redistribute connected subnets\n network 10.1.1.0 0.0.0.255 area 0\n!\n!\nvirtual-service csr_mgmt\n!\nip forward-protocol nd\n!\nno ip http server\nno ip http secure-server\n!\n!\n!\n!\n!\n!\ncontrol-plane\n!\n !\n !\n !\n !\n!\n!\n!\n!\n!\nline con 0\nline vty 0 4\n!\n!\nend", | ||
"running": "!\n\n!\nversion 15.5\nservice timestamps debug datetime msec\nservice timestamps log datetime msec\nno platform punt-keepalive disable-kernel-core\nplatform console auto\n!\nhostname CSR1\n!\nboot-start-marker\nboot-end-marker\n!\n!\nenable password cisco\n!\naaa new-model\n!\n!\naaa authentication login default local\naaa authorization exec default local\n!\n!\n!\n!\n!\naaa session-id common\n!\nip vrf MGMT\n!\n!\n!\n!\n!\n!\n!\n!\n!\n\n\nip domain name example.local\n\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\nsubscriber templating\n!\nmultilink bundle-name authenticated\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\nlicense udi pid CSR1000V sn 9OSEGKJXRHE\nspanning-tree extend system-id\n!\nusername cisco privilege 15 password 0 <removed>\n!\nredundancy\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\n!\ninterface Loopback0\n ip address 1.1.1.1 255.255.255.255\n!\ninterface GigabitEthernet1\n ip vrf forwarding MGMT\n ip address 192.168.35.121 255.255.255.0\n negotiation auto\n!\ninterface GigabitEthernet2\n ip address 10.1.1.1 255.255.255.0\n negotiation auto\n!\ninterface GigabitEthernet3\n no ip address\n shutdown\n negotiation auto\n!\nrouter ospf 1\n redistribute connected subnets\n network 10.1.1.0 0.0.0.255 area 0\n!\n!\nvirtual-service csr_mgmt\n!\nip forward-protocol nd\n!\nno ip http server\nno ip http secure-server\n!\n!\n!\n!\n!\n!\ncontrol-plane\n!\n !\n !\n !\n !\n!\n!\n!\n!\n!\nline con 0\nline vty 0 4\n!\n!\nend", | ||
"candidate": "" | ||
} |
Oops, something went wrong.