コード例 #1
0
ファイル: emultest.py プロジェクト: kartikm/ostinato
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
コード例 #2
0
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
コード例 #3
0
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
コード例 #4
0
ファイル: pktlentest.py プロジェクト: kartikm/ostinato
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
コード例 #5
0
ファイル: rpctest.py プロジェクト: Nkj123/OstImprovement
        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
コード例 #6
0
ファイル: example_ping.py プロジェクト: jianhuayan/tools
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