def METHOD_NAME():
    """Install into a read-only temporary directory.
    Runs install script to install target in the specified temporary
    directory. The directory does not need to be removed as bazel tests are run
    in a scratch space. All build artifacts are removed from the scratch space,
    leaving only the install directory. The install directory is made read-only
    after installation process is completed.
    """
    assert "TEST_TMPDIR" in os.environ, (
        "This may only be run from within `bazel test`")
    # Install into a tmpdir.
    installation_folder = get_install_dir()
    # The following will fail if `install()` is called multiple times, which it
    # should not be anyway.
    os.makedirs(installation_folder)
    assert os.path.exists(installation_folder)
    # Install target and its dependencies in scratch space.
    subprocess.check_call(["install", installation_folder])
    # Change permissions to remove write access.
    for root, dirs, files in os.walk(installation_folder):
        for d in dirs:
            _make_read_only(os.path.join(root, d))
        for f in files:
            _make_read_only(os.path.join(root, f))