def METHOD_NAME(tmpdir):
    # Test the verification of an entire prefix and its contents
    prefix_path = tmpdir.join("prefix")
    prefix = str(prefix_path)
    spec = spack.spec.Spec("libelf")
    spec._mark_concrete()
    spec.prefix = prefix
    results = spack.verify.check_spec_manifest(spec)
    assert results.has_errors()
    assert prefix in results.errors
    assert results.errors[prefix] == ["manifest missing"]
    metadata_dir = str(prefix_path.join(".spack"))
    bin_dir = str(prefix_path.join("bin"))
    other_dir = str(prefix_path.join("other"))
    for d in (metadata_dir, bin_dir, other_dir):
        fs.mkdirp(d)
    file = os.path.join(other_dir, "file")
    with open(file, "w") as f:
        f.write("I'm a little file short and stout")
    link = os.path.join(bin_dir, "run")
    symlink(file, link)
    spack.verify.write_manifest(spec)
    results = spack.verify.check_spec_manifest(spec)
    assert not results.has_errors()
    os.remove(link)
    malware = os.path.join(metadata_dir, "hiddenmalware")
    with open(malware, "w") as f:
        f.write("Foul evil deeds")
    results = spack.verify.check_spec_manifest(spec)
    assert results.has_errors()
    assert all(x in results.errors for x in (malware, link))
    assert len(results.errors) == 2
    assert results.errors[link] == ["deleted"]
    assert results.errors[malware] == ["added"]
    manifest_file = os.path.join(
        spec.prefix,
        spack.store.STORE.layout.metadata_dir,
        spack.store.STORE.layout.manifest_file_name,
    )
    with open(manifest_file, "w") as f:
        f.write("{This) string is not proper json")
    results = spack.verify.check_spec_manifest(spec)
    assert results.has_errors()
    assert results.errors[spec.prefix] == ["manifest corrupted"]