コード例 #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
ファイル: 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
コード例 #3
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
コード例 #4
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
コード例 #5
0
ファイル: rpctest.py プロジェクト: Nkj123/OstImprovement
logging.basicConfig(level=logging.INFO)

print('')
print('This test uses the following topology -')
print('')
print(' +-------+           ')
print(' |       |Tx--->----+')
print(' | Drone |          |')
print(' |       |Rx---<----+')
print(' +-------+           ')
print('')
print('A loopback port is used as both the Tx and Rx ports')
print('')

suite = TestSuite()
drone = DroneProxy(host_name)

try:
    # ----------------------------------------------------------------- #
    # TESTCASE: Verify any RPC before checkVersion() fails and the server
    #           closes the connection
    # ----------------------------------------------------------------- #
    passed = False
    suite.test_begin('anyRpcBeforeCheckVersionFails')
    drone.channel.connect(drone.host, drone.port)
    try:
        port_id_list = drone.getPortIdList()
    except RpcError as e:
        if ('compatibility check pending' in str(e)):
            passed = True
        else:
コード例 #6
0
ファイル: rpctest.py プロジェクト: yedan2010/ostinato-1
logging.basicConfig(level=logging.INFO)

print('')
print('This test uses the following topology -')
print('')
print(' +-------+           ')
print(' |       |Tx--->----+')
print(' | Drone |          |')
print(' |       |Rx---<----+')
print(' +-------+           ')
print('')
print('A loopback port is used as both the Tx and Rx ports')
print('')

suite = TestSuite()
drone = DroneProxy(host_name)

try:
    # ----------------------------------------------------------------- #
    # TESTCASE: Verify any RPC before checkVersion() fails and the server
    #           closes the connection
    # ----------------------------------------------------------------- #
    passed = False
    suite.test_begin('anyRpcBeforeCheckVersionFails')
    drone.channel.connect(drone.host, drone.port)
    try:
        port_id_list = drone.getPortIdList()
    except RpcError as e:
        if ('compatibility check pending' in str(e)):
            passed = True
        else:
コード例 #7
0
ファイル: example_ping.py プロジェクト: jianhuayan/tools
print(' | Drone |          |  DUT  |')
print(' |       |Rx---<----|       |')
print(' +-------+          +-------+')
print('')
print('Drone has 2 ports connected to DUT. Packets sent on the Tx port')
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)