Exemple #1
0
 def __init__(self, **kwargs):
     MarionetteTestOptions.__init__(self, **kwargs)
     group = self.add_option_group('gaiatest')
     group.add_option('--restart',
                      action='store_true',
                      dest='restart',
                      default=False,
                      help='restart target instance between tests')
     group.add_option('--yocto',
                      action='store_true',
                      dest='yocto',
                      default=False,
                      help='collect voltage and amperage during test runs (requires special hardware)')
     group.add_option('--html-output',
                      action='store',
                      dest='html_output',
                      help='html output',
                      metavar='path')
     group.add_option('--iterations',
                      action='store',
                      dest='iterations',
                      type='int',
                      metavar='int',
                      help='iterations for endurance tests')
     group.add_option('--checkpoint',
                      action='store',
                      dest='checkpoint_interval',
                      type='int',
                      metavar='int',
                      help='checkpoint interval for endurance tests')
Exemple #2
0
 def __init__(self, **kwargs):
     MarionetteTestOptions.__init__(self, **kwargs)
     group = self.add_option_group("gaiatest")
     group.add_option(
         "--restart",
         action="store_true",
         dest="restart",
         default=False,
         help="restart target instance between tests",
     )
     group.add_option(
         "--yocto",
         action="store_true",
         dest="yocto",
         default=False,
         help="collect voltage and amperage during test runs (requires special hardware)",
     )
     group.add_option("--html-output", action="store", dest="html_output", help="html output", metavar="path")
     group.add_option(
         "--iterations",
         action="store",
         dest="iterations",
         type="int",
         metavar="int",
         help="iterations for endurance tests",
     )
     group.add_option(
         "--checkpoint",
         action="store",
         dest="checkpoint_interval",
         type="int",
         metavar="int",
         help="checkpoint interval for endurance tests",
     )
Exemple #3
0
 def __init__(self, **kwargs):
     MarionetteTestOptions.__init__(self, **kwargs)
     group = self.add_option_group('gaiatest')
     group.add_option('--restart',
                      action='store_true',
                      dest='restart',
                      default=False,
                      help='restart target instance between tests')
     group.add_option('--html-output',
                      action='store',
                      dest='html_output',
                      help='html output',
                      metavar='path')
     group.add_option('--iterations',
                      action='store',
                      dest='iterations',
                      type='int',
                      metavar='int',
                      help='iterations for endurance tests')
     group.add_option('--checkpoint',
                      action='store',
                      dest='checkpoint_interval',
                      type='int',
                      metavar='int',
                      help='checkpoint interval for endurance tests')
Exemple #4
0
 def __init__(self, **kwargs):
     MarionetteTestOptions.__init__(self, **kwargs)
     group = self.add_option_group('gaiatest')
     group.add_option('--restart',
                      action='store_true',
                      dest='restart',
                      default=False,
                      help='restart target instance between tests')
     group.add_option('--html-output',
                      action='store',
                      dest='html_output',
                      help='html output',
                      metavar='path')
     group.add_option('--iterations',
                      action='store',
                      dest='iterations',
                      type='int',
                      metavar='int',
                      help='iterations for endurance tests')
     group.add_option('--checkpoint',
                      action='store',
                      dest='checkpoint_interval',
                      type='int',
                      metavar='int',
                      help='checkpoint interval for endurance tests')
Exemple #5
0
 def __init__(self, **kwargs):
     MarionetteTestOptions.__init__(self, **kwargs)
     group = self.add_option_group('gaiatest')
     group.add_option('--restart',
                      action='store_true',
                      dest='restart',
                      default=False,
                      help='restart target instance between tests')
     group.add_option(
         '--yocto',
         action='store_true',
         dest='yocto',
         default=False,
         help=
         'collect voltage and amperage during test runs (requires special hardware)'
     )
     group.add_option('--html-output',
                      action='store',
                      dest='html_output',
                      help='html output',
                      metavar='path')
     group.add_option('--iterations',
                      action='store',
                      dest='iterations',
                      type='int',
                      metavar='int',
                      help='iterations for endurance tests')
     group.add_option('--checkpoint',
                      action='store',
                      dest='checkpoint_interval',
                      type='int',
                      metavar='int',
                      help='checkpoint interval for endurance tests')
Exemple #6
0
 def __init__(self, **kwargs):
     MarionetteTestOptions.__init__(self, **kwargs)
     group = self.add_option_group('gaiatest')
     group.add_option('--restart',
                      action='store_true',
                      dest='restart',
                      default=False,
                      help='restart target instance between tests')
Exemple #7
0
 def __init__(self, **kwargs):
     MarionetteTestOptions.__init__(self, **kwargs)
     group = self.add_option_group('gaiatest')
     group.add_option('--restart',
                      action='store_true',
                      dest='restart',
                      default=False,
                      help='restart target instance between tests')
Exemple #8
0
    def verify_usage(self, options, tests):
        MarionetteTestOptions.verify_usage(self,options, tests)

        #options, tests = self.parse_args()

        if options.iterations is not None and options.iterations < 1:
            raise ValueError('iterations must be a positive integer')
        if options.checkpoint_interval is not None and options.checkpoint_interval < 1:
            raise ValueError('checkpoint interval must be a positive integer')
        if options.checkpoint_interval and not options.iterations:
            raise ValueError('you must specify iterations when using checkpoint intervals')
Exemple #9
0
    def verify_usage(self, options, tests):
        MarionetteTestOptions.verify_usage(self,options, tests)

        #options, tests = self.parse_args()

        if options.iterations is not None and options.iterations < 1:
            raise ValueError('iterations must be a positive integer')
        if options.checkpoint_interval is not None and options.checkpoint_interval < 1:
            raise ValueError('checkpoint interval must be a positive integer')
        if options.checkpoint_interval and not options.iterations:
            raise ValueError('you must specify iterations when using checkpoint intervals')
Exemple #10
0
    def verify_usage(self, options, tests):
        MarionetteTestOptions.verify_usage(self, options, tests)

        #options, tests = self.parse_args()

        if options.iterations is not None and options.iterations < 1:
            raise ValueError('iterations must be a positive integer')
        if options.checkpoint_interval is not None and options.checkpoint_interval < 1:
            raise ValueError('checkpoint interval must be a positive integer')
        if options.checkpoint_interval and not options.iterations:
            raise ValueError(
                'you must specify iterations when using checkpoint intervals')
        if options.yocto:
            # need to verify that the yocto ammeter is attached
            errmsg = YRefParam()
            if YAPI.RegisterHub("usb", errmsg) != YAPI.SUCCESS:
                raise RuntimeError(
                    'could not register yocto usb connection: %s' %
                    str(errmsg))

            # rescan for yocto devices
            if YAPI.UpdateDeviceList(errmsg) != YAPI.SUCCESS:
                raise RuntimeError('could not detect yoctopuce modules: %s' %
                                   str(errmsg))

            # check for ammeter
            ammeter = YCurrent.FirstCurrent()
            if ammeter is None:
                raise RuntimeError('could not find ammeter device')
            if ammeter.isOnline():
                module = ammeter.get_module()
                dc_ammeter = YCurrent.FindCurrent(module.get_serialNumber() +
                                                  '.current1')
                if (not module.isOnline()) or (dc_ammeter is None):
                    raise RuntimeError('could not get ammeter device')
            else:
                raise RuntimeError('could not find yocto ammeter device')

            # check for data logger
            data_logger = YDataLogger.FirstDataLogger()
            if data_logger is None:
                raise RuntimeError('could not find data logger device')
            if data_logger.isOnline():
                module = data_logger.get_module()
                data_logger = YDataLogger.FindDataLogger(
                    module.get_serialNumber() + '.dataLogger')
                if not module.isOnline() or data_logger is None:
                    raise RuntimeError('could not get data logger device')
            else:
                raise RuntimeError('could not find yocto ammeter device')
Exemple #11
0
    def parse_args(self, args=None, values=None):
        options, tests = MarionetteTestOptions.parse_args(self)

        if options.iterations is not None:
            if options.checkpoint_interval is None or options.checkpoint_interval > options.iterations:
                options.checkpoint_interval = options.iterations

        return options, tests
Exemple #12
0
    def parse_args(self, args=None, values=None):
        options, tests = MarionetteTestOptions.parse_args(self)

        if options.iterations is not None:
            if options.checkpoint_interval is None or options.checkpoint_interval > options.iterations:
                options.checkpoint_interval = options.iterations

        return options, tests
Exemple #13
0
    def verify_usage(self, options, tests):
        MarionetteTestOptions.verify_usage(self, options, tests)

        # options, tests = self.parse_args()

        if options.iterations is not None and options.iterations < 1:
            raise ValueError("iterations must be a positive integer")
        if options.checkpoint_interval is not None and options.checkpoint_interval < 1:
            raise ValueError("checkpoint interval must be a positive integer")
        if options.checkpoint_interval and not options.iterations:
            raise ValueError("you must specify iterations when using checkpoint intervals")
        if options.yocto:
            # need to verify that the yocto ammeter is attached
            errmsg = YRefParam()
            if YAPI.RegisterHub("usb", errmsg) != YAPI.SUCCESS:
                raise RuntimeError("could not register yocto usb connection: %s" % str(errmsg))

            # rescan for yocto devices
            if YAPI.UpdateDeviceList(errmsg) != YAPI.SUCCESS:
                raise RuntimeError("could not detect yoctopuce modules: %s" % str(errmsg))

            # check for ammeter
            ammeter = YCurrent.FirstCurrent()
            if ammeter is None:
                raise RuntimeError("could not find ammeter device")
            if ammeter.isOnline():
                module = ammeter.get_module()
                dc_ammeter = YCurrent.FindCurrent(module.get_serialNumber() + ".current1")
                if (not module.isOnline()) or (dc_ammeter is None):
                    raise RuntimeError("could not get ammeter device")
            else:
                raise RuntimeError("could not find yocto ammeter device")

            # check for data logger
            data_logger = YDataLogger.FirstDataLogger()
            if data_logger is None:
                raise RuntimeError("could not find data logger device")
            if data_logger.isOnline():
                module = data_logger.get_module()
                data_logger = YDataLogger.FindDataLogger(module.get_serialNumber() + ".dataLogger")
                if not module.isOnline() or data_logger is None:
                    raise RuntimeError("could not get data logger device")
            else:
                raise RuntimeError("could not find yocto ammeter device")