From Fedora Project Wiki
Description
This test case validates the createrepo_c
tool's ability to generate a metadata repository from a directory of RPM packages. It also ensures the createrepo_c-libs
package supports this functionality.
Setup
- Install a fresh version of Fedora.
- Install the necessary packages:
sudo dnf install createrepo_c createrepo_c-libs
. - Prepare a directory with a few RPM packages:
mkdir /path/to/rpms
and place some RPM files inside.
How to test
- Navigate to the directory with RPMs:
cd /path/to/rpms
. - Run
createrepo_c .
to generate a metadata repository in the current directory. - Check for the presence of the
repodata
directory within/path/to/rpms
. - Examine the
repodata
directory for XML metadata files such asprimary.xml.zst
,filelists.xml.zst
, andother.xml.zst
.
Expected Results
- Running
createrepo_c .
should complete without errors. - A
repodata
directory should be created in/path/to/rpms
. - The
repodata
directory should contain XML metadata files. - Metadata files like
primary.xml.gz
,filelists.xml.zst
, andother.xml.zst
should be non-empty and contain information about the RPM packages in the directory.
Optional
For extended testing:
- Use
yum
ordnf
to create a local repo file pointing to/path/to/rpms
and try installing a package from this local repository to ensure the generated metadata is accurate and functional. - Modify one of the RPMs or add a new RPM, then update the repository using
createrepo_c --update .
and verify that the changes are reflected in the metadata. - Examine the library calls and functions by utilizing debug tools or ldd to ensure the proper functioning and linkage of
createrepo_c-libs
.