test: add repository metadata for osbuild-depsolve-dnf

Add two test rpm metadata directories that can be served as RPM repos.
One was copied from osbuild/images and contains the repository metadata
for CentOS Stream 9 BaseOS.
The second was created by building a simple spec file into an RPM and
creating the metadata using createrepo.
This commit is contained in:
Achilleas Koutsou 2024-03-20 17:07:09 +01:00 committed by Brian C. Lane
parent ffa1e91707
commit bc08eed1ef
9 changed files with 101 additions and 0 deletions

View file

@ -0,0 +1,31 @@
# Test repositories metadata
This directory is used for `osbuild-depsolve-dnf` unit tests.
Each subdirectory contains repository metadata that is served by a server during testing for `osbuild-depsolve-dnf` to query.
- `baseos`: CS9 BaseOS repository metadata.
- `custom`: a custom repository containing a single (empty) package, created with:
```bash
rpmdir=$(mktemp -d)
cat <<EOF > "${rpmdir}/nothing.spec"
#----------- spec file starts ---------------
Name: nothing
Version: 1.0.0
Release: 0
BuildArch: noarch
Vendor: noone
Summary: Provides %{name}
License: BSD
Provides: nothing
%description
%{summary}
%files
EOF
rpmbuild --quiet --define "_topdir ${rpmdir}" -bb "${rpmdir}/nothing.spec"
createrepo "${rpmdir}/RPMS/noarch/"
mkdir -p ./test/data/testrepos/custom
cp -a "${rpmdir}/RPMS/noarch/repodata" ./test/data/testrepos/custom
```

View file

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<repomd xmlns="http://linux.duke.edu/metadata/repo" xmlns:rpm="http://linux.duke.edu/metadata/rpm">
<revision>1644263915</revision>
<data type="primary">
<checksum type="sha256">130494033cb9bffa40828ebc814d016920d9ce5d60041467af283ffcf38adef0</checksum>
<open-checksum type="sha256">4fd621cd9253a7d7013af758bbf4b200142f29515ad0fb99d544864a5ad7e4a7</open-checksum>
<location href="repodata/130494033cb9bffa40828ebc814d016920d9ce5d60041467af283ffcf38adef0-primary.xml.gz"/>
<timestamp>1644263915</timestamp>
<size>1063488</size>
<open-size>8471009</open-size>
</data>
<data type="filelists">
<checksum type="sha256">7b99933643e8bff43d3d82180e7d678fac89b6a1b9b8f5f88ea93a5c3b9b5dbd</checksum>
<open-checksum type="sha256">ed7d3c472ce8251bd9747e5fdc5c5e294de84fe3c77f62ecf5911483208e96ee</open-checksum>
<location href="repodata/7b99933643e8bff43d3d82180e7d678fac89b6a1b9b8f5f88ea93a5c3b9b5dbd-filelists.xml.gz"/>
<timestamp>1644263915</timestamp>
<size>612567</size>
<open-size>5894169</open-size>
</data>
<data type="other">
<checksum type="sha256">07a7871013790fe15ece5d85aa1cfdd33813368882f8dfd58079f9c72926c609</checksum>
<open-checksum type="sha256">03b2abe3a30652b84daa0c7e37cdb9b7e9c12b44c6f96ba8aed87849fa5121c9</open-checksum>
<location href="repodata/07a7871013790fe15ece5d85aa1cfdd33813368882f8dfd58079f9c72926c609-other.xml.gz"/>
<timestamp>1644263915</timestamp>
<size>532333</size>
<open-size>4123156</open-size>
</data>
<data type="group">
<checksum type="sha256">40232bada337516d6e75012012436d8138a529f3ac7171f07fbef5bd6c6e6a3a</checksum>
<location href="repodata/40232bada337516d6e75012012436d8138a529f3ac7171f07fbef5bd6c6e6a3a-comps-BaseOS.x86_64.xml"/>
<timestamp>1644263907</timestamp>
<size>39248</size>
</data>
<data type="group_gz">
<checksum type="sha256">2ac4e27794f840034a13bb60800aba194e89fcd2175c87f57cfbd649139feff3</checksum>
<open-checksum type="sha256">40232bada337516d6e75012012436d8138a529f3ac7171f07fbef5bd6c6e6a3a</open-checksum>
<location href="repodata/2ac4e27794f840034a13bb60800aba194e89fcd2175c87f57cfbd649139feff3-comps-BaseOS.x86_64.xml.gz"/>
<timestamp>1644263915</timestamp>
<size>4733</size>
<open-size>39248</open-size>
</data>
</repomd>

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<repomd xmlns="http://linux.duke.edu/metadata/repo" xmlns:rpm="http://linux.duke.edu/metadata/rpm">
<revision>1711036975</revision>
<data type="primary">
<checksum type="sha256">d13ac184dc585096c46f012180458480279d1ec0ce9382a574ab498cb2c55795</checksum>
<open-checksum type="sha256">9c599fb11fa679526ecb89070f9b878b124f9ca65b88a78e3af36cbc06452439</open-checksum>
<location href="repodata/d13ac184dc585096c46f012180458480279d1ec0ce9382a574ab498cb2c55795-primary.xml.zst"/>
<timestamp>1711036975</timestamp>
<size>569</size>
<open-size>1102</open-size>
</data>
<data type="filelists">
<checksum type="sha256">4af4575ea55e40293989e81f9e3e9328a97c9c3b293cc69b02f6bd6cdb8f84c6</checksum>
<open-checksum type="sha256">828a8c2e757f3b1a51f09e48f342eedcc2eabf733e69ca6376266025d4de1325</open-checksum>
<location href="repodata/4af4575ea55e40293989e81f9e3e9328a97c9c3b293cc69b02f6bd6cdb8f84c6-filelists.xml.zst"/>
<timestamp>1711036975</timestamp>
<size>227</size>
<open-size>291</open-size>
</data>
<data type="other">
<checksum type="sha256">12f698f748c6bf69c336ea9299b6ad622c83cd3402eb3c37a9984ae65d318c8f</checksum>
<open-checksum type="sha256">2b30284c414f2d9ffc2f61f80b575b146cb39151f01cdcfb8736100873f82afe</open-checksum>
<location href="repodata/12f698f748c6bf69c336ea9299b6ad622c83cd3402eb3c37a9984ae65d318c8f-other.xml.zst"/>
<timestamp>1711036975</timestamp>
<size>225</size>
<open-size>287</open-size>
</data>
</repomd>