コード例 #1
0
ファイル: runtests.py プロジェクト: Leanstuka/gaia
 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')
コード例 #2
0
ファイル: runtests.py プロジェクト: JDaniel1990/gaia
 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",
     )
コード例 #3
0
ファイル: runtests.py プロジェクト: starnight/gaia
 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')
コード例 #4
0
ファイル: runtests.py プロジェクト: Allan019/gaia
 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')
コード例 #5
0
ファイル: runtests.py プロジェクト: bjacob/gaia
 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')
コード例 #6
0
ファイル: runtests.py プロジェクト: vaidik/gaia-ui-tests
 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')
コード例 #7
0
ファイル: runtests.py プロジェクト: vaidik/gaia-ui-tests
 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')
コード例 #8
0
ファイル: runtests.py プロジェクト: Allan019/gaia
    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')
コード例 #9
0
ファイル: runtests.py プロジェクト: xuxiake2012/gaia
    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')
コード例 #10
0
ファイル: runtests.py プロジェクト: bjacob/gaia
    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')
コード例 #11
0
ファイル: runtests.py プロジェクト: JDaniel1990/gaia
    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
コード例 #12
0
ファイル: runtests.py プロジェクト: starnight/gaia
    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
コード例 #13
0
ファイル: runtests.py プロジェクト: JDaniel1990/gaia
    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")