Пример #1
0
def main(argv):
  custom_handler = logging.StreamHandler(sys.stdout)
  custom_handler.setFormatter(run_tests_helper.CustomFormatter())
  logging.getLogger().addHandler(custom_handler)
  logging.getLogger().setLevel(logging.INFO)

  parser = optparse.OptionParser()
  parser.add_option('--skip-wipe', action='store_true', default=False,
                    help="Don't wipe device data during provisioning.")
  parser.add_option('--disable-location', action='store_true', default=False,
                    help="Disallow Google location services on devices.")
  parser.add_option('-d', '--device',
                    help='The serial number of the device to be provisioned')
  parser.add_option('-t', '--target', default='Debug', help='The build target')
  parser.add_option(
      '-r', '--auto-reconnect', action='store_true',
      help='Push binary which will reboot the device on adb disconnections.')
  options, args = parser.parse_args(argv[1:])
  constants.SetBuildType(options.target)

  if args:
    print >> sys.stderr, 'Unused args %s' % args
    return 1

  return ProvisionDevices(options)
Пример #2
0
def main():
    custom_handler = logging.StreamHandler(sys.stdout)
    custom_handler.setFormatter(run_tests_helper.CustomFormatter())
    logging.getLogger().addHandler(custom_handler)
    logging.getLogger().setLevel(logging.INFO)

    parser = optparse.OptionParser()
    parser.add_option('--device',
                      help='The serial number of the device. If not specified '
                      'will use all devices.')
    parser.add_option('--blacklist-file', help='Device blacklist JSON file.')
    parser.add_option(
        '-a',
        '--all-tombstones',
        action='store_true',
        help="""Resolve symbols for all tombstones, rather than just
                         the most recent""")
    parser.add_option('-s',
                      '--stack',
                      action='store_true',
                      help='Also include symbols for stack data')
    parser.add_option('-w',
                      '--wipe-tombstones',
                      action='store_true',
                      help='Erase all tombstones from device after processing')
    parser.add_option('-j',
                      '--jobs',
                      type='int',
                      default=4,
                      help='Number of jobs to use when processing multiple '
                      'crash stacks.')
    options, _ = parser.parse_args()

    if options.blacklist_file:
        blacklist = device_blacklist.Blacklist(options.blacklist_file)
    else:
        blacklist = None

    if options.device:
        devices = [device_utils.DeviceUtils(options.device)]
    else:
        devices = device_utils.DeviceUtils.HealthyDevices(blacklist)

    # This must be done serially because strptime can hit a race condition if
    # used for the first time in a multithreaded environment.
    # http://bugs.python.org/issue7980
    tombstones = []
    for device in devices:
        tombstones += _GetTombstonesForDevice(device, options)

    _ResolveTombstones(options.jobs, tombstones)
Пример #3
0
def main():
    custom_handler = logging.StreamHandler(sys.stdout)
    custom_handler.setFormatter(run_tests_helper.CustomFormatter())
    logging.getLogger().addHandler(custom_handler)
    logging.getLogger().setLevel(logging.INFO)

    # Recommended options on perf bots:
    # --disable-network
    #     TODO(tonyg): We eventually want network on. However, currently radios
    #     can cause perfbots to drain faster than they charge.
    # --min-battery-level 95
    #     Some perf bots run benchmarks with USB charging disabled which leads
    #     to gradual draining of the battery. We must wait for a full charge
    #     before starting a run in order to keep the devices online.

    parser = argparse.ArgumentParser(
        description='Provision Android devices with settings required for bots.'
    )
    parser.add_argument(
        '-d',
        '--device',
        metavar='SERIAL',
        help='the serial number of the device to be provisioned'
        ' (the default is to provision all devices attached)')
    parser.add_argument('--skip-wipe',
                        action='store_true',
                        default=False,
                        help="don't wipe device data during provisioning")
    parser.add_argument('--reboot-timeout',
                        metavar='SECS',
                        type=int,
                        help='when wiping the device, max number of seconds to'
                        ' wait after each reboot '
                        '(default: %s)' % _DEFAULT_TIMEOUTS.HELP_TEXT)
    parser.add_argument(
        '--min-battery-level',
        type=int,
        metavar='NUM',
        help='wait for the device to reach this minimum battery'
        ' level before trying to continue')
    parser.add_argument('--disable-location',
                        action='store_true',
                        help='disable Google location services on devices')
    parser.add_argument('--disable-network',
                        action='store_true',
                        help='disable network access on devices')
    parser.add_argument('--disable-java-debug',
                        action='store_false',
                        dest='enable_java_debug',
                        default=True,
                        help='disable Java property asserts and JNI checking')
    parser.add_argument('-t',
                        '--target',
                        default='Debug',
                        help='the build target (default: %(default)s)')
    parser.add_argument('-r',
                        '--auto-reconnect',
                        action='store_true',
                        help='push binary which will reboot the device on adb'
                        ' disconnections')
    parser.add_argument('--adb-key-files',
                        type=str,
                        nargs='+',
                        help='list of adb keys to push to device')
    args = parser.parse_args()
    constants.SetBuildType(args.target)

    return ProvisionDevices(args)
Пример #4
0
def main():
  custom_handler = logging.StreamHandler(sys.stdout)
  custom_handler.setFormatter(run_tests_helper.CustomFormatter())
  logging.getLogger().addHandler(custom_handler)
  logging.getLogger().setLevel(logging.INFO)

  # TODO(perezju): This script used to rely on the builder name to determine
  # the desired device configuration for perf bots. To safely phase this out,
  # we now:
  # - expose these configuration settings as command line options
  # - set default values for these options based on the builder name, thus
  #   matching the previous behaviour of the script on all bots.
  # - explicitly adding these options on the perf bots will also maintain the
  #   script behaviour, namely:
  #     --wait-for-battery --disable-network --disable-java-debug
  # - after all perf-bot recipes are updated, we can remove the following
  #   builder-name-sniffing code and replace |is_perf| with |False|.
  is_perf = 'perf' in os.environ.get('BUILDBOT_BUILDERNAME', '').lower()

  # Recommended options on perf bots:
  # --disable-network
  #     TODO(tonyg): We eventually want network on. However, currently radios
  #     can cause perfbots to drain faster than they charge.
  # --wait-for-battery
  #     Some perf bots run benchmarks with USB charging disabled which leads
  #     to gradual draining of the battery. We must wait for a full charge
  #     before starting a run in order to keep the devices online.

  parser = argparse.ArgumentParser(
      description='Provision Android devices with settings required for bots.')
  parser.add_argument('-d', '--device', metavar='SERIAL',
                      help='the serial number of the device to be provisioned'
                      ' (the default is to provision all devices attached)')
  parser.add_argument('--skip-wipe', action='store_true', default=False,
                      help="don't wipe device data during provisioning")
  parser.add_argument('--reboot-timeout', default=600, type=int,
                      metavar='SECS',
                      help='when wiping the device, max number of seconds to'
                      ' wait after each reboot (default: %(default)s)')
  parser.add_argument('--wait-for-battery', action='store_true',
                      default=is_perf,
                      help='wait for the battery on the devices to charge')
  parser.add_argument('--min-battery-level', default=95, type=int,
                      metavar='NUM',
                      help='when waiting for battery, minimum battery level'
                      ' required to continue (default: %(default)s)')
  parser.add_argument('--disable-location', action='store_true',
                      help='disable Google location services on devices')
  parser.add_argument('--disable-network', action='store_true',
                      default=is_perf,
                      help='disable network access on devices')
  parser.add_argument('--disable-java-debug', action='store_false',
                      dest='enable_java_debug', default=not is_perf,
                      help='disable Java property asserts and JNI checking')
  parser.add_argument('-t', '--target', default='Debug',
                      help='the build target (default: %(default)s)')
  parser.add_argument('-r', '--auto-reconnect', action='store_true',
                      help='push binary which will reboot the device on adb'
                      ' disconnections')
  args = parser.parse_args()
  constants.SetBuildType(args.target)

  return ProvisionDevices(args)