Пример #1
0
def install_app(logger,
                appname,
                version,
                apptype,
                apppath,
                all_perms,
                extrafiles,
                launch=False):

    logger.debug('uninstalling: %s' % appname)
    fxos_appgen.uninstall_app(appname)

    logger.debug('packaging: %s version: %s apptype: %s all_perms: %s' %
                 (appname, version, apptype, all_perms))

    details = fxos_appgen.create_details(version, all_perms=all_perms)
    manifest = json.dumps(
        fxos_appgen.create_manifest(appname, details, apptype, version))
    files = extrafiles.copy()
    files['manifest.webapp'] = manifest
    package_app(apppath, files)

    logger.debug('installing: %s' % appname)
    fxos_appgen.install_app(appname, 'app.zip', script_timeout=120000)
    if launch:
        logger.debug('launching: %s' % appname)
        fxos_appgen.launch_app(appname)
Пример #2
0
def install_app(logger, appname, version, apptype, apppath, all_perms,
                extrafiles, launch=False):

    logger.debug('uninstalling: %s' % appname)
    fxos_appgen.uninstall_app(appname)

    logger.debug('packaging: %s version: %s apptype: %s all_perms: %s' %
        (appname, version, apptype, all_perms))
    details = fxos_appgen.create_details(version, all_perms=all_perms)
    manifest = json.dumps(fxos_appgen.create_manifest(appname, details, apptype, version))
    files = extrafiles.copy()
    files['manifest.webapp'] = manifest
    package_app(apppath, files)

    logger.debug('installing: %s' % appname)
    fxos_appgen.install_app(appname, 'app.zip', script_timeout=30000)
    if launch:
        logger.debug('launching: %s' % appname)
        fxos_appgen.launch_app(appname)
Пример #3
0
            os.remove(omni_results_path)

    # run webapi, webidl and permissions tests
    if 'webapi' in test_groups:
        logger.test_start('webapi')

        httpd = wptserve.server.WebTestHttpd(
            host=moznetwork.get_ip(), port=0, routes=routes, doc_root=static_path)
        httpd.start()
        addr = (httpd.host, httpd.port)

        print "Installing the hosted app. This will take a minute... "

        appname = 'WebAPI Verifier'
        details = fxos_appgen.create_details(args.version, all_perms=True)
        manifest = json.dumps(fxos_appgen.create_manifest(appname, details, 'web', args.version))

        apppath = os.path.join(static_path, 'webapi-test-app')
        package_app(apppath, {'results_uri.js': 'RESULTS_URI="http://%s:%s/webapi_results";' % addr,
                              'manifest.webapp': manifest})

        # if we have recently rebooted, we might get here before marionette
        # is running.
        retries = 0
        while retries < 3:
            try:
                fxos_appgen.install_app(appname, 'app.zip', script_timeout=30000)
                break
            except marionette.errors.InvalidResponseException:
                time.sleep(5)
                retries += 1