forked from networktocode/netutils
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update adva parser to deplicate parent lines i.e. configure snmp
- Loading branch information
Showing
4 changed files
with
219 additions
and
0 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
38 changes: 38 additions & 0 deletions
38
tests/unit/mock/config/parser/base/adva_embedded_os/adva_full_received.py
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,38 @@ | ||
from netutils.config.parser import ConfigLine | ||
|
||
data = [ | ||
ConfigLine(config_line='configure snmp', parents=()), | ||
ConfigLine(config_line=' delete community "private"', parents=('configure snmp',)), | ||
ConfigLine(config_line=' delete community "public"', parents=('configure snmp',)), | ||
ConfigLine(config_line=' add community "secret" readwrite', parents=('configure snmp',)), | ||
ConfigLine(config_line=' add target-params "Params" snmpv2c snmpv2c "secret" no-auth', parents=('configure snmp',)), | ||
ConfigLine(config_line=' add target-address "target1" "10.0.0.2:161" ipv4 60 3 "info" "Params" enabled', parents=('configure snmp',)), | ||
ConfigLine(config_line=' configure target-address "target1" bulk-traps-control disabled', parents=('configure snmp',)), | ||
ConfigLine(config_line=' add target-address "target2" "10.0.0.5:161" ipv4 60 3 "info" "Params" enabled', parents=('configure snmp',)), | ||
ConfigLine(config_line=' configure target-address "target2" bulk-traps-control disabled', parents=('configure snmp',)), | ||
ConfigLine(config_line='network-element ne-1', parents=()), | ||
ConfigLine(config_line=' configure nte ntexg108-1-1-1', parents=('network-element ne-1',)), | ||
ConfigLine(config_line=' configure access-port access-1-1-1-3', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1')), | ||
ConfigLine(config_line=' admin-state unassigned', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' service-type evpl', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' alias "CUST-HANDOFF"', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' port-vlan-id 1-0', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' a2n-push-port-vid disabled', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' priority-mapping-profile prio_map_profile-1', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' cpd-filter 01-80-c2-00-00-00 pass-thru', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' cpd-filter 01-80-c2-00-00-01 pass-thru', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' cpd-filter 01-80-c2-00-00-02 pass-thru', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' cpd-filter 01-80-c2-00-00-03 pass-thru', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' cpd-filter 01-80-c2-00-00-04 pass-thru', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' cpd-filter 01-80-c2-00-00-05 pass-thru', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' cpd-filter 01-80-c2-00-00-06 pass-thru', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' cpd-filter 01-80-c2-00-00-07 pass-thru', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' cpd-filter 01-80-c2-00-00-08 pass-thru', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' cpd-filter 01-80-c2-00-00-09 pass-thru', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' cpd-filter 01-80-c2-00-00-0a pass-thru', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' cpd-filter 01-80-c2-00-00-0b pass-thru', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' cpd-filter 01-80-c2-00-00-0c pass-thru', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' cpd-filter 01-80-c2-00-00-0d pass-thru', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' cpd-filter 01-80-c2-00-00-0e pass-thru', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
ConfigLine(config_line=' cpd-filter 01-80-c2-00-00-0f pass-thru', parents=('network-element ne-1', ' configure nte ntexg108-1-1-1', ' configure access-port access-1-1-1-3')), | ||
] |
57 changes: 57 additions & 0 deletions
57
tests/unit/mock/config/parser/base/adva_embedded_os/adva_full_sent.txt
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,57 @@ | ||
home | ||
configure snmp | ||
delete community "private" | ||
|
||
home | ||
configure snmp | ||
delete community "public" | ||
|
||
home | ||
configure snmp | ||
add community "secret" readwrite | ||
|
||
home | ||
configure snmp | ||
add target-params "Params" snmpv2c snmpv2c "secret" no-auth | ||
|
||
home | ||
configure snmp | ||
add target-address "target1" "10.0.0.2:161" ipv4 60 3 "info" "Params" enabled | ||
configure target-address "target1" bulk-traps-control disabled | ||
|
||
home | ||
configure snmp | ||
add target-address "target2" "10.0.0.5:161" ipv4 60 3 "info" "Params" enabled | ||
configure target-address "target2" bulk-traps-control disabled | ||
|
||
home | ||
network-element ne-1 | ||
configure nte ntexg108-1-1-1 | ||
configure access-port access-1-1-1-3 | ||
admin-state unassigned | ||
service-type evpl | ||
alias "CUST-HANDOFF" | ||
port-vlan-id 1-0 | ||
a2n-push-port-vid disabled | ||
priority-mapping-profile prio_map_profile-1 | ||
|
||
home | ||
network-element ne-1 | ||
configure nte ntexg108-1-1-1 | ||
configure access-port access-1-1-1-3 | ||
cpd-filter 01-80-c2-00-00-00 pass-thru | ||
cpd-filter 01-80-c2-00-00-01 pass-thru | ||
cpd-filter 01-80-c2-00-00-02 pass-thru | ||
cpd-filter 01-80-c2-00-00-03 pass-thru | ||
cpd-filter 01-80-c2-00-00-04 pass-thru | ||
cpd-filter 01-80-c2-00-00-05 pass-thru | ||
cpd-filter 01-80-c2-00-00-06 pass-thru | ||
cpd-filter 01-80-c2-00-00-07 pass-thru | ||
cpd-filter 01-80-c2-00-00-08 pass-thru | ||
cpd-filter 01-80-c2-00-00-09 pass-thru | ||
cpd-filter 01-80-c2-00-00-0a pass-thru | ||
cpd-filter 01-80-c2-00-00-0b pass-thru | ||
cpd-filter 01-80-c2-00-00-0c pass-thru | ||
cpd-filter 01-80-c2-00-00-0d pass-thru | ||
cpd-filter 01-80-c2-00-00-0e pass-thru | ||
cpd-filter 01-80-c2-00-00-0f pass-thru |