Add H3C device support with configuration and expected output files
- Introduced support for H3C devices by adding a new configuration file `config.conf` containing interface and VLAN settings. - Created an expected output JSON file `config.expected.json` to validate the parsing of H3C configurations. - Updated the test model cases to include H3C for comprehensive testing of device parsing functionality.
This commit is contained in:
@@ -14,11 +14,4 @@ class H3C(BaseDevice):
|
||||
vlans.append(item)
|
||||
continue
|
||||
vlans.extend({"vlan_id": vlan_id} for vlan_id in vlan_ids)
|
||||
return vlans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
with open("./test5.txt") as file:
|
||||
data = file.read()
|
||||
h3c = H3C(data)
|
||||
print(h3c.parse())
|
||||
return vlans
|
||||
@@ -26,13 +26,13 @@ Active-image: {{ ignore }} {{ _start_ }}
|
||||
<group name="interfaces">
|
||||
interface {{ interface | ORPHRASE }}
|
||||
ip address {{ ip_address }} {{ mask | to_cidr }}
|
||||
name {{ description }}
|
||||
description {{ description }}
|
||||
name {{ description | ORPHRASE}}
|
||||
description {{ description | ORPHRASE }}
|
||||
</group>
|
||||
|
||||
<group name="vlans">
|
||||
interface vlan {{ vlan_id | _start_ }}
|
||||
name {{ name }}
|
||||
name {{ name | ORPHRASE }}
|
||||
|
||||
vlan {{ _db_ | _start_ }}
|
||||
vlan {{ vlan_ids | joinmatches(',') | unrange("-", ",") | split(",")}}
|
||||
|
||||
@@ -21,6 +21,7 @@ default_system = {
|
||||
|
||||
<group name="interfaces">
|
||||
interface {{ interface }}
|
||||
description {{ description | ORPHRASE }}
|
||||
ip address {{ ip_address }} {{ mask | to_cidr }}
|
||||
</group>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ default_system = {
|
||||
|
||||
<group name="interfaces">
|
||||
interface {{ interface }}
|
||||
description {{ description }}
|
||||
description {{ description | ORPHRASE }}
|
||||
ip address {{ ip_address }} {{ mask | to_cidr }}
|
||||
</group>
|
||||
<group name="vlans">
|
||||
|
||||
Reference in New Issue
Block a user