Пример #1
0
def test_dual_lcd():
    resources = xmostest.request_resource("LCD_test_setup")

    xmostest.build('dual_lcd_testbench')

    print "\nRunning on A16 board with LCD slices connected to circle and square slots"
    print "\nPlease check LCD displays for fading Red, Green and Blue bars bounded by a white box"
    print "\nPress CTRL-c to quit\n"

    binary = 'dual_lcd_testbench/bin/dual_lcd_testbench.xe' 
    xmostest.run_on_xcore(resources['A16'], binary,
                              tester = None,
                              enable_xscope = False,
                              xscope_handler = None,
                              timeout = 600)
Пример #2
0
def test_single_lcd():
    resources = xmostest.request_resource("LCD_test_setup")

    xmostest.build('lcd_testbench')

    print "\nRunning on A16 board with LCD slice connected to circle slot"
    print "\nPlease check LCD display for fading Red, Green and Blue bars bounded by a white box"
    print "\nPress CTRL-c to quit\n"

    binary = 'lcd_testbench/bin/lcd_testbench.xe' 
    xmostest.run_on_xcore(resources['A16'], binary,
                              tester = None,
                              enable_xscope = False,
                              xscope_handler = None,
                              timeout = 600)
def do_dc_offset_removal_test(testlevel):

    # Check if the test is running in an environment with hardware resources
    # available - the test takes a long time to run in the simulator
    args = xmostest.getargs()
    if not args.remote_resourcer:
        # Abort the test
        print 'remote resourcer not avaliable'
        return

    binary = 'test_dc_offset_removal/bin/test_dc_offset_removal.xe'

    tester = xmostest.ComparisonTester(open('test_dc_offset_removal.expect'),
                                       'lib_mic_array',
                                       'lib_mic_array_backend_tests',
                                       'dc_offset_removal_test_%s'%testlevel)

    tester.set_min_testlevel(testlevel)

    resources = xmostest.request_resource("testrig_os_x_12",
                                          tester)

    run_job = xmostest.run_on_xcore(resources['uac2_xcore200_mc_analysis_device_1'],
                                    binary,
                                    tester=tester)

    xmostest.complete_all_jobs()
Пример #4
0
def do_dc_offset_removal_test(testlevel):

    # Check if the test is running in an environment with hardware resources
    # available - the test takes a long time to run in the simulator
    args = xmostest.getargs()
    if not args.remote_resourcer:
        # Abort the test
        print 'remote resourcer not avaliable'
        return

    binary = 'test_dc_offset_removal/bin/test_dc_offset_removal.xe'

    tester = xmostest.ComparisonTester(open('test_dc_offset_removal.expect'),
                                       'lib_mic_array',
                                       'lib_mic_array_backend_tests',
                                       'dc_offset_removal_test_%s' % testlevel)

    tester.set_min_testlevel(testlevel)

    resources = xmostest.request_resource("testrig_os_x_11", tester)

    run_job = xmostest.run_on_xcore(
        resources['uac2_xcore200_mc_analysis_device_1'], binary, tester=tester)

    xmostest.complete_all_jobs()
Пример #5
0
def do_backend_test(length, frame_count, testlevel):

    # Check if the test is running in an environment with hardware resources
    # available - the test takes a long time to run in the simulator
    args = xmostest.getargs()
    if not args.remote_resourcer:
        # Abort the test
        print 'remote resourcer not avaliable'
        return

    binary = 'test_fir_model/bin/COUNT{fc}_{len}/test_fir_model_COUNT{fc}_{len}.xe'.format(
        fc=frame_count, len=length)

    tester = xmostest.ComparisonTester(open('fir_model.expect'),
                                       'lib_mic_array',
                                       'lib_mic_array_backend_tests',
                                       'backend_test_%s' % testlevel, {
                                           'frame_count': frame_count,
                                           'length': length
                                       })

    tester.set_min_testlevel(testlevel)

    resources = xmostest.request_resource("uac2_xcore200_mc_testrig_os_x_11",
                                          tester)

    run_job = xmostest.run_on_xcore(resources['analysis_device_1'],
                                    binary,
                                    tester=tester,
                                    timeout=3600)

    xmostest.complete_all_jobs()
def do_backend_test(length, frame_count, testlevel):

    # Check if the test is running in an environment with hardware resources
    # available - the test takes a long time to run in the simulator
    args = xmostest.getargs()
    if not args.remote_resourcer:
        # Abort the test
        print 'remote resourcer not avaliable'
        return

    binary = 'test_fir_model/bin/COUNT{fc}_{len}/test_fir_model_COUNT{fc}_{len}.xe'.format(fc=frame_count, len=length)

    tester = xmostest.ComparisonTester(open('fir_model.expect'),
                                       'lib_mic_array',
                                       'lib_mic_array_backend_tests',
                                       'backend_test_%s'%testlevel,
                                       {'frame_count':frame_count, 'length':length})

    tester.set_min_testlevel(testlevel)

    resources = xmostest.request_resource("testrig_os_x_12",
                                          tester)

    run_job = xmostest.run_on_xcore(resources['uac2_xcore200_mc_analysis_device_1'],
                                    binary,
                                    tester=tester, timeout=3600)

    xmostest.complete_all_jobs()
Пример #7
0
def test(packets, delay, device, ip, remote_processes, connections, interface,
         protocol, library):
    setup = '{}_{}_{}_{}_{}'.format(remote_processes, connections, protocol,
                                    device, interface)
    binary = 'xtcp_bombard_{}/bin/{}/xtcp_bombard_{}_{}.xe'.format(
        library.lower(), setup, library.lower(), setup)

    tester = xmostest.CombinedTester(
        2,
        xTCPTester(remote_processes * connections, packets, protocol,
                   'lib_xtcp',
                   device.lower() + '_configuration_tests',
                   '{}_{}'.format(setup, library), {}))

    resources = xmostest.request_resource('xtcp_resources', tester)

    run_job = xmostest.run_on_xcore(resources[device.lower()],
                                    binary,
                                    tester=tester[0],
                                    enable_xscope=True,
                                    timeout=30)

    START_PORT = 15533

    server_job = xmostest.run_on_pc(resources['host'], [
        'python', 'xtcp_ping_pong.py', '--ip', '{}'.format(ip), '--start-port',
        '{}'.format(START_PORT), '--remote-processes',
        '{}'.format(remote_processes), '--remote-ports',
        '{}'.format(connections), '--protocol', '{}'.format(protocol),
        '--packets', '{}'.format(packets), '--delay-between-packets',
        '{}'.format(delay)
    ],
                                    timeout=60 * 2,
                                    tester=tester[1],
                                    initial_delay=20)
Пример #8
0
def test(device, ip, expected_response):
    binary = '../examples/app_simple_webserver/bin/app_simple_webserver.xe'

    tester = xmostest.CombinedTester(
        2,
        webTester(expected_response, ip, 'lib_xtcp',
                  device + '_configuration_tests', 'webserver', {}))

    resources = xmostest.request_resource('xtcp_resources', tester)

    if not resources[device]:
        # Abort the test
        print 'Resource \'{}\' not avaliable'.format(device)
        return

    if not resources['host']:
        # Abort the test
        print 'Resource \'host\' not avaliable'
        return

    run_job = xmostest.run_on_xcore(resources[device],
                                    binary,
                                    tester=tester[0],
                                    enable_xscope=True,
                                    timeout=30)

    server_job = xmostest.run_on_pc(resources['host'], [
        'python', 'xtcp_ping_pong.py', '--ip', '{}'.format(ip), '--start-port',
        '80', '--test', 'webserver'
    ],
                                    timeout=30,
                                    tester=tester[1],
                                    initial_delay=15)
Пример #9
0
def runtest():

    # Check if the test is running in an environment with hardware resources
    # i.e. if not running from usb audio view it will quit. lib_device_control
    # is in the usb audio view so it will build
    args = xmostest.getargs()
    if not args.remote_resourcer:
        # Abort the test
        print 'remote resourcer not avaliable'
        return

    device_app_name = 'usb_end_to_end_hardware/bin/usb_end_to_end_hardware.xe'.format(
    )
    #This path is relative from xmostest in the view used. goes up and back down to lib_device_control
    host_app_name = '../../../../lib_device_control/tests/usb_end_to_end_hardware_host/bin/usb_end_to_end_hardware_host.bin'

    # Setup the tester which will determine and record the result
    tester = xmostest.CombinedTester(
        2, device_control_endtoend_tester("usb", host_app_name,
                                          device_app_name))

    testlevel = 'smoke'
    tester.set_min_testlevel(testlevel)

    board = 'testrig_os_x_12'

    # Get the hardware resources to run the test on
    resources = None
    try:
        resources = xmostest.request_resource(board,
                                              tester,
                                              remote_resource_lease_time=30)
    except xmostest.XmosTestError:
        print "Unable to find required board %s required to run test" % board
        tester.shutdown()
        return

    env = ""

    # Start the xCORE DUT
    device_job = xmostest.run_on_xcore(resources['uac2_xcore200_mc_dut'],
                                       device_app_name,
                                       do_xe_prebuild=True,
                                       tester=tester[0],
                                       enable_xscope=True,
                                       xscope_handler=None,
                                       timeout=30,
                                       build_env=env)

    # Start the control app
    host_job = xmostest.run_on_pc(
        resources['host'], [host_app_name],
        tester=tester[1],
        timeout=30,
        initial_delay=10
    )  #Enough time for xtag to load firmware and host to enumerate device

    xmostest.complete_all_jobs()
def runtest():

    # Check if the test is running in an environment with hardware resources
    # i.e. if not running from usb audio view it will quit. lib_device_control
    # is in the usb audio view so it will build
    args = xmostest.getargs()
    if not args.remote_resourcer:
      # Abort the test
      print 'remote resourcer not avaliable'
      return

    device_app_name = 'usb_end_to_end_hardware/bin/usb_end_to_end_hardware.xe'.format()
    #This path is relative from xmostest in the view used. goes up and back down to lib_device_control
    host_app_name = '../../../../lib_device_control/tests/usb_end_to_end_hardware_host/bin/usb_end_to_end_hardware_host.bin'

    # Setup the tester which will determine and record the result
    tester = xmostest.CombinedTester(2, device_control_endtoend_tester("usb",
                                                       host_app_name, device_app_name))

    testlevel = 'smoke'
    tester.set_min_testlevel(testlevel)

    board = 'testrig_os_x_12'

    # Get the hardware resources to run the test on
    resources = None
    try:
        resources = xmostest.request_resource(board, tester, remote_resource_lease_time=30)
    except xmostest.XmosTestError:
        print "Unable to find required board %s required to run test" % board
        tester.shutdown()
        return

    env = ""

    # Start the xCORE DUT
    device_job = xmostest.run_on_xcore(resources['uac2_xcore200_mc_dut'], device_app_name,
                                        do_xe_prebuild = True,
                                        tester = tester[0],
                                        enable_xscope = True,
                                        xscope_handler = None,
                                        timeout = 30,
                                        build_env = env)

    # Start the control app
    host_job = xmostest.run_on_pc(resources['host'],
                                     [host_app_name],
                                     tester = tester[1],
                                     timeout = 30,
                                     initial_delay = 10) #Enough time for xtag to load firmware and host to enumerate device

    xmostest.complete_all_jobs()