RPM Prefetching Integration Test Proposal #516
Replies: 3 comments 7 replies
-
@brunoapimentel validation of the generated .repo files would nice too |
Beta Was this translation helpful? Give feedback.
-
Hmm, true about the e2e test. So what about adding an
Nah, for the e2e you're right, as long as it builds hermetically it's enough of a proof. |
Beta Was this translation helpful? Give feedback.
-
1- E2E test
A test to cover the prefetching of RPMs, injection of project-files (i.e. creating the repofiles) and installing the RPMs hermetically during the container build. After the image is built, the installed package needs to generate some type of output that can be validated, so we can assure it was properly installed. The generated SBOM also needs to be checked and its accuracy validated.
The test repository needs to have a lockfile containing a target RPM with several dependencies, as well as contain valid checksums, file size and corresponding source RPMs.
This test will only target builds on a x86_64 arch. This way, it can still be run in the Github CI.
2- Missing checksums
Covers the reporting of missing checksums in the SBOM. The test repository needs to contain a very simple RPMs lockfile with some missing checksums.
This test will only validate the prefetch step, which means that no image build is required. The SBOM needs to be verified to make sure the RPMs with missing checksums were properly reported.
3- Invalid checksum
Validates that an incorrect checksum in the lockfile will cause the prefetch to fail. The test repository needs to contain a very simple RPMs lockfile with at least one invalid checksum. The test will also validate that the error message is correct.
4- Invalid file size
Validates that an incorrect file size in the lockfile will cause the prefetch to fail. The test repository needs to contain a very simple RPMs lockfile with at least one incorrect file size. The test will also validate that the error message is correct.
5- Multiple packages
Validates that Cachi2 is able to process multiple lockfiles in the same repository, as well as appropriatly reporting the prefetched RPMs in the SBOM. The test repository needs to cover the following scenarios:
6- Multi Arch
Validates that Cachi2 is able to process multiple architectures in the same lockfile, as well as appropriatly reporting the prefetched RPMs in the SBOM. The test repository needs to contain at least two different architectures, with the same packages reflected in both, as well as contain the corresponding source RPMs. The test will validate the every package is reported correctly with the PURL indicating which arch it corresponds to.
The following scenarios also need to be covered:
Note that this test will not cover any container builds, the checks will be done on the content generated by Cachi2 only.
7- Creation of the .repo file and repository metadata
Validates that the
inject-files
command is able to generate correct output for RPM prefetch content. The test repository needs to contain a very simple RPMs lockfile that can be prefetched correctly. The test will then execute theinject-files
command and verify thatrepos.d/cachi2.repo
andrepodata/repomd.xml
were properly created. There is no need to actually perform the container build in this test`.It would be interesting to also test the passing of
dnf
options (currently being worked on #522).Beta Was this translation helpful? Give feedback.
All reactions