esptest.devices.switch module
- class esptest.devices.switch.SwitchConfig(ip: str, port: int, login_method: str = 'telnet', login_username: str = '', login_password: str = '', timeout: float = 10)[source]
Bases:
object- Parameters:
- class esptest.devices.switch.VlanInfo(id: int, interface_name: str = '', name: str = '', type: str = '', status: str = '', ip: str = '', mask: str = '', description: str = '', tagged_ports: str = '', untagged_ports: str = '')[source]
Bases:
object- Parameters:
- class esptest.devices.switch.PoolInfo(name: str, ip: str = '', mask: str = '', gateway: str = '', dns_list: str = '', vlan_id: int = 0)[source]
Bases:
object- classmethod parse_pool_info(output)[source]
Parse the
display ip pooloutput into aPoolInfo.Example input:
Pool name: 111 Network: 10.0.0.0 mask 255.255.254.0 dns-list 8.8.8.8 114.114.114.114 expired day 1 hour 0 minute 0 second 0 gateway-list 10.0.0.1 static bindings: ip-address 10.0.0.10 mask 255.255.254.0 hardware-address 1122-3344-aabb ethernet
- class esptest.devices.switch.InterfaceInfo(name: str, full_name: str = '', description: str = '', status: str = '', speed: str = '', duplex: str = '', link_mode: str = '', link_type: str = '', pvid: int = 0, permit_vlan: str = '')[source]
Bases:
object- Parameters:
- classmethod parse_interface_line(line)[source]
Interface Link Speed Duplex Type PVID Description
- Parameters:
line (str)
- Return type:
InterfaceInfo | None
- class esptest.devices.switch.ArpInfo(ip: str, mac: str, vlan_id: str, interface: str = '', type: str = '', pool_name: str = '')[source]
Bases:
object
- class esptest.devices.switch.StaticBindInfo(ip: str, mask: str, hardware_address: str, pool_name: str = '')[source]
Bases:
object
- class esptest.devices.switch.H3CSwitch(config, log_file='')[source]
Bases:
object- Parameters:
config (SwitchConfig)
log_file (str)
- disconnect()[source]
Disconnect from the switch, and save the configuration if needed.
- Return type:
None
- execute_command(command, timeout=-1)[source]
Execute a command on the switch and return the result.
- get_interface_info(detail=False)[source]
Get interface information from the switch.
- Parameters:
detail (bool)
- Return type: