Example #1
0
        test_name = '{:s} / {:s}'.format(writer.name, reader.name)

    results = run_tests(ctx, reader, writer, address)

    report = {}
    report[test_name] = results
    return report


if __name__ == '__main__':
    cmdline = ArgumentParser()
    cmdline.add_argument('--reader', default=None, help='Specific reader to test')
    cmdline.add_argument('--writer', default=None, help='Specific writier to test')
    args = cmdline.parse_args()

    ctx = create_depthcharge_ctx(args,
                                 da_pre_fn=_da_read_pre_func, da_pre_info=_da_read_pre_info)

    version_str = ctx.version()[0]

    # Save state prior to running tests as a courtesy. If we error out,
    # at least some initial info read from the device can bse saved.
    if args.config:
        ctx.save(args.config)

    address = ctx.env_var('loadaddr')

    t_start = time.time()
    if args.reader is not None or args.writer is not None:
        report = execute_specific_test(args, ctx, address)
    else:
        report = execute_all_tests(ctx, address)
Example #2
0
    return report


if __name__ == '__main__':
    cmdline = ArgumentParser()
    cmdline.add_argument('--reader',
                         default=None,
                         help='Specific reader to test')
    cmdline.add_argument('--writer',
                         default=None,
                         help='Specific writier to test')
    args = cmdline.parse_args()

    ctx = create_depthcharge_ctx(args,
                                 allow_deploy=True,
                                 allow_reboot=True,
                                 da_pre_fn=_da_read_pre_func,
                                 da_pre_info=_da_read_pre_info)

    version_str = ctx.version()[0]

    # Save state prior to running tests as a courtesy. If we error out,
    # at least some initial info read from the device can bse saved.
    if args.config:
        ctx.save(args.config)

    address = ctx.env_var('loadaddr')

    t_start = time.time()
    if args.reader is not None or args.writer is not None:
        report = execute_specific_test(args, ctx, address)
Example #3
0
        print(line.format(result[0], result[1], state))

    summary = os.linesep + '{:d} Tested, {:d} passed.' + os.linesep
    print(summary.format(total, n_pass))

    return n_pass == total


if __name__ == '__main__':
    success = False
    cmdline = ArgumentParser(allow_deploy_default=True,
                             allow_reboot_default=True,
                             arch_default=_DEFAULT_ARCH)

    args = cmdline.parse_args()
    ctx = create_depthcharge_ctx(args)

    if args.config:
        ctx.save(args.config)

    try:
        results = perform_reads(ctx)
        success = print_results(results)

    finally:
        if args.config:
            ctx.save(args.config)

    if not success:
        sys.exit(2)
Example #4
0

if __name__ == '__main__':

    args = handle_cmdline()

    # Use the console timeout parameter to increase the time between commands,
    # just so it's easier for folks watching this demo to see the commands
    # being used under the hood.
    #
    # You can remove the console_kwargs parameter if you just want things
    # to run as fast as possible
    #
    console_kwargs = {'timeout': 0.085}

    ctx = create_depthcharge_ctx(args, console_kwargs=console_kwargs)

    success = perform_unlock_bypass(ctx)
    if success:
        if args.inspect:
            cfg_name = 'symfonsik_rev0.2_unlock_bypassed.cfg'

            msg = ('Addtional device inspection will begin in 5 seconds.\n'
                   '     This will induce a crash and then re-bypass the unlock.\n'
                   '     Results will be saved to: ' + cfg_name)
            log.info(msg)

            # Give the user a moment to digest this
            countdown = ctx.create_progress_indicator('countdown', 5, desc='Delaying')
            for _ in range(0, 5):
                time.sleep(1)