def main(): arg_dict = Argument.parseArgument('CLI unit test') cliTool = CliTool(arg_dict) cliTool.open() cliTool.sendCommand("vlan show") cliTool.close() cliTool.open() cliTool.sendCommand("port show") cliTool.close() cliTool.open() device = Device.Device(arg_dict) device.rebootAndReLogin(cliTool, 'reboot now') cliTool.sendCommand('int show') cliTool.close()
def main(): snmpTool = SnmpTool(Argument.parseArgument('SNMP unit test')) # getBulk result = snmpTool.snmpBulkWalk('1.3.6.1.4.1.6141.2.60.2.1.1.1.1.2') for key, value in result.items(): LOG.debug('%s = %s', key, value) # get result = snmpTool.snmpGet('1.3.6.1.2.1.1.1.0', '1.3.6.1.2.1.1.5.0', '1.3.6.1.4.1.6141.2.60.12.1.11.1.0', '1.3.6.1.4.1.6141.2.60.2.1.1.1.1.2.1') for key, value in result.items(): LOG.debug('%s = %s', key, value) # Get list oid_list = ['1.3.6.1.2.1.1.1.0', '1.3.6.1.2.1.1.5.0', '1.3.6.1.4.1.6141.2.60.12.1.11.1.0', '1.3.6.1.4.1.6141.2.60.2.1.1.1.1.2.1'] result = snmpTool.snmpGetList(oid_list) for key, value in result.items(): LOG.debug('%s = %s', key, value)