• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python moznetwork.get_ip函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中moznetwork.get_ip函数的典型用法代码示例。如果您正苦于以下问题:Python get_ip函数的具体用法?Python get_ip怎么用?Python get_ip使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_ip函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: updateApp

    def updateApp(self, appBundlePath, processName=None, destPath=None,
                  ipAddr=None, port=30000, wait=False):
        # port ^^^ is here for backwards compatibility only, we now
        # determine a port automatically and safely
        wait = (wait or ipAddr)

        cmd = 'updt '
        if processName is None:
            # Then we pass '' for processName
            cmd += "'' " + appBundlePath
        else:
            cmd += processName + ' ' + appBundlePath

        if destPath:
            cmd += " " + destPath

        if wait:
            if not ipAddr:
                ipAddr = moznetwork.get_ip()
            serverSocket = self._getRebootServerSocket(ipAddr)
            cmd += " %s %s" % serverSocket.getsockname()

        self._logger.debug("updateApp using command: " % cmd)

        self._runCmds([{'cmd': cmd}])

        if wait:
            self._waitForRebootPing(serverSocket)
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:28,代码来源:devicemanagerSUT.py


示例2: setup_hosts

    def setup_hosts(self):
        hostnames = ["web-platform.test",
                     "www.web-platform.test",
                     "www1.web-platform.test",
                     "www2.web-platform.test",
                     "xn--n8j6ds53lwwkrqhv28a.web-platform.test",
                     "xn--lve-6lad.web-platform.test"]

        host_ip = moznetwork.get_ip()

        temp_dir = tempfile.mkdtemp()
        hosts_path = os.path.join(temp_dir, "hosts")
        remote_path = "/system/etc/hosts"
        try:
            self.device.getFile("/system/etc/hosts", hosts_path)

            with open(hosts_path) as f:
                hosts_file = HostsFile.from_file(f)

            for canonical_hostname in hostnames:
                hosts_file.set_host(HostsLine(host_ip, canonical_hostname))

            with open(hosts_path, "w") as f:
                hosts_file.to_file(f)

            self.logger.info("Installing hosts file")

            self.device.remount()
            self.device.removeFile(remote_path)
            self.device.pushFile(hosts_path, remote_path)
        finally:
            os.unlink(hosts_path)
            os.rmdir(temp_dir)
开发者ID:html-shell,项目名称:mozbuild,代码行数:33,代码来源:b2g.py


示例3: check_server

def check_server(device):
    logger.info("Checking access to host machine")

    if _adbflag:
        return True

    routes = [("GET", "/", test_handler)]

    host_ip = moznetwork.get_ip()

    for port in [8000, 8001]:
        try:
            server = wptserve.WebTestHttpd(host=host_ip, port=port, routes=routes)
            server.start()
        except:
            logger.critical("Error starting local server on port %s:\n%s" %
                            (port, traceback.format_exc()))
            return False

        try:
            device.shell_output("curl http://%s:%i" % (host_ip, port))
        except mozdevice.ADBError as e:
            if 'curl: not found' in e.message:
                logger.warning("Could not check access to host machine: curl not present.")
                logger.warning("If timeouts occur, check your network configuration.")
                break
            logger.critical("Failed to connect to server running on host machine ip %s port %i. Check network configuration." % (host_ip, port))
            return False
        finally:
            logger.debug("Stopping server")
            server.stop()

    return True
开发者ID:JJTC-PX,项目名称:fxos-certsuite,代码行数:33,代码来源:harness.py


示例4: reboot

    def reboot(self, ipAddr=None, port=30000, wait=False):
        # port ^^^ is here for backwards compatibility only, we now
        # determine a port automatically and safely
        wait = (wait or ipAddr)

        cmd = 'rebt'

        self._logger.info("Rebooting device")

        # if we're waiting, create a listening server and pass information on
        # it to the device before rebooting (we do this instead of just polling
        # to make sure the device actually rebooted -- yes, there are probably
        # simpler ways of doing this like polling uptime, but this is what we're
        # doing for now)
        if wait:
            if not ipAddr:
                ipAddr = moznetwork.get_ip()
            serverSocket = self._getRebootServerSocket(ipAddr)
            # The update.info command tells the SUTAgent to send a TCP message
            # after restarting.
            destname = '/data/data/com.mozilla.SUTAgentAndroid/files/update.info'
            data = "%s,%s\rrebooting\r" % serverSocket.getsockname()
            self._runCmds([{'cmd': 'push %s %s' % (destname, len(data)),
                            'data': data}])
            cmd += " %s %s" % serverSocket.getsockname()

        # actually reboot device
        self._runCmds([{'cmd': cmd}])
        # if we're waiting, wait for a callback ping from the agent before
        # continuing (and throw an exception if we don't receive said ping)
        if wait:
            self._waitForRebootPing(serverSocket)
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:32,代码来源:devicemanagerSUT.py


示例5: DroidConnectByHWID

def DroidConnectByHWID(hwid, timeout=30, **kwargs):
    """Try to connect to the given device by waiting for it to show up using mDNS with the given timeout."""
    zc = Zeroconf(moznetwork.get_ip())

    evt = threading.Event()
    listener = ZeroconfListener(hwid, evt)
    sb = ServiceBrowser(zc, "_sutagent._tcp.local.", listener)
    foundIP = None
    if evt.wait(timeout):
        # we found the hwid
        foundIP = listener.ip
    sb.cancel()
    zc.close()

    if foundIP is not None:
        return DroidSUT(foundIP, **kwargs)
    print "Connected via SUT to %s [at %s]" % (hwid, foundIP)

    # try connecting via adb
    try:
        sut = DroidADB(deviceSerial=hwid, **kwargs)
    except:
        return None

    print "Connected via ADB to %s" % (hwid)
    return sut
开发者ID:kleopatra999,项目名称:system-addons,代码行数:26,代码来源:droid.py


示例6: get_ip

 def get_ip(self):
     import moznetwork
     if os.name != "nt":
         return moznetwork.get_ip()
     else:
         self.error(
             "ERROR: you must specify a --remote-webserver=<ip address>\n")
开发者ID:kitcambridge,项目名称:gecko-dev,代码行数:7,代码来源:reftestcommandline.py


示例7: verifyRemoteOptions

    def verifyRemoteOptions(self, options):
        if options.remoteWebServer == None:
            if os.name != "nt":
                options.remoteWebServer = moznetwork.get_ip()
            else:
                self.error("You must specify a --remote-webserver=<ip address>")
        options.webServer = options.remoteWebServer

        if options.geckoPath and not options.emulator:
            self.error("You must specify --emulator if you specify --gecko-path")

        if options.logcat_dir and not options.emulator:
            self.error("You must specify --emulator if you specify --logcat-dir")

        if not os.path.isdir(options.xrePath):
            self.error("--xre-path '%s' is not a directory" % options.xrePath)
        xpcshell = os.path.join(options.xrePath, 'xpcshell')
        if not os.access(xpcshell, os.F_OK):
            self.error('xpcshell not found at %s' % xpcshell)
        if self.elf_arm(xpcshell):
            self.error('--xre-path points to an ARM version of xpcshell; it '
                       'should instead point to a version that can run on '
                       'your desktop')

        if options.pidFile != "":
            f = open(options.pidFile, 'w')
            f.write("%s" % os.getpid())
            f.close()

        return options
开发者ID:drexler,项目名称:releases-mozilla-aurora,代码行数:30,代码来源:mochitest_options.py


示例8: synchronizeTime

    def synchronizeTime(self):
        self._logger.info("Synchronizing time...")
        ntpdate_wait_time = 5
        ntpdate_retries = 5
        num_retries = 0
        synced_time = False
        while not synced_time:
            try:
                self.shellCheckOutput([self.DEFAULT_NTPDATE_LOCATION, "-c", "1", "-d",
                                       "-h", moznetwork.get_ip(), "-s"], root=True,
                                      timeout=ntpdate_wait_time)
                synced_time = True
            except mozdevice.DMError:
                # HACK: we need to force a reconnection here on SUT (until bug
                # 1009862 is fixed and lands in a released version of
                # mozdevice)
                self._sock = None
                if num_retries == ntpdate_retries:
                    raise Exception("Exceeded maximum number of retries "
                                    "synchronizing time!")

                # FIXME: as of this writing mozdevice doesn't distinguishing
                # between timeouts and other errors (bug 1010328), so we're
                # just gonna assume timeout
                num_retries+=1
                self._logger.info("Attempt to synchronize time failed, "
                                  "retrying (try %s/%s)..." % (num_retries,
                                                               ntpdate_retries))
        self._logger.info("Time synchronized!")
开发者ID:retornam,项目名称:eideticker,代码行数:29,代码来源:device.py


示例9: create_httpd

 def create_httpd(self, need_external_ip):
     host = "127.0.0.1"
     if need_external_ip:
         host = moznetwork.get_ip()
     root = self.server_root or os.path.join(os.path.dirname(here), "www")
     rv = httpd.FixtureServer(root, host=host)
     rv.start()
     return rv
开发者ID:emilio,项目名称:gecko-dev,代码行数:8,代码来源:base.py


示例10: validate

    def validate(self, parser, options, context):
        """Validate b2g options."""

        if options.remoteWebServer is None:
            if os.name != "nt":
                options.remoteWebServer = moznetwork.get_ip()
            else:
                parser.error(
                    "You must specify a --remote-webserver=<ip address>")
        options.webServer = options.remoteWebServer

        if not options.b2gPath and hasattr(context, 'b2g_home'):
            options.b2gPath = context.b2g_home

        if hasattr(context, 'device_name') and not options.emulator:
            if context.device_name.startswith('emulator'):
                options.emulator = 'x86' if 'x86' in context.device_name else 'arm'

        if options.geckoPath and not options.emulator:
            parser.error(
                "You must specify --emulator if you specify --gecko-path")

        if options.logdir and not options.emulator:
            parser.error("You must specify --emulator if you specify --logdir")
        elif not options.logdir and options.emulator and build_obj:
            options.logdir = os.path.join(
                build_obj.topobjdir, '_tests', 'testing', 'mochitest')

        if hasattr(context, 'xre_path'):
            options.xrePath = context.xre_path

        if not os.path.isdir(options.xrePath):
            parser.error("--xre-path '%s' is not a directory" % options.xrePath)

        xpcshell = os.path.join(options.xrePath, 'xpcshell')
        if not os.access(xpcshell, os.F_OK):
            parser.error('xpcshell not found at %s' % xpcshell)

        if self.elf_arm(xpcshell):
            parser.error('--xre-path points to an ARM version of xpcshell; it '
                         'should instead point to a version that can run on '
                         'your desktop')

        if not options.httpdPath and build_obj:
            options.httpdPath = os.path.join(
                build_obj.topobjdir, '_tests', 'testing', 'mochitest')

        # Bug 1071866 - B2G Mochitests do not always produce a leak log.
        options.ignoreMissingLeaks.append("default")
        # Bug 1070068 - Leak logging does not work for tab processes on B2G.
        options.ignoreMissingLeaks.append("tab")

        if options.pidFile != "":
            f = open(options.pidFile, 'w')
            f.write("%s" % os.getpid())
            f.close()

        return options
开发者ID:brendandahl,项目名称:positron,代码行数:58,代码来源:mochitest_options.py


示例11: test_get_ip_using_get_interface

def test_get_ip_using_get_interface(ip_addresses):
    """ Test that the control flow path for get_ip() using
    _get_interface_list() is works """

    if mozinfo.isLinux or mozinfo.isMac:

        with mock.patch('socket.gethostbyname') as byname:
            # Force socket.gethostbyname to return None
            byname.return_value = None
            assert moznetwork.get_ip() in ip_addresses
开发者ID:luke-chang,项目名称:gecko-1,代码行数:10,代码来源:test.py


示例12: run_capture

def run_capture(options, capture_file):
    device_prefs = eideticker.getDevicePrefs(options)

    capture_server = CaptureServer(capture_file, options.capture_device,
                                   options.mode,
                                   no_capture=options.no_capture)
    host = moznetwork.get_ip()
    docroot = eideticker.runtest.TEST_DIR
    httpd = mozhttpd.MozHttpd(port=0, host=host, docroot=docroot, urlhandlers=[
        {'method': 'GET',
         'path': '/api/captures/start/?',
         'function': capture_server.start_capture},
        {'method': 'GET',
         'path': '/api/captures/end/?',
         'function': capture_server.end_capture}])
    httpd.start(block=False)
    print "Serving '%s' at %s:%s" % (
        httpd.docroot, httpd.host, httpd.httpd.server_port)

    device = eideticker.getDevice(**device_prefs)
    mode = options.mode
    if not mode:
        mode = device.hdmiResolution

    url = "http://%s:%s/getdimensions.html" % (host, httpd.httpd.server_port)

    device.executeCommand("tap", [100, 100])
    if device_prefs['devicetype'] == 'android':
        device.launchFennec(options.appname, url=url)
    else:
        if not options.wifi_settings_file:
            print "WIFI settings file (see --help) required for B2G!"
            sys.exit(1)
        device.restartB2G()
        device.connectWIFI(json.loads(open(options.wifi_settings_file).read()))
        session = device.marionette.session
        if 'b2g' not in session:
            raise Exception("bad session value %s returned by start_session" %
                            session)

        device.unlock()
        # wait for device to become ready (yes, this is terrible, can we
        # detect this condition in marionette somehow?)
        time.sleep(5)
        device.marionette.execute_script("window.location.href='%s';" % url)

    while not capture_server.finished:
        time.sleep(0.25)

    capture_server.convert_capture()

    device.killProcess(options.appname)
    httpd.stop()
开发者ID:William-Hsu,项目名称:eideticker,代码行数:53,代码来源:getdimensions.py


示例13: write_hosts_file

def write_hosts_file(config, device):
    new_hosts = make_hosts_file(config, moznetwork.get_ip())
    current_hosts = device.get_file("/etc/hosts")
    if new_hosts == current_hosts:
        return
    hosts_fd, hosts_path = tempfile.mkstemp()
    try:
        with os.fdopen(hosts_fd, "w") as f:
            f.write(new_hosts)
        device.remount()
        device.push(hosts_path, "/etc/hosts")
    finally:
        os.remove(hosts_path)
开发者ID:mnot,项目名称:web-platform-tests,代码行数:13,代码来源:fennec.py


示例14: __init__

    def __init__(self, testinfo, options, device, capture_controller, use_actions=True):
        Test.__init__(self, testinfo, options, device, capture_controller,
                      track_start_frame=True, track_end_frame=True)

        # get actions for web tests
        actions_path = os.path.join(testinfo['here'], "actions.json")
        if use_actions:
            if os.path.exists(actions_path):
                self.actions = json.loads(open(actions_path).read())
            else:
                raise TestException("Test needs actions but no actions file '%s'" %
                                    actions_path)
        else:
            self.actions = None

        self.capture_server = CaptureServer(self)
        self.host = moznetwork.get_ip()
        self.http = mozhttpd.MozHttpd(
            docroot=TEST_DIR, host=self.host, port=0, log_requests=True,
            urlhandlers=[
                {'method': 'GET',
                 'path': '/api/captures/start/?',
                 'function': self.capture_server.start_capture},
                {'method': 'GET',
                 'path': '/api/captures/end/?',
                 'function': self.capture_server.end_capture},
                {'method': 'POST',
                 'path': '/api/captures/input/?',
                 'function': self.capture_server.input}])
        self.http.start(block=False)

        connected = False
        tries = 0
        while not connected and tries < 20:
            tries += 1
            import socket
            s = socket.socket()
            try:
                s.connect((self.host, self.http.httpd.server_port))
                connected = True
            except Exception:
                self.logger.info("Can't connect to %s:%s, retrying..." %
                                 (self.host, self.http.httpd.server_port))

        self.logger.info("Test URL is: %s" % self.url)

        if not connected:
            raise "Could not open webserver. Error!"
开发者ID:wlach,项目名称:eideticker,代码行数:48,代码来源:test.py


示例15: setup_hosts

    def setup_hosts(self):
        hosts = ["web-platform.test",
                 "www.web-platform.test",
                 "www1.web-platform.test",
                 "www2.web-platform.test",
                 "xn--n8j6ds53lwwkrqhv28a.web-platform.test",
                 "xn--lve-6lad.web-platform.test"]

        host_ip = moznetwork.get_ip()

        temp_dir = tempfile.mkdtemp()
        hosts_path = os.path.join(temp_dir, "hosts")
        remote_path = "/system/etc/hosts"
        try:
            self.device.getFile("/system/etc/hosts", hosts_path)

            with open(hosts_path, "a+") as f:
                hosts_present = set()
                for line in f:
                    line = line.strip()
                    if not line:
                        continue
                    ip, host = line.split()
                    hosts_present.add(host)

                    if host in hosts and ip != host_ip:
                        raise Exception("Existing hosts file has an ip for %s" % host)

                f.seek(f.tell() - 1)
                if f.read() != "\n":
                    f.write("\n")

                for host in hosts:
                    f.write("%s%s%s\n" % (host_ip, " " * (28 - len(host_ip)), host))

            self.logger.info("Installing hosts file")

            self.device.remount()
            self.device.removeFile(remote_path)
            self.device.pushFile(hosts_path, remote_path)
        finally:
            os.unlink(hosts_path)
            os.rmdir(temp_dir)
开发者ID:kleopatra999,项目名称:wptrunner,代码行数:43,代码来源:b2g.py


示例16: __init__

    def __init__(self, testinfo, actions={}, docroot=None, request_log_file=None,
                 **kwargs):
        super(WebTest, self).__init__(testinfo, track_start_frame = True,
                                      track_end_frame = True, **kwargs)

        self.actions = actions
        self.request_log_file = request_log_file

        self.capture_server = CaptureServer(self)
        self.host = moznetwork.get_ip()
        self.http = mozhttpd.MozHttpd(docroot=docroot,
                                      host=self.host, port=0,
                                      log_requests=bool(request_log_file),
                                      urlhandlers = [
                { 'method': 'GET',
                  'path': '/api/captures/start/?',
                  'function': self.capture_server.start_capture },
                { 'method': 'GET',
                  'path': '/api/captures/end/?',
                  'function': self.capture_server.end_capture },
                { 'method': 'POST',
                  'path': '/api/captures/input/?',
                  'function': self.capture_server.input } ])
        self.http.start(block=False)

        connected = False
        tries = 0
        while not connected and tries < 20:
            tries+=1
            import socket
            s = socket.socket()
            try:
                s.connect((self.host, self.http.httpd.server_port))
                connected = True
            except Exception:
                self.log("Can't connect to %s:%s, retrying..." % (
                        self.host, self.http.httpd.server_port))

        self.log("Test URL is: %s" % self.url)

        if not connected:
            raise "Could not open webserver. Error!"
开发者ID:froydnj,项目名称:eideticker,代码行数:42,代码来源:test.py


示例17: run_capture

def run_capture(options, capture_filename):
    device_prefs = eideticker.getDevicePrefs(options)

    capture_server = CaptureServer(capture_filename, options)
    host = moznetwork.get_ip()
    docroot = eideticker.test.TEST_DIR
    httpd = mozhttpd.MozHttpd(port=0, host=host, docroot=docroot, urlhandlers=[
        {'method': 'GET',
         'path': '/api/captures/start/?',
         'function': capture_server.start_capture},
        {'method': 'GET',
         'path': '/api/captures/end/?',
         'function': capture_server.end_capture}])
    httpd.start(block=False)
    print "Serving '%s' at %s:%s" % (
        httpd.docroot, httpd.host, httpd.httpd.server_port)

    device = eideticker.getDevice(**device_prefs)

    url = "http://%s:%s/getdimensions.html" % (host, httpd.httpd.server_port)

    device.executeCommand("tap", [100, 100])
    if device_prefs['devicetype'] == 'android':
        device.launchFennec(options.appname, url=url)
    else:
        if not options.wifi_settings_file:
            print "WIFI settings file (see --help) required for B2G!"
            sys.exit(1)
        device.restartB2G()
        device.connectWIFI(json.loads(open(options.wifi_settings_file).read()))

        device.marionette.execute_script("window.location.href='%s';" % url)

    while not capture_server.finished:
        time.sleep(0.25)

    capture_server.convert_capture()

    httpd.stop()
开发者ID:davehunt,项目名称:eideticker,代码行数:39,代码来源:getdimensions.py


示例18: cli

def cli(args):
    global results

    tests_ran = False

    parser = argparse.ArgumentParser()
    parser.add_argument('--firefox-path', help='path to firefox binary',
                        default=None)
    parser.add_argument('--use-b2g', action='store_true',
                        help='Use marionette to run tests on firefox os')
    parser.add_argument('--run-android-browser', action='store_true',
                        help='Run benchmarks on stock Android browser')
    parser.add_argument('--run-dolphin', action='store_true',
                        help='Run benchmarks on Dolphin browser')
    parser.add_argument('--chrome-path', help='path to chrome executable',
                        default=None)
    parser.add_argument('--post-results', action='store_true',
                        help='if specified, post results to datazilla')
    parser.add_argument('--device-serial',
                        help='serial number of the android or b2g device',
                        default=None)
    parser.add_argument('--run-benchmarks',
                        help='specify which benchmarks to run')
    parser.add_argument('--smoketest', action='store_true',
                        help='only run smoketest')
    parser.add_argument('--json-result', help='store pure json result to file',
                        default=None)
    parser.add_argument('--test-host',
                        help='network interface on which to listen and serve',
                        default=moznetwork.get_ip())
    parser.add_argument('--test-port',
                        help='port to host http server',
                        default=None)
    commandline.add_logging_group(parser)
    args = parser.parse_args(args)

    logging.basicConfig()
    logger = commandline.setup_logging('mozbench', vars(args), {})

    if not args.use_b2g and not args.firefox_path:
        logger.error('you must specify one of --use-b2g or ' +
                     '--firefox-path')
        return 1

    if args.firefox_path:
        use_android = args.firefox_path.endswith('.apk')
    else:
        use_android = False

    if use_android:
        logger.info('prepare for installing fennec')
        fennec_pkg_name = get_fennec_pkg_name(args.firefox_path)
        success = install_fennec(logger, args.firefox_path, fennec_pkg_name,
                                 args.device_serial)
        if not success:
            logger.error('fennec installation fail')
            return 1
        logger.info('fennec installation succeed')
    else:
        if args.run_android_browser:
            logger.warning('stock Android browser only supported on Android')
        if args.run_dolphin:
            logger.warning('dolphin browser only supported on Android')

    logger.info('starting webserver on %s' % args.test_host)

    routes = [('POST', '/results', results_handler),
              ('GET', '/*', wptserve.handlers.file_handler)]

    static_path = os.path.abspath(os.path.join(os.path.dirname(__file__),
                                               'static'))
    # start http server and request handler
    httpd = None
    if args.test_port:
        try:
            port = int(args.test_port)
            httpd = wptserve.server.WebTestHttpd(host=args.test_host, port=port,
                                                 routes=routes, doc_root=static_path)
        except Exception as e:
            logger.error(e.message)
            return 1
    else:
        while httpd is None:
            try:
                port = 10000 + random.randrange(0, 50000)
                httpd = wptserve.server.WebTestHttpd(host=args.test_host, port=port,
                                                     routes=routes, doc_root=static_path)
            # pass if port number has been used, then try another one
            except socket.error as e:
                    pass
            except Exception as e:
                logger.error(e.message)
                return 1

    httpd.start()
    httpd_logger = logging.getLogger("wptserve")
    httpd_logger.setLevel(logging.ERROR)

    logger.info('starting webserver on %s:%s' %(httpd.host, str(httpd.port)))

#.........这里部分代码省略.........
开发者ID:padenot,项目名称:mozbench,代码行数:101,代码来源:mozbench.py


示例19: __init__

    def __init__(self, automation):
        ReftestOptions.__init__(self)
        self.automation = automation

        defaults = {}
        defaults["logFile"] = "reftest.log"
        # app, xrePath and utilityPath variables are set in main function
        defaults["app"] = ""
        defaults["xrePath"] = ""
        defaults["utilityPath"] = ""
        defaults["runTestsInParallel"] = False

        self.add_option(
            "--remote-app-path",
            action="store",
            type="string",
            dest="remoteAppPath",
            help="Path to remote executable relative to device root using only forward slashes.  Either this or app must be specified, but not both.",
        )
        defaults["remoteAppPath"] = None

        self.add_option(
            "--deviceIP", action="store", type="string", dest="deviceIP", help="ip address of remote device to test"
        )
        defaults["deviceIP"] = None

        self.add_option(
            "--deviceSerial",
            action="store",
            type="string",
            dest="deviceSerial",
            help="adb serial number of remote device to test",
        )
        defaults["deviceSerial"] = None

        self.add_option(
            "--devicePort", action="store", type="string", dest="devicePort", help="port of remote device to test"
        )
        defaults["devicePort"] = 20701

        self.add_option(
            "--remote-product-name",
            action="store",
            type="string",
            dest="remoteProductName",
            help="Name of product to test - either fennec or firefox, defaults to fennec",
        )
        defaults["remoteProductName"] = "fennec"

        self.add_option(
            "--remote-webserver",
            action="store",
            type="string",
            dest="remoteWebServer",
            help="IP Address of the webserver hosting the reftest content",
        )
        defaults["remoteWebServer"] = moznetwork.get_ip()

        self.add_option(
            "--http-port",
            action="store",
            type="string",
            dest="httpPort",
            help="port of the web server for http traffic",
        )
        defaults["httpPort"] = automation.DEFAULT_HTTP_PORT

        self.add_option(
            "--ssl-port", action="store", type="string", dest="sslPort", help="Port for https traffic to the web server"
        )
        defaults["sslPort"] = automation.DEFAULT_SSL_PORT

        self.add_option(
            "--remote-logfile",
            action="store",
            type="string",
            dest="remoteLogFile",
            help="Name of log file on the device relative to device root.  PLEASE USE ONLY A FILENAME.",
        )
        defaults["remoteLogFile"] = None

        self.add_option(
            "--pidfile", action="store", type="string", dest="pidFile", help="name of the pidfile to generate"
        )
        defaults["pidFile"] = ""

        self.add_option(
            "--bootstrap",
            action="store_true",
            dest="bootstrap",
            help="test with a bootstrap addon required for native Fennec",
        )
        defaults["bootstrap"] = False

        self.add_option(
            "--dm_trans",
            action="store",
            type="string",
            dest="dm_trans",
            help="the transport to use to communicate with device: [adb|sut]; default=sut",
#.........这里部分代码省略.........
开发者ID:cynthiatang,项目名称:gecko-dev,代码行数:101,代码来源:remotereftest.py


示例20: env_options

def env_options():
    # The server host is set to public localhost IP so that resources can be accessed
    # from Android emulator
    return {"server_host": moznetwork.get_ip(),
            "bind_address": False,
            "supports_debugger": True}
开发者ID:mnot,项目名称:web-platform-tests,代码行数:6,代码来源:fennec.py



注:本文中的moznetwork.get_ip函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python mozpack.path函数代码示例发布时间:2022-05-27
下一篇:
Python reader.read函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap