Example #1
0
def run_remote_integration_tests(parsed_args, argv,
                                 configs_for_integration_tests):
  executor = _create_remote_executor(
      parsed_args, enable_pseudo_tty=parsed_args.ansi)
  try:
    executor.rsync(
        remote_executor_util.get_integration_test_deps() +
        configs_for_integration_tests,
        executor.get_remote_arc_root())
    _set_nacl_resource_permission(executor)

    command = ' '.join(
        ['cd', executor.get_remote_arc_root(), '&&',
         remote_executor_util.SYNC_CHROME, '--verbose', '&&',
         remote_executor_util.SYNC_ADB, '--target=win-x86_64', '&&',
         remote_executor_util.SYNC_ANDROID_SDK_BUILD_TOOLS, '&&',
         executor.get_remote_env(),
         './run_integration_tests'] +
        remote_executor_util.create_launch_remote_chrome_param(argv) +
        # Some tests rely on the error message, which can be localized.
        # So here, set lang=en_US to avoid such message mismatching.
        ['--launch-chrome-opt=--lang=en_US'])
    executor.run(command)
    return 0
  except subprocess.CalledProcessError as e:
    return e.returncode
Example #2
0
def run_remote_integration_tests(parsed_args, argv,
                                 configs_for_integration_tests):
    executor = _create_remote_executor(parsed_args,
                                       enable_pseudo_tty=parsed_args.ansi)
    try:
        executor.rsync(
            remote_executor_util.get_integration_test_deps() +
            configs_for_integration_tests, executor.get_remote_arc_root())
        _set_nacl_resource_permission(executor)

        command = ' '.join(
            [
                'cd',
                executor.get_remote_arc_root(), '&&',
                remote_executor_util.SYNC_CHROME, '--verbose', '&&',
                remote_executor_util.SYNC_ADB, '--target=win-x86_64', '&&',
                remote_executor_util.SYNC_ANDROID_SDK_BUILD_TOOLS, '&&',
                executor.get_remote_env(), './run_integration_tests'
            ] + remote_executor_util.create_launch_remote_chrome_param(argv) +
            # Some tests rely on the error message, which can be localized.
            # So here, set lang=en_US to avoid such message mismatching.
            ['--launch-chrome-opt=--lang=en_US'])
        executor.run(command)
        return 0
    except subprocess.CalledProcessError as e:
        return e.returncode
Example #3
0
def launch_remote_chrome(parsed_args, argv):
    try:
        attach_nacl_gdb_type = None
        nacl_helper_nonsfi_binary = None
        need_copy_nacl_helper_nonsfi_binary = False
        jdb_port = None
        jdb_type = None

        if 'plugin' in parsed_args.gdb:
            attach_nacl_gdb_type = parsed_args.gdb_type
            if OPTIONS.is_bare_metal_build():
                nacl_helper_nonsfi_binary = parsed_args.nacl_helper_nonsfi_binary
                if not nacl_helper_nonsfi_binary:
                    # We decide the path here, but the binary can be copied after
                    # RemoteExecutor is constructed.
                    nacl_helper_nonsfi_binary = os.path.join(
                        remote_executor_util.get_remote_binaries_dir(),
                        os.path.basename(_REMOTE_NACL_HELPER_NONSFI_BINARY))
                    need_copy_nacl_helper_nonsfi_binary = True

        if 'jdb_port' in vars(parsed_args) and 'jdb_type' in vars(parsed_args):
            jdb_port = parsed_args.jdb_port
            jdb_type = parsed_args.jdb_type

        executor = _create_remote_executor(
            parsed_args,
            attach_nacl_gdb_type=attach_nacl_gdb_type,
            nacl_helper_nonsfi_binary=nacl_helper_nonsfi_binary,
            arc_dir_name=parsed_args.remote_arc_dir_name,
            jdb_port=jdb_port,
            jdb_type=jdb_type)

        copied_files = remote_executor_util.get_launch_chrome_deps(parsed_args)
        _setup_remote_environment(parsed_args, executor, copied_files)

        if need_copy_nacl_helper_nonsfi_binary:
            remote_binaries = [_REMOTE_NACL_HELPER_NONSFI_BINARY]
            executor.copy_remote_files(
                remote_binaries,
                remote_executor_util.get_remote_binaries_dir())

        if nacl_helper_nonsfi_binary:
            # This should not happen, but for just in case.
            assert os.path.exists(nacl_helper_nonsfi_binary)
            # -v: show the killed process, -w: wait for the killed process to die.
            executor.run('sudo killall -vw gdbserver', ignore_failure=True)

        command = ' '.join(
            ['sudo', '-u', 'chronos',
             executor.get_remote_env()] +
            launch_chrome_util.get_launch_chrome_command(
                remote_executor_util.create_launch_remote_chrome_param(argv)))
        executor.run_with_filter(command)
    except subprocess.CalledProcessError as e:
        sys.exit(e.returncode)
def launch_remote_chrome(parsed_args, argv):
    try:
        attach_nacl_gdb_type = None
        nacl_helper_nonsfi_binary = None
        need_copy_nacl_helper_nonsfi_binary = False
        jdb_port = None
        jdb_type = None

        if "plugin" in parsed_args.gdb:
            attach_nacl_gdb_type = parsed_args.gdb_type
            if OPTIONS.is_bare_metal_build():
                nacl_helper_nonsfi_binary = parsed_args.nacl_helper_nonsfi_binary
                if not nacl_helper_nonsfi_binary:
                    # We decide the path here, but the binary can be copied after
                    # RemoteExecutor is constructed.
                    nacl_helper_nonsfi_binary = os.path.join(
                        remote_executor_util.get_remote_binaries_dir(),
                        os.path.basename(_REMOTE_NACL_HELPER_NONSFI_BINARY),
                    )
                    need_copy_nacl_helper_nonsfi_binary = True

        if "jdb_port" in vars(parsed_args) and "jdb_type" in vars(parsed_args):
            jdb_port = parsed_args.jdb_port
            jdb_type = parsed_args.jdb_type

        executor = _create_remote_executor(
            parsed_args,
            attach_nacl_gdb_type=attach_nacl_gdb_type,
            nacl_helper_nonsfi_binary=nacl_helper_nonsfi_binary,
            arc_dir_name=parsed_args.remote_arc_dir_name,
            jdb_port=jdb_port,
            jdb_type=jdb_type,
        )

        copied_files = remote_executor_util.get_launch_chrome_deps(parsed_args)
        _setup_remote_environment(parsed_args, executor, copied_files)

        if need_copy_nacl_helper_nonsfi_binary:
            remote_binaries = [_REMOTE_NACL_HELPER_NONSFI_BINARY]
            executor.copy_remote_files(remote_binaries, remote_executor_util.get_remote_binaries_dir())

        if nacl_helper_nonsfi_binary:
            # This should not happen, but for just in case.
            assert os.path.exists(nacl_helper_nonsfi_binary)
            # -v: show the killed process, -w: wait for the killed process to die.
            executor.run("sudo killall -vw gdbserver", ignore_failure=True)

        command = " ".join(
            ["sudo", "-u", "chronos", executor.get_remote_env()]
            + launch_chrome_util.get_launch_chrome_command(remote_executor_util.create_launch_remote_chrome_param(argv))
        )
        executor.run_with_filter(command)
    except subprocess.CalledProcessError as e:
        sys.exit(e.returncode)
def run_remote_integration_tests(parsed_args, argv, configs_for_integration_tests):
    try:
        executor = _create_remote_executor(parsed_args, enable_pseudo_tty=parsed_args.ansi)
        copied_files = remote_executor_util.get_integration_test_deps() + configs_for_integration_tests
        _setup_remote_environment(parsed_args, executor, copied_files)
        command = " ".join(
            ["sudo", "-u", "chronos", executor.get_remote_env(), "/bin/sh", "./run_integration_tests"]
            + remote_executor_util.create_launch_remote_chrome_param(argv)
        )
        executor.run_with_filter(command)
        return 0
    except subprocess.CalledProcessError as e:
        return e.returncode
Example #6
0
def launch_remote_chrome(parsed_args, argv):
  executor = remote_executor_util.create_remote_executor(parsed_args)
  try:
    executor.rsync(
        remote_executor_util.get_launch_chrome_deps(parsed_args),
        executor.get_remote_arc_root())
    command = ' '.join(
        ['cd', executor.get_remote_arc_root(), '&&',
         remote_executor_util.SYNC_CHROME, '--verbose', '&&',
         remote_executor_util.SYNC_ADB, '--target=mac-x86_64', '&&'] +
        launch_chrome_util.get_launch_chrome_command(
            remote_executor_util.create_launch_remote_chrome_param(argv)))
    executor.run_with_filter(command)
    return 0
  except subprocess.CalledProcessError as e:
    return e.returncode
Example #7
0
def run_remote_integration_tests(parsed_args, argv,
                                 configs_for_integration_tests):
    try:
        executor = _create_remote_executor(parsed_args,
                                           enable_pseudo_tty=parsed_args.ansi)
        copied_files = (remote_executor_util.get_integration_test_deps() +
                        configs_for_integration_tests)
        _setup_remote_environment(parsed_args, executor, copied_files)
        command = ' '.join([
            'sudo', '-u', 'chronos',
            executor.get_remote_env(), '/bin/sh', './run_integration_tests'
        ] + remote_executor_util.create_launch_remote_chrome_param(argv))
        executor.run_with_filter(command)
        return 0
    except subprocess.CalledProcessError as e:
        return e.returncode
Example #8
0
def launch_remote_chrome(parsed_args, argv):
  executor = _create_remote_executor(parsed_args)
  try:
    executor.rsync(
        remote_executor_util.get_launch_chrome_deps(parsed_args),
        executor.get_remote_arc_root())
    _set_nacl_resource_permission(executor)

    # To launch arc successfully, it is necessary to set TMP env value
    # manually here (the param is usually delegated from the parent process).
    command = ' '.join(
        ['cd', executor.get_remote_arc_root(), '&&',
         remote_executor_util.SYNC_CHROME, '--verbose', '&&',
         remote_executor_util.SYNC_ADB, '--target=win-x86_64', '&&',
         executor.get_remote_env()] +
        launch_chrome_util.get_launch_chrome_command(
            remote_executor_util.create_launch_remote_chrome_param(argv)))
    executor.run_with_filter(command)
    return 0
  except subprocess.CalledProcessError as e:
    return e.returncode
Example #9
0
def launch_remote_chrome(parsed_args, argv):
    executor = _create_remote_executor(parsed_args)
    try:
        executor.rsync(
            remote_executor_util.get_launch_chrome_deps(parsed_args),
            executor.get_remote_arc_root())
        _set_nacl_resource_permission(executor)

        # To launch arc successfully, it is necessary to set TMP env value
        # manually here (the param is usually delegated from the parent process).
        command = ' '.join([
            'cd',
            executor.get_remote_arc_root(), '&&',
            remote_executor_util.SYNC_CHROME, '--verbose', '&&',
            remote_executor_util.SYNC_ADB, '--target=win-x86_64', '&&',
            executor.get_remote_env()
        ] + launch_chrome_util.get_launch_chrome_command(
            remote_executor_util.create_launch_remote_chrome_param(argv)))
        executor.run_with_filter(command)
        return 0
    except subprocess.CalledProcessError as e:
        return e.returncode