tests.test_verify module¶
Tests for repomatic.release.verify: native header verification.
- tests.test_verify.test_matching_arch(tmp_path, target, payload)[source]¶
Binary with matching architecture passes verification.
- tests.test_verify.test_mismatched_arch(tmp_path, target, payload)[source]¶
Binary with mismatched architecture or format raises ValueError.
- tests.test_verify.test_verify_binary_rejects_an_unknown_target(tmp_path)[source]¶
The command refuses a target outside the build roster, before any read.
- tests.test_verify.test_verify_binary_passes_a_matching_binary(tmp_path)[source]¶
A binary built for its target passes the architecture and OS floor checks.
- tests.test_verify.test_elf_info_without_verneed(tmp_path)[source]¶
A sectionless ELF reports its machine and no glibc requirement.
- tests.test_verify.test_elf_info_skips_glibc_feature_versions(tmp_path)[source]¶
A feature entry like
GLIBC_ABI_DT_RELRsets no glibc floor.Files linked with packed relocations require it, like the Python interpreter Arch Linux ships.
- tests.test_verify.test_elf_info_orders_glibc_versions_numerically(tmp_path)[source]¶
2.4is older than2.38, which a comparison of strings gets wrong.
- tests.test_verify.test_elf_info_reads_both_classes_and_byte_orders(tmp_path, wide, big_endian)[source]¶
The parser follows the class and byte order the identification declares.
- tests.test_verify.test_elf_info_reads_extended_section_numbering(tmp_path, wide, big_endian)[source]¶
A count held in the
sh_sizeof entry 0 still reads every section.Past
0xff00sections,e_shnumis0and the count moves there, as the ELF specification has it. Read as a file with no section, the glibc floor would vanish and the floor check pass any binary.
- tests.test_verify.test_elf_info_reads_a_section_count_past_the_file_as_what_it_holds(tmp_path)[source]¶
A count larger than the file reads the sections the file holds.
The read is sized by the file, never by a count a corrupt
sh_sizecan put in the billions.
- tests.test_verify.test_elf_info_rejects_a_truncated_header(tmp_path)[source]¶
A file cut inside its ELF header is reported, not read as sectionless.
- tests.test_verify.test_macho_info_fat_slices(tmp_path)[source]¶
CPU types accumulate and the floor maxes across fat slices.
- tests.test_verify.test_pe_machine_parsing(tmp_path)[source]¶
The COFF machine field is read from PE headers, None elsewhere.
- tests.test_verify.test_running_interpreter_parses()[source]¶
The parsers agree with the running interpreter’s own executable.
- tests.test_verify.test_floor_within_bounds_macos(tmp_path)[source]¶
Files at or below the declared macOS floor pass verification.
- tests.test_verify.test_floor_exceeded_macos(tmp_path)[source]¶
A dist file above the declared macOS floor fails verification.