def drone(request): drn = DroneProxy(host_name) log.info('connecting to drone(%s:%d)' % (drn.hostName(), drn.portNumber())) drn.connect() def fin(): drn.disconnect() request.addfinalizer(fin) return drn
def drone(request): """Baseline Configuration for all testcases in this module""" dut = DroneProxy(host_name) log.info('connecting to drone(%s:%d)' % (dut.hostName(), dut.portNumber())) dut.connect() def fin(): dut.disconnect() request.addfinalizer(fin) return dut
drone.connect() passed = True except RpcError as e: raise finally: drone.disconnect() core.__version__ = orig_version suite.test_end(passed) # ----------------------------------------------------------------- # # Baseline Configuration for subsequent testcases # ----------------------------------------------------------------- # # connect to drone log.info('connecting to drone(%s:%d)' % (drone.hostName(), drone.portNumber())) drone.connect() # retreive port id list log.info('retreiving port list') port_id_list = drone.getPortIdList() # retreive port config list log.info('retreiving port config for all ports') port_config_list = drone.getPortConfig(port_id_list) if len(port_config_list.port) == 0: log.warning('drone has no ports!') sys.exit(1) # iterate port list to find a loopback port to use as the tx/rx port id
print('are expected to be received back on the Rx port') print('') print('An easy way to simulate the above topology is to select the loopback') print('port as both Tx and Rx ports') print('') if not use_defaults: s = raw_input('Drone\'s Hostname/IP [%s]: ' % (host_name)) host_name = s or host_name drone = DroneProxy(host_name) try: # connect to drone log.info('connecting to drone(%s:%d)' % (drone.hostName(), drone.portNumber())) drone.connect() # retreive port id list log.info('retreiving port list') port_id_list = drone.getPortIdList() # retreive port config list log.info('retreiving port config for all ports') port_config_list = drone.getPortConfig(port_id_list) if len(port_config_list.port) == 0: log.warning('drone has no ports!') sys.exit(1) # print port list and get tx/rx port id