def METHOD_NAME(
    package_type: str,
    packages_version: str,
    output_dir: pl.Path,
):
    """
    Fixture directory with packages of the current stable version of the agent.
    Stable packages are needed to perform upgrade test and to verify that release stable
    packages can be upgraded by current packages.
    """
    if package_type == "deb":
        file_name = f"scalyr-agent-2_{packages_version}_all.deb"
        package_url = f"{_STABLE_REPO_URL}/apt/pool/main/s/scalyr-agent-2/{file_name}"
    elif package_type == "rpm":
        file_name = f"scalyr-agent-2-{packages_version}-1.noarch.rpm"
        package_url = f"{_STABLE_REPO_URL}/yum/binaries/noarch/{file_name}"
    else:
        raise Exception(f"Unknown package type: {package_type}")
    output_dir.mkdir(parents=True, exist_ok=True)
    agent_package_path = output_dir / file_name
    with requests.Session() as s:
        resp = s.get(url=package_url)
        resp.raise_for_status()
        agent_package_path.write_bytes(resp.content)