Beispiel #1
0
def main(*args, **kwargs):

    # init manager instance
    mgr = manager(*args, **kwargs)

    # init working directory
    mgr.init_workingdir()

    # get projectinfo
    project_info = load_yaml('conf_tv.yaml')

    username = project_info['username']
    password = project_info['password']
    binary_urls = project_info['binary_urls']

    # get version from parameter
    # ex) 20160923.3
    # you can customize params from litmus (adhoc|run) -p option
    # Nth arg : kwargs['param'][N]
    try:
        version = kwargs['param'][0]
    except (IndexError, TypeError):
        version = None

    # download binaries from snapshot download server
    filenames = []
    for url in binary_urls:
        filenames.extend(
            downloader(url=url,
                       username=username,
                       password=password,
                       version=version))

    # get an available device for testing.
    dut = mgr.acquire_dut('xu3', max_retry_times=180)

    # flashing binaries to device.
    dut.flash(filenames)

    # turn on dut.
    dut.on()

    # run helper functions for testing.
    if not os.path.exists('result'):
        os.mkdir('result')

    testcases = load_yaml('tc_tv.yaml')
    add_test_helper(dut, testcases)
    dut.run_tests()

    # turn off dut.
    dut.off()

    # release a device
    mgr.release_dut(dut)
def main(*args, **kwargs):

    # init manager instance
    mgr = manager(*args, **kwargs)

    # init working directory
    mgr.init_workingdir()

    # get project info
    project_info = load_yaml('conf_mobile.yaml')
    binary_urls = project_info['binary_urls']
    plugin_info = project_info['plugin_info']
    flashing_binary = bool_env('FLASHING_BINARY',
                               project_info['flashing_binary'])
    installing_plugin = bool_env('INSTALLING_PLUGIN',
                                 project_info['installing_plugin'])
    snapshot_version = os.getenv('SNAPSHOT_VERSION', None)

    # acquire a device
    dut = mgr.acquire_dut('standalone_tm1', max_retry_times=180)
    dut._booting_time = 40

    if flashing_binary:
        # download binaries from snapshot download server
        filenames = []
        for url in binary_urls:
            filenames.extend(downloader(url=url, version=snapshot_version))
        # flashing binaries to device.
        dut.flash(filenames)

    if installing_plugin:
        # install plugins
        install_plugin_from_git(dut,
                                url=plugin_info['url'],
                                branch=plugin_info['branch'],
                                script=plugin_info['script'],
                                commitid=plugin_info['commitid'])

    # turn on dut.
    dut.on()

    # make result dir
    if not os.path.exists('result'):
        os.mkdir('result')

    # run helper functions for testing.
    testcases = load_yaml('tc_mobile.yaml')
    add_test_helper(dut, testcases)
    dut.run_tests()

    # turn off dut.
    dut.off()

    # release a device
    mgr.release_dut(dut)